Script To Generate Parallel Lines in Photoshop

How can I generate parallel lines so that each line is spaced uniformly as it fills up the entire document? In the simple script below, I used the underscore to create the line. My problem seems to be that the succeeding lines (layers) are always aligned to the first layer in the iteration. How can that be fixed? Thanks in advanced.
// This script will create parallel lines which can be used for designing pages with lines
var defaultRulerUnits = preferences.rulerUnits;
preferences.rulerUnits = Units.PIXELS;
bgLine = new SolidColor();
      bgLine.rgb.red = 255;
      bgLine.rgb.green = 255;
      bgLine.rgb.blue = 255;
      backgroundColor = bgLine;
var newDocumentRef = documents.add(600,1000, 72.0, "Parallel Lines Generator");
newDocumentRef = null;
var textArray = [
//if additional lines are needed, it can be just added to the array
var AD = activeDocument ;
for(a=1;a<=textArray.length;a++){
      var TextLayer = AD.artLayers.add();
      TextLayer.kind = LayerKind.TEXT;
      TextLayer.opacity = 100;
       var txtRef = TextLayer.textItem;
            txtRef.font = "Arial";
            txtRef.contents = textArray[a-1];
            txtRef.size = 12;
            var textPosition = [30,  20]; // 30 is the margin and 20 is distance from top. The next text line should be 20 + 20 (can be any uniform increment desired)
            txtRef.position = textPosition;  // I cannot seem to get the next layer move down by a uniform increment, let us say 20 pixels
// Merge all the Text Layers and leave the entire file unflattened
    var background = AD.layers[AD.layers.length -1];
    if (background.isBackgroundLayer) {
        background.visible = false;
        AD.mergeVisibleLayers();
        background.visible = true;
// At this point, I like to rename the merged text layer with a layer name "Parallel Lines" before saving it as psd file.
preferences.rulerUnits = defaultRulerUnits;

And here is another alternative....
#target Photoshop
app.bringToFront();
function main(){
if(!documents.length) return;
var win = new Window( 'dialog', 'Draw Lines' );
g = win.graphics;
var myBrush = g.newBrush(g.BrushType.SOLID_COLOR, [0.99, 0.99, 0.99, 1]);
g.backgroundColor = myBrush;
win.orientation='row';
win.p1= win.add("panel", undefined, undefined, {borderStyle:"black"});
win.g1 = win.p1.add('group');
win.g1.orientation = "row";
win.title = win.g1.add('statictext',undefined,'Draw Lines');
win.title.alignment="fill";
var g = win.title.graphics;
g.font = ScriptUI.newFont("Georgia","BOLDITALIC",22);
win.g5 =win.p1.add('group');
win.g5.orientation = "row";
win.g5.alignment='fill';
win.g5.spacing=10;
win.g5.st1 = win.g5.add('statictext',undefined,'Number of lines Vertical');
win.g5.st1.preferredSize=[150,20];
win.g5.et1 = win.g5.add('edittext',undefined,'0');
win.g5.et1.preferredSize=[50,20];
win.g5.et1.onChanging = function() {
  if (this.text.match(/[^\-\.\d]/)) {
    this.text = this.text.replace(/[^\-\.\d]/g, '');
win.g10 =win.p1.add('group');
win.g10.orientation = "row";
win.g10.alignment='fill';
win.g10.st1 = win.g10.add('statictext',undefined,'Number of lines Horizontal');
win.g10.st1.preferredSize=[150,20];
win.g10.et1 = win.g10.add('edittext',undefined,'0');
win.g10.et1.preferredSize=[50,20];
win.g10.et1.onChanging = function() {
  if (this.text.match(/[^\-\.\d]/)) {
    this.text = this.text.replace(/[^\-\.\d]/g, '');
win.g15 =win.p1.add('group');
win.g15.orientation = "row";
win.g15.alignment='fill';
win.g10.st1 = win.g15.add('statictext',undefined,'Line Width');
win.g10.dd1 = win.g15.add('dropdownlist');
for(var t =1;t<21;t++){
    win.g10.dd1.add('item',t);
win.g10.dd1.selection=0;
win.g100 =win.p1.add('group');
win.g100.orientation = "row";
win.g100.alignment='fill';
win.g100.bu1 = win.g100.add('button',undefined,'Add Lines');
win.g100.bu1.preferredSize=[110,25];
win.g100.bu2 = win.g100.add('button',undefined,'Cancel');
win.g100.bu2.preferredSize=[110,25];
win.g100.bu1.onClick=function(){
win.close(0);
var horz = Number(win.g10.et1.text);
var vert = Number(win.g5.et1.text);
var lineWidth = win.g10.dd1.selection.index + 1;
var crossHatch = activeDocument.artLayers.add();
crossHatch.name = "Draw Lines";
var spaceH = activeDocument.height.as('px')/(horz+1);
var spaceV = activeDocument.width.as('px')/(vert+1);
var spcH = spaceH;
var spcV = spaceV;
for(var a =0;a<horz;a++){
   lineHorzVert(spcH,'H',lineWidth);
   spcH +=spaceH;
for(var v =0;v<vert;v++){
    lineHorzVert(spcV,'V',lineWidth);
    spcV +=spaceV;
function lineHorzVert(space,HV,strokeWidth) {
if(HV.toLowerCase() == 'h'){
    HV = 'Sngr'; LT = 'Top ';
    }else{
         HV = 'Sngc'; LT = 'Left';
var Black = new SolidColor();
Black.rgb.hexValue = '000000';
    var desc = new ActionDescriptor();
        var ref = new ActionReference();
        ref.putProperty( charIDToTypeID('Chnl'), charIDToTypeID('fsel') );
    desc.putReference( charIDToTypeID('null'), ref );
        var desc2 = new ActionDescriptor();
        desc2.putUnitDouble( charIDToTypeID(LT), charIDToTypeID('#Pxl'), space );
    desc.putObject( charIDToTypeID('T   '), charIDToTypeID(HV), desc2 );
    try{
    executeAction( charIDToTypeID('setd'), desc, DialogModes.NO );
    activeDocument.selection.stroke (Black, strokeWidth, StrokeLocation.CENTER, ColorBlendMode.NORMAL, 100, false);
    activeDocument.selection.deselect();
    }catch(e){}
win.center();
win.show();
main();

Similar Messages

  • A ksh script that generates a ksh script

    I am writing a ksh script to generate a ksh script. A snippet of the first script is shown below. The output that is generated is shown following that.
    First script:
    StartScript()
    echo $*
    StartScript log\(\)
    StartScript {
    StartScript 'echo $* >>$LOGGGGGGFILE'
    StartScript }
    This is the output that is produced:
    log()
    echo $LOGFILE
    $LOGGGGGGFILE}
    I can't figure out where the $LOGFILE is coming from....it should be $*. I've tried various permutations of quoting and backslashing, but nothing works.
    This is really strange, does anyone have any suggestions on how to do this?
    Thanks in advance
    Al

    The single or 'hard' quote around this line:
    StartScript 'echo $ >>$LOGGGGGGFILE'prevents the shell from interpreting the $ as a "value-of" operator. Use double quotes ("soft" quotes) and it should be fine.

  • Help with java script to generate filename without extension

    There is a java script that generates a filename on a photographic image for professional purposes ie. proofing etc.
    it currently displays the filename and extension (123.jpg) and i would like it to simply display the filename minus the extension (123)
    this is the string that commands the filename to show up in Photoshop CS.
    myTextRef.contents = docRef.name;
    any ideas on how to eliminate the extension?

    var n = docRef.name;
    myTextRef.contents = n.substring(0, n.lastIndexOf("."));???

  • Shell script to generate redologs

    i am working on RMAN in test environment.
    beacuse there in no redo generation or very minor redo generation. i want to write a shell script that runs through cron jobs after a specific period of time and generate redo logs . This i want to do for checking RMAN mechanism of backing up archivelogs and also deletion confirmation of archivelogs through rman;
    i write a script but it is not generating redo logs
    #!/bin/sh
    export ORACLE_HOME=/opt/dev/oracle/db/tech_st/11.1.0
    cd $ORACLE_HOME
    . ./TEST_testing.env
    sqlplus / as sysdba
    sql 'alter system switch logfile';
    exit
    when i run this script only sqlplus is connected but alter system switch logfile not executed.
    please guide me. can i execute sql commands via such script or not. Moreover have a look on script as well.
    Edited by: user13376823 on Feb 16, 2011 5:06 PM

    user13376823 wrote:
    i am working on RMAN in test environment.
    beacuse there in no redo generation or very minor redo generation. i want to write a shell script that runs through cron jobs after a specific period of time and generate redo logs . This i want to do for checking RMAN mechanism of backing up archivelogs and also deletion confirmation of archivelogs through rman;
    i write a script but it is not generating redo logs
    #!/bin/sh
    export ORACLE_HOME=/opt/dev/oracle/db/tech_st/11.1.0
    cd $ORACLE_HOME
    . ./TEST_testing.env
    sqlplus / as sysdba
    sql 'alter system switch logfile';
    exit
    when i run this script only sqlplus is connected but alter system switch logfile not executed.
    That's because sqlplus never sees the statement ... think about how your shell script is proccessed. Walk through it line at a time.
    >
    please guide me. can i execute sql commands via such script or not.Yes you can, but you have to do it properly
    Moreover have a look on script as well.
    I've copied your script below and added line-by-line comments to help you see it the way the shell sees it, Each line of your code is followed by my explanation of how the shell sees that line and what it does with it.
    Edited by: user13376823 on Feb 16, 2011 5:06 PM
    #!/bin/shProcess this script using /bin/sh as the shell processor
    export ORACLE_HOME=/opt/dev/oracle/db/tech_st/11.1.0set the environment variable ORACLE_HOME to the value '/opt/dev/oracle/db/tech_st/11.1.0' and make it available to any child processes
    cd $ORACLE_HOMEchange the current directory to the directory indicated by the value of the environment variable ORACLE_HOME
    . ./TEST_testing.envexecute the file TEST_testing.env, located in the current directory. execute it in the current context
    >
    sqlplus / as sysdbaexecute sqlplus, passing it the command line parameters "/", "as", and "sysdba". It's up to sqlplus to decide what to do with that.
    >
    ----??? sqlplus is waiting for some input
    ----??? still waiting .....
    Ok, maybe you gave up and gave sqlplus an exit command, so the shell can now continue with the next line
    sql 'alter system switch logfile';shell will try to locate an executable file call "sql" and pass it the command line parm "alter system switch log file". Do you have an executable called "sql" to process that command line parm? You probably saw something like:
    ./doit.sh: line 5: sql: command not found
    >
    /and again, the shell really doesn't know what to do with this.
    >
    exitFinally the shell sees a command (exit) it recognizes.
    I did all the above to help you see why it wasn't working. The solution is to use input redirection to feed your sql commands to sqlplus.
    #!/bin/sh
    export ORACLE_HOME=/opt/dev/oracle/db/tech_st/11.1.0
    cd $ORACLE_HOME
    . ./TEST_testing.env
    sqlplus / as sysdba <<EOF
    alter system switch logfile;
    exit
    EOF
    exit >

  • Tool Bar script for generating Email

    Hi experts,
    I have made the following script for sending a custom email.
    And i've the required jar files in the ftp drive on the same server where E-sourcing is installed.
    If anyone can look at this code and tell me whats wrong with it, i'll be realy grateful .
    addClassPath("D:/FTPHOME/MailJar/activation.jar");
    addClassPath("D:/FTPHOME/MailJar/javac.mail.jar");
    addClassPath("D:/FTPHOME/MailJar/mail.jar");
    import java.util.*;
    import javax.mail.*;
    import javax.mail.internet.*;
    import javax.activation.*;
    // Recipient's email ID needs to be mentioned.
    String to = "Email add of recipient";
    // Sender's email ID needs to be mentioned
    String from = "Email add of sender";
    // Assuming you are sending email from localhost
    String host = "IP address of the host ";
    // Get system properties
    Properties properties = System.getProperties();
    // Setup mail server
    properties.setProperty("mail.smtp.host", host);
    // Get the default Session object.
    Session session1 = Session.getDefaultInstance(properties);
    // Create a default MimeMessage object.
    MimeMessage message = new MimeMessage(session1);
    // Set From: header field of the header.
    message.setFrom(new InternetAddress(from));
    // Set To: header field of the header.
    message.addRecipient(Message.RecipientType.TO,
    new InternetAddress(to));
    // Set Subject: header field
    message.setSubject("This is the Subject Line!");
    // Now set the actual message
    message.setText("This is actual message");
    // Send message
    try{
    Transport.send(message);
    catch(Exception e)
    print(e);
    Thanks,
    Abhijit

    I'd like to get from somewhere Oracle tool for
    generating simple SQL script for generating table,
    indexes, constraint (like Toad) and it has to be
    Oracle tool but not Designer.
    SQL Developer is similar to Toad and is an Oracle tool.
    http://www.oracle.com/technology/products/database/sql_developer/index.html

  • Not able to generate multiple lines for headers in report

    Hi,
    I am new to BI publisher and not able to generate multiple lines for headers. Please help me to resolve.
    I am using RTF template, data source as PS Query and XML file (system generated from the data source)
    When I am using system generated 'First XML' file, I am getting output in the follwoing format.
    TEAM_MEMBER, PROJECT_ID, NAME, START_DT
    e.g.
    EMP1 , 71000, Sample, 01-Jan-2010
    EMP1 , 72000, Sample, 01-Feb-2010
    EMP1 , 73000, Sample, 01-March-2010
    But I want the report to be generate with multiple projects for one employee like below format , for that I used 'Second XML' file but I am getting blank report.
    In short if there is one to many case, how to show in reports??? Please correct if I am going wrong.
    TEAM_MEMBER
    PROJECT_ID, NAME, START_DT
    PROJECT_ID, NAME, START_DT
    PROJECT_ID, NAME, START_DT
    e.g.
    EMP1
    71000, Sample, 01-Jan-2010
    72000, Sample, 01-Feb-2010
    73000, Sample, 01-March-2010
    **********First XML**************System generated XML ****************************
    <?xml version="1.0"?>
    <query numrows="2" queryname="SY_EMP_PROJECT" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="">
    <row rownumber="1">
    <TEAM_MEMBER>TEAM_MEMBER </TEAM_MEMBER>
    <PROJECT_ID>PROJECT_ID samp</PROJECT_ID>
    <NAME>NAME sample data</NAME>
    <START_DT>2010-08-25</START_DT>
    </row>
    <row rownumber="2">
    <TEAM_MEMBER>TEAM_MEMBER</TEAM_MEMBER>
    <PROJECT_ID>PROJECT_ID samp</PROJECT_ID>
    <NAME>NAME sample data</NAME>
    <START_DT>2010-08-25</START_DT>
    </row>
    </query>
    **********Second XML**************Manually created XML and using to show multiple projects for one employee****************
    <?xml version="1.0"?>
    <TEST numrows="2" queryname="SY_EMP_PROJECT" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="">
    <TEAM_MEMBER rownumber="1">
    <TEAM_MEMBER>1</TEAM_MEMBER>
    <EMPLOYEE_NAME>SAMPLE</EMPLOYEE_NAME>
    <PROJECT>
    <PROJECT_ID>1111</PROJECT_ID>
         <PROJECT_DESCR>SAMPLE</PROJECT_DESCR>
    <START_DATE>01012010</START_DATE>
    </PROJECT>
    <PROJECT>
    <PROJECT_ID>1112</PROJECT_ID>
         <PROJECT_DESCR>SAMPLE</PROJECT_DESCR>
    <START_DATE>01022010</START_DATE>
    </PROJECT>
    </TEAM_MEMBER>
    <TEAM_MEMBER rownumber="2">
    <TEAM_MEMBER>2</TEAM_MEMBER>
    <EMPLOYEE_NAME>SAMPLEC</EMPLOYEE_NAME>
    <PROJECT>
    <PROJECT_ID>1111</PROJECT_ID>
         <PROJECT_DESCR>SAMPLE</PROJECT_DESCR>
    <START_DATE>01012010</START_DATE>
    </PROJECT>
    <PROJECT>
    <PROJECT_ID>1112</PROJECT_ID>
         <PROJECT_DESCR>SAMPLE</PROJECT_DESCR>
    <START_DATE>01022010</START_DATE>
    </PROJECT>
    </TEAM_MEMBER>
    </TEST>
    Edited by: ganeshtw on Aug 25, 2010 12:14 AM

    Hi,
    With your first xml you can print like
    EMP1
    71000, Sample, 01-Jan-2010
    72000, Sample, 01-Feb-2010
    73000, Sample, 01-March-2010While creating the RTF template you can use the Group by option.
    <?for-each-group:ROW;./columnname> then print the column name
    <?columnname?>
    --Then your table format
    71000, Sample, 01-Jan-2010
    72000, Sample, 01-Feb-2010
    73000, Sample, 01-March-2010
    <?end for-each-group?>
    Thanks.

  • How system will generate schedule line for PO after  MRP run.

    Dear Experts,
                                 i have updated  MPS in MD61, the period indicator was  M (monthly),  after  MRP run, system  generating schedule  lines  on daily basis for Scheduling Agreement(ME38), i want  schedule lines   on mpnthly basis, how to achive this,
    thanks in advance.
    regards
    rajakarthik

    Hi
    1. Are you maintaining any Planning time fence period for MPS- No 
    2. What is the PIR qty you maintained in MD61:
                                                                                    i.) FG01 is having BOM  child part RM01.
                              To  produce 1 nos of  FG01 , I need 1 nos of  RM01                                                                               
    ii.) i maintained  FG01 in MD61  with PIR  Qty 5000. in MD61,Planning period is M  and planning hirizon1- jan10To 31-Jan10
           ii.)  i maintained lot size:Monthly lot size for RM01.
           iii.)  there is  no stock  available for  both RM01 and FG01.                                                                               
    3. After MRP how much qty is get planned on what date-     
         i)   planned order created for FG01 in co41 with qty-5000 nos.
         ii)  in ME38, schedule  line created for RM01,  on 01-01-2010, with 5000 nos,  currently Category of Delivery Date
    field is D and delivery date is   01-01-2010, but i want Category of Delivery Date should  be M and delivery date should be 01.2010.
    thanks
    raja

  • Generate Schedule Lines in PR - ME51N

    Hi,
    Is it possible to generate schedule lines with PR thru ME51N.
    Our requirement is that if we insert Delivery Date in PR line item, system ask for Schedule Line in which we insert the same as per requirement...
    Please suggest..how can we do it???

    Hi,
    As already solution provided, 2 points I would like to mention,
    Delivery date in ME51N not only meant to enter manually. Its automatically calculated and overwritten your entered date - it populates calculating valid delivery times available in info records, purchase organization data from planned delivery time, GR processing time etc.
    The best solution is go ahead with Scheduling agreement. For every requirement if you are not able to go ahead with Contract/Scheduling agreement - go ahead with separate line item with assign source of supply from which planned delivery times calculated automatically or you can enter separately.

  • Generate schedule lines via MRP

    Hi,
    Unable to generate schedule lines via MRP.
    Settings:
    Mat master - External proc , no spl proc
    OA - Maintained
    Source list - Maintained MRP Relevant - Indicator 2
    Quota arrangement- Exist with only 1 vendor(same as of OA) 100%
    MD03 - Planning data - Create PR (indicator-1), Create Sl(indicator 3)
    Please let me know whether there is anything else which influence SL generation.

    Hi,
    hi,
    1. Mark checkbox source list in material master.
    2. purchase info record for the vendor & material combination
    3. source list for the material - mention the scheduling agreement and mark as mrp relevant, schedule lines generated
    4. Use MD03, choosing 1 for purchase requisition, 3 for schedule lines and planning mode, prerequisites requirement exists for material. If requirement does not exists it will not create scheduling agreement line.
    I  hope you got all your answers. so kindly close this thread.
    YB

  • I cannot open a file from LR5 into CC2014 unless it is a smart object. also will not save back to LR at all it gives me an error message "Line: 1 -   photoshop.notifyLightroomDocClosed ('lightroom-2.0', 'B53AFA39-A49B-4709-A9BD-0B6467C175C3', 'Macintosh H

    I cannot open a file from lightroom into CC2014 unless I open it as a smart object. CC opens, just will not display my image. i am given an error code when I save an image, and can only save to my desktop or other locations, not automatically back into my lightroom.
    I am using LR5 latest update, as well as CC2014
    Below is the error message:
    Line: 1 ->  photoshop.notifyLightroomDocClosed ('lightroom-2.0', 'B53AFA39-A49B-4709-A9BD-0B6467C175C3', 'Macintosh HD:Users:BPexposures:Desktop:_DSC5962 as Smart Object-1.psd');

    I was also having this issue, and I did some more searching and found this answer in the Adobe forums: Re: Photos from Lightroom 5 to Photoshop CC (2014) and back.... The issue appears to be caused by having not updated Lightroom to the latest version prior to having CC2014 installed (wow that's stupid). The trick seems to be to uninstall Photoshop CC2014 and to then reinstall it after having upgraded to Lightroom 5.5.

  • Generate 2 line items with posting keys in same table while using  FM .

    Dear Expert ,
    For T-code f-65 ,I have to park a FI Document  .i tried with PRELIMINARY_POSTING_FB01 for parked Document . But  i am not  successfully park the document .
    with the help of F-65 the data Segregate between Tables VBSEGS and VBSEGD with respecting Posting key . but with this Fm entire entry is displaying in table VBSEGS .For example it generated two line items with posting keys '15' and '40' and these both are displayed in VBSEGS whereas posting key '15' has to be displayed in VBSEGD.
    when i check this Document in FBV0 Error reflect " G/L Account 0012000 1001 Does not Exist ".
    Here my code -
    DATA:   XT_BKPF LIKE  BKPF OCCURS 0 WITH HEADER LINE ,
            XT_BSEG LIKE  BSEG OCCURS 0 WITH HEADER LINE ,
            XT_BSEG1 LIKE  BSEG OCCURS 0 WITH HEADER LINE ,
            XT_BSEC LIKE  BSEC OCCURS 0 WITH HEADER LINE ,
            XT_BSET LIKE  BSET OCCURS 0 WITH HEADER LINE ,
            XT_BSEZ LIKE  BSEZ  OCCURS 0 WITH HEADER LINE ,
            XT_BKORM  LIKE  BKORM OCCURS 0 WITH HEADER LINE ,
            XT_THEAD  LIKE  THEAD OCCURS 0 WITH HEADER LINE ,
            XT_SPLTTAB  LIKE  ACSPLT  OCCURS 0 WITH HEADER LINE ,
            XT_SPLTWT LIKE  WITH_ITEMX  OCCURS 0 WITH HEADER LINE .
    DATA :    XTEXT_UPDATE  LIKE  BOOLE-BOOLE VALUE SPACE,
              XTEXT_ITEM_UPDATE LIKE  BOOLE-BOOLE VALUE SPACE,
              XI_UF05A  LIKE  UF05A,
              XI_XCMPL  TYPE  XFELD VALUE 'X',
              XFS006_FB01 LIKE  FS006 ,
              XI_TCODE  LIKE  T020-TCODE  VALUE 'F-65',
              XI_PARGB  LIKE  RF05A-PARGB        ,
              XI_TCODE_INT  TYPE  TCODE           .
    DATA P_RETURN LIKE BAPIRET2 OCCURS 0 WITH HEADER LINE.
    XT_BKPF-BUKRS     =     'CP01'.
    XT_BKPF-GJAHR     =     2011.
    XT_BKPF-BLART     =     'DZ'.
    XT_BKPF-BLDAT     =     SY-DATUM.
    XT_BKPF-BUDAT     =     SY-DATUM.
    XT_BKPF-MONAT     =     '06'.
    XT_BKPF-CPUDT     =     SY-DATUM.
    XT_BKPF-WWERT     = SY-DATUM.
    XT_BKPF-USNAM     =     'ABAPER'.
    XT_BKPF-TCODE     =     'F-65'.
    APPEND XT_BKPF.
    XT_BSEG-BUKRS     =     'CP01'.
    XT_BSEG-GJAHR     =     '2011'.
    XT_BSEG-BUZEI = '001'.
    XT_BSEG-BSCHL = '40'.
    XT_BSEG-KOART = 'S'.
    XT_BSEG-SHKZG = 'S' .
    XT_BSEG-GSBER     =     'CPLN'.
    XT_BSEG-BUPLA = 'CP01'.
    XT_BSEG-WRBTR     =     10000.
    XT_BSEG-PSWSL = 'INR'.
    XT_BSEG-ZUONR = 'CH. 123456'.
    XT_BSEG-HKONT = '241000'.
    APPEND XT_BSEG .
    CLEAR  XT_BSEG.
    Vendor line item - required even for header only - BSEG table
    XT_BSEG-BUKRS     =     'CP01'.
    XT_BSEG-GJAHR     =     '2011'.
    XT_BSEG-BUZEI = '002'.
    XT_BSEG-BSCHL = '15'.
    XT_BSEG-KOART = 'S'.
    XT_BSEG-SHKZG = 'H' .
    XT_BSEG-GSBER     =     'CPLN'.
    XT_BSEG-BUPLA = 'CP01'.
    XT_BSEG-WRBTR     =     10000.
    XT_BSEG-PSWSL = 'INR'.
    XT_BSEG-ZUONR = 'CH. 123456'.
    XT_BSEG-HKONT = 'PC04000001'.
    APPEND XT_BSEG .
    CLEAR  XT_BSEG.
      CALL FUNCTION 'PRELIMINARY_POSTING_FB01'
       EXPORTING
         TEXT_UPDATE            = XTEXT_UPDATE
         TEXT_ITEM_UPDATE       = XTEXT_ITEM_UPDATE
      I_UF05A                =
         I_XCMPL                = XI_XCMPL
      FS006_FB01             =
          I_TCODE                = XI_TCODE
      I_PARGB                =
      I_TCODE_INT            =
      IMPORTING
        XEPBBP                 = CHECK_A
        TABLES
          T_BKPF                 = XT_BKPF
          T_BSEG                 = XT_BSEG
          T_BSEC                 = XT_BSEC
          T_BSET                 = XT_BSET
          T_BSEZ                 = XT_BSEZ
      T_BKORM                =
      T_THEAD                =
      T_SPLTTAB              =
      T_SPLTWT               =
              EXCEPTIONS
                ERROR_MESSAGE = 1.
      P_RETURN-ID         = SY-MSGID.
      P_RETURN-TYPE       = SY-MSGTY.
      P_RETURN-NUMBER     = SY-MSGNO.
      APPEND P_RETURN.
         p_return-MESSAGE_V1 = XSYMSGV.
      IF SY-SUBRC = 0.
        CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
          EXPORTING
            WAIT = 'X'.
      ENDIF.
      WRITE :/ sy-subrc , sy-MSGV1 .
    Thanks ,
    Ashish Gupta

    Hi Raghuram,
    I found a very important SAP Note 103051, details are below.
    An IDoc processed by function module IDOC_INPUT_INVOIC_MM (of category INVOIC01) must not refer to the same purchase order item in several invoice items. This is also valid if for a goods receipt-related invoice verification several delivery notes belong to the same purchase order item.
    Depending on the system settings and the situation, various error messages can occur (for example, FD240 'Order item ... selected more than once' or M8050 'Balance not zero: & debits: & credits: &').
    In this situation module IDOC_INPUT_INVOIC_MRM generates error message M8321 'Document contains same order item more than once'.
    For example, this situation occurs if you work with individual batch valuation and the SD billing document executes a batch split for different batches which belong to the same purchase order item and delivery.
    Other terms
    INVOIC, SAPLIEDI,  M8047, M8, 321
    Reason and Prerequisites
    This is because of the program design.
    Solution
    There is no solution for IDOC_INPUT_INVOIC_MM.
    Module IDOC_INPUT_INVOIC_MRM (only as of Release 4.0) for the logistics invoice verification can distinguish different goods receipts by means of the delivery note number. For this purpose, GR-related invoice verification must be active.
    Owing to this symptom, billing documents for single batch valuation with batch split cannot be settled in MM-EDI inbound processing. The settlement generates exactly the situation described (several invoice items for the same purchase order item). In this case, the only solution is to deactivate the billing of the batch sub-items in SD Customizing and to calculate the main item only.
    Hope this helps.
    Reward if helpful.
    Thanks

  • The RFUMSV50 program does not generate transfer lines of deferred VAT

    Hello;
    The RFUMSV50 program does not generate transfer lines of deferred VAT ,
    The context is the following one:
    Code VAT Created with code target VAT, general account of VAT also created,
    Rule of deferred VAT created and activated for the company code in question, with marks to compensate for check.
    The data of tests are the following ones:
    Creation of an invoice via the FB60,
    Integral payment of the invoice via F-53,
    Creation of the confirmation of the operation in bank via the manual statement FF67,
    Clearing of the intermediate banking account  with the bank account  via F-03.
    After all these elements, by executing the RFUMSV50 program, I have nothing in result.
    There somebody who had the same problem, could help us?
    Thank you.

    Hi
    Service Tax credit cannot be utilized unless the Vendor Invoice is Paid. This is the reason till the payment is done the service tax Amount will be accumulated in deferred tax account and once the invoice is paid the balance in deferred tax is need to be transferred  to respective Service Tax , Educational Cess and higher Education Cess account. There can be various business scenarios for full and Partial Payment to facilitates the transfer of such deferred balance to respective account SAP has come up with some new standard program RFUMSV50 instead of RFUMSV25. To overcome the limitation of this program i.e. not able to take care of more than one tax line item, below the solution is provided with scenarios “Full Payment is made to Vendor Invoice”. 
    hope this is help ful
    thanks
    Trinath

  • Script for generate randomize administrator password which make log file to recorded new administrator password with associated computer name on it

    Hi
    I Need VDS script in order to change domain client local administrator password in my domain ,and put this script in startup script via group policy, but for security purpose  I want to randomize local administrator password and log new password
    set for each computer on a text file, I want to over write the old password of eachcomputer in log file with new one in order to have the update log file ,my support team some times need administrator password for troubleshooting.
    I need a script for generate randomize administrator password  which make log file to recorded new administrator password with associated computer name on it and each time new administrator password set it over write the old record on
    the log file and update the content of log file automatically.
    Regards

    Hi
    I need a script for generate randomize administrator password  which record new password on a  log file with associated computer name  and each time new administrator password set for a computer it  over write the old record
    on the log file and update the content of log file automatically.
    Regards

  • How do I outline an object with a dash line in Photoshop CS6?

    How do I outline an object (silhouette figure) with a dash line in Photoshop CS6? ... never was this difficult.

    I have a silhouetted figure I'd like to outline with a dash line ... Will I have to manually outline the object ... what alternative do I have?

  • I am trying to create a PDF document that calculates Gains and Losses in Mutual Funds. The calculation scripts are repetitive from line to line. The scripts work well until I reach the line 32. Script stops calculating...

    I am trying to create a PDF document that calculates Gains and Losses in Mutual Funds. The calculation scripts are repetitive from line to line. The scripts work well until I reach the line 32. Although I am using the same script as the fields above in the columm, the script eventually stops calculating and I can't figure out why. Is there a limit of how many calculation scripts you can enter? I will attempt to attach my pdf as soon as I figure out how. Thanks.

    For e31 :
    var e30 = +getField("e30").value ;
    var c31 = +getField("c31").value ;
    if ( (e30 !== 0) && (c31 !== 0) ) event.value = e30 + c31 ;
    else event.value = "";
    for e32 :
    var e31 = +getField("e31").value ;
    var c32 = +getField("c32").value ;
    if ( (e31 !== 0) && (c32 !== 0) ) event.value = e31 + c32 ;
    else event.value = "";
    for e33 :
    var e32 = +getField("e32").value ;
    var c33 = +getField("c33").value ;
    if ( (e32 !== 0) && (c33 !== 0) ) event.value = e32 + c33 ;
    else event.value = "";
    Java console doesn't show any error... That's why I am wondering if it's not a limitation issue... or memory issue, because they are maybe too many rows or something....
    The c value is not calculated.

Maybe you are looking for

  • Why does my G4 ibook display only work when it's partially open?

    The display on my iBook G4 shows no video until I nearly close the lid. I can then see the display working but it is at an extreme angle. I'm thinking that it must be a contact problem, but cannot find any forum or troubleshooting support that addres

  • WO basic start date - requirement date

    Good morning folks, Would anyone be able to shed some light on any config that would be suitable for the following: The materials are assigned to a task list that is then assigned to a plan.  That plan is then scheduled and the work orders are genera

  • Office 2010 spell check not working

    Hi, I cant get my spell check to work or underline any incorrect words. I have tried reinstalling word, deleting normal.dotm also the suggestions here http://social.technet.microsoft.com/Forums/en-US/office2010/thread/eb94c560-9bc3-4b51-a2dc-bee5cef4

  • Photoshop 7 compatibility with Vista 64

    I just purchased a new Dell studio computer with Vista 64 OS and Photoshop Elements 7 preloaded.  I cannot get editor to work at all and organizer will not import photos from my camera.  I have followed techs' instructions from Adobe and Dell to no a

  • Will apple ever make a rugged phone

    I want apple to make a phone that can withstand daily beatings, drops, and bangs.  I want a phone that is waterproof, dirt and dust proof, and drop proof. The phones now are fragile and break very easily