Need code sample to execute a command line in form builder

i need to write code in the fmb file
to be executed when running a form

Hi
use this command in your fmb,
Host(<CommandLineCommand>,No_Screen);
hope this works for you.
regards
gaurav

Similar Messages

  • How to run an executable from command-line

    I'm learning how to use the Terminal and I got stuck in a silly thing (I suppose it is). How can I run an executable file from command-line in Terminal?
    For example: I have a file named "Hello" in the folder /sample. If I use the ls command (ls sample), I can see the file Hello. Then I move to the directory (cd /sample) and try to run the file Hello (typing "Hello") but I got "command not found" message.
    If I drag the Hello file from Finder to Terminal and hit Return, it runs perfectly. And if I type the full path to the file (even if I'm already inside its directory), it also runs.
    So, my doubt is if there is any command to run an executable from command-line.
    Thanks

    KJK555 wrote:
    Hi VK:
    Can you enlighten me on why it's neccessary to do the "./" thingy in OS X when in unix/linux
    I never had to resort to doing that?
    Kj
    I took the trouble of reading *man bash* and it explains the issue. to add the current directory to PATH you need to add an empty path to PATH like this
    PATH=$PATH::
    you can add it to ~/.bash_profile so that it's executed automatically when you start bash. I suspect the linux system you are talking about had this set up by default or had it added to PATH in /etc/profile which defines PATH globally.

  • Launch executable with command line arguments

    I have a programmer that I need to launch in my cvi code.  I tried the system command and lauchexecutable command but cannot get the programmer to lauch correctly.  If I run it from the command prompt or create a windows shortcut it works fine.  Here is the shortcut I created:
    C:\TPD\SAVS20P3\asix\up\up.exe /e c:\tpd\savs20p3\q33.hex/erase /q /p
    I'm trying to run the up.exe software with /e c:\tpd\v20_hex\v20.hex /erase /q /p as the command line paramters.
    I tried the following code which created the above path with command line
     strcpy(filename,"C:\\tpd\\savs20p3\\asix\\up\\up.exe /e c:\\tpd\\savs20p3\\hex_ee\\");   ///e c:\\tpd\\savs20p3\\hex_ee\\"");
      strcat(filename, hfile);//hex file name will change dynamically
      strcat(filename, "/q /p");
    I then tried LaunchExecutable(filename) and system(filename).  The system functions gives an error.  Its trying to lauch the /e c:\tpd\v20_hex\v20.hex file
    any suggestions.  I beieve its a simple syntax error.

    Well, apart evident typos in the code you posted, which is not creating the command line you stated, I can only think that before "/q" you should add a space to separate the option from the filename.
    This code should create the correct command line:
    strcpy (hfile, "c:\\tpd\\v20_hex\\v20.hex");
    strcpy (filename, "C:\\tpd\\savs20p3\\asix\\up\\up.exe /e ");
    strcat (filename, hfile);
    strcat (filename, " /erase /q /p");
    Proud to use LW/CVI from 3.1 on.
    My contributions to the Developer Zone Community
    If I have helped you, why not giving me a kudos?

  • How to execute unix command line from cocoa?

    how to execute unix command line from cocoa?
    for example, if I want to call "ping" from cocoa, how should I do it? and how can I obtain the return value?
    thank you.
    Power G5 Quad Mac OS X (10.4.3)

    The following article may also help:
    http://cocoadevcentral.com/articles/000025.php
    Mihalis.
    Dual G5 @ 2GHz   Mac OS X (10.4.6)  

  • Coldfusion 10: execute as command line

    Using CF10 on a unix system.  Attempting to use cfexecute on perl and batch files do not work but they run fine when executed directly from command line.  The perl and bat file permissions are set so anyone can execute them.  Does anyone know if I make coldfusion execute the perl or bat file as if it was running as a command line?  May need to designate specific user the execute them as.
    <cfexecute name="#EDRSDIR#/uploadconvertwrapper.pl" arguments="#filedirectory# #finalfilename# #dcnflag# #splflag# outputFile="/dev/null" timeOut="0" />
    <cfexecute name="#EDRSDIR#/uploadconvert.bat" argumensts="#filedirectory# #finalfilename# #dcnflag# #splflag# outputFile="/dev/null" timeout="0" />

    What about:
    correcting the spelling of 'arguments';
    dropping the .pl and .bat extensions;
    giving the timeout a value greater than 0;
    adding an error variable which you can output for debugging.
    <cfexecute name="#EDRSDIR#/uploadconvertwrapper" arguments="#filedirectory# #finalfilename# #dcnflag# #splflag# errorVariable="errorOutput" timeout="10" />
    <cfexecute name="#EDRSDIR#/uploadconvert" argumensts="#filedirectory# #finalfilename# #dcnflag# #splflag# errorVariable="errorOutput" timeout="10" />

  • Unable to execute a command line command using Java

    I am trying to run a command to add a group name. It is executed in command prompt of Windows 2003/2000
    Say this is the command I want to execute:
    net localgroup LordSM /add
    Here LordSM is the group name.
    I wrote the following code but it does not seem to work. Please suggest.
    String ABC=Value1TextField.getText();
    Value2Label.setText("Value is now " + ABC);
    // Above is to get value from a JText Field
    // Below is the code to run command for adding a group name to a System.
    String ExecutedCmd = "net localgroup " + ABC + "/add";
    Process p = Runtime.getRuntime().exec(ExecutedCmd);
    BufferedReader stdInput = new BufferedReader(new InputStreamReader(p.getInputStream()));
    BufferedReader stdError = new BufferedReader(new InputStreamReader(p.getErrorStream()));
    // read the output from the command
    System.out.println("Here is the standard output of the command:\n");
    while ((s = stdInput.readLine()) != null)
    { System.out.println(s); }
    // read any errors from the attempted command
    System.out.println("Here is the standard error of the command (if any):\n");
    while ((s = stdError.readLine()) != null)
    { System.out.println(s); }
    I am trying to run a command to add a group name. It is executed in command prompt of Windows 2003/2000
    Say this is the command I want to execute:
    net localgroup LordSM /add
    Here LordSM is the group name.
    I wrote the following code but it does not seem to work. Please suggest.
    String ABC=Value1TextField.getText();
    Value2Label.setText("Value is now " + ABC);
    // Above is to get value from a JText Field
    // Below is the code to run command for adding a group name to a System.
    String ExecutedCmd = "net localgroup " + ABC + "/add";
    Process p = Runtime.getRuntime().exec(ExecutedCmd);
    BufferedReader stdInput = new BufferedReader(new InputStreamReader(p.getInputStream()));
    BufferedReader stdError = new BufferedReader(new InputStreamReader(p.getErrorStream()));
    // read the output from the command
    System.out.println("Here is the standard output of the command:\n");
    while ((s = stdInput.readLine()) != null)
    { System.out.println(s); }
    // read any errors from the attempted command
    System.out.println("Here is the standard error of the command (if any):\n");
    while ((s = stdError.readLine()) != null)
    { System.out.println(s); }
    It does not seem to work means, that no Standard Error is defined, when it executes and group name is not added as well. The following is JUnit Test Result: Hope it gives a better idea of the problem I am facing:
    compile:
    run:
    Here is the standard output of the command:
    Here is the standard error of the command (if any):
    The syntax of this command is:
    NET LOCALGROUP [groupname [/COMMENT:"text"]] [DOMAIN]
    groupname {ADD [/COMMENT:"text"] | /DELETE} [DOMAIN]
    groupname name [...] {ADD | /DELETE} [DOMAIN]
    Got it
    BUILD SUCCESSFUL (total time: 10 minutes 49 seconds)
    I had even tried this:
    Runtime rt =Runtime.getRuntime();
    String[] cmd = new String[3];
    cmd[0] = "cmd.exe";
    cmd[1]="net localgroup";
    cmd[2] =ABC + "/add";
    rt.exec(cmd);
    but again, it does not give any error as such, but it does not create the group name either. Please suggest. We can see the group names that are added on right clicking My Computer Icon and click Manage and then go to User & Group section. On executing either of the code nothing happens.
    Thanks

    Duplicate post:
    http://forum.java.sun.com/thread.jspa?threadID=5203526&messageID=9812067#9812067

  • How to include a parameter executing a command line from java??

    Hey
    I've a problem It's very single for you: this consists in execute a command from java
    in this case the command is : runas but I've tried nd is good but I can´t include the password.
    This is due to the sintaxis is :
    runas /user:127.0.0.1\Administrator cmd
    The first command is execute but.. the problem is it show the input for the password.
    And the password is not let including in the command line
    How can I do that? Please help me is very urgent.
    Any help will be very appreciated.
    Thanks in advance.
    Best Regards.

    DAnt. wrote:
    what is the name of the correct forum which I must visite? this is because I couln't found the correct forum.You will not find it on the Oracle website
    I expect your prompt reply,help me!http://tinyurl.com/yak89nc

  • Executing multiple command lines in command prompt (windows)

    Hi,
    I am currrently using the command prompt in the windows to try to send a command to the microcontroller that is connected through TCP connection.
    I am able to use the normal cmd.exe to send the command but am unable to send all the command successfully using labview. 
    The Vi. that I am using the the system exec.vi found in labview connectivity section. 
    Basically what I want to send is "telnet A1" in the cmd.exe to establish connection to the microcontroller, followed by "FOR A1 100 GO" which will be intepreted by the microcontroller to make the necessary motion. But currently, the problem is that I can only establish connection using the system exec.vi but am unable to send the second part of the message "FOR A1 100 GO". 
    My command line i tried typing is cme.exe /K telnet A1 & FOR A1 100 GO. it seems that labview is only able to execute the first command part. Is there any other alternatives? 
    Thanks everyone for your help. 
    Solved!
    Go to Solution.

    Hi,
    Thanks for the help, the picture shows 1 of the error which state Error 56, the error occurs occasionally whenever I have used the command prompt to send a message to the microcontroller.
    Alternatively, there are times when no errors occur but my microcontroller does not move as well. It does move if I were to send the command through the cmd prompt.
    And I have attached a picture of my program as well. I am currently using Labview 2010 32bit. Thanks.
    Jh
    Attachments:
    TCP Connection.jpg ‏170 KB
    Error56.png ‏222 KB
    Picomotor_App New v3.0.vi ‏38 KB

  • Unable to execute HFMAudit Command line utility

    Hi All,
    We are going to use HEMAudit extract utility for extracting data &task audit tables.Hope All of you aware of that we can use this utility in two ways.One is through Wizard another one is thorugh commandline...We tried to execute the utility through Wizard,it was executing successfully and extract the both data&task audit tables.But when We tried to execute thro commandline got the following error..
    C:\Hyperion\products\FinancialManagement\Consultant Utilities>HFMAuditExtractCmdLine.exe  -d C:\Test
    -u C:\Hyperion\products\FinancialManagement\hfm.udl -a TEST -l ; -s 2011/07/15 -e 2011/07/22 -t Enabled
    -D Enabled -k Disabled -r Disabled
    Processing objects initialized.
    Completed parsing command line parameters.
    Extract starting using these parameters:
    UDL:  C:\Hyperion\products\FinancialManagement\hfm.udl
    Application:      TEST
    Destination folder:  Enabled
    Log File Name:
    Field Delimiter:     (;)
    Start Datetime:      07/15/11 00:00:00
    End Datetime:        07/22/11 00:00:00
    Extract Task Audit:  True
    Truncate Task Audit: True
    Extract Data Audit:  True
    Truncate Data Audit: True
    T E S T Connecting to data source...
    Getting schema version...
    Starting processing...
    Caching Metadata...
    Processing extracts...
    Extracting Task Audit...
    Determining number of records...
    Selecting records for extract...
    Processing results...
    Export failed. (-2147467259)
    Processing failed.
    It shows " Export Failed" .Anyone could you help me for this
    Thanks in Advance

    Duplicate post:
    http://forum.java.sun.com/thread.jspa?threadID=5203526&messageID=9812067#9812067

  • PJC executed in command line

    Hi,
    I've built a PJC wich dearchives jar files and writes the contents to local harddrive...
    I've even created a main function ,to test the utility from JDeveloper,before deploy to a signed jar in forms server...
    The utility works ok,on web environment with JINitiator 1.3.1.9,and the same when executed in JDeveloper...
    The total surprise raised when I copied the command line generated by JDeveloper for execution,and running it in a command prompt...
    C:\>D:\jdeveloper\jdk\bin\java -jar -classpath D:\jdevtests\Workspace3\F_dwld\f
    dwld.jar;D:\jdeveloper\jdev\lib\jdev-rt.jar;D:\jdeveloper\forms90\java\f90all.ja
    r fdwld.jar C:\temp\jar\fdwld.jar
    Exception in thread main
    java.lang.IllegalStateException: zip file closed
    java.util.zip.ZipEntry java.util.zip.ZipFile.getEntry(java.lang.String)
    java.util.zip.ZipEntry java.util.jar.JarFile.getEntry(java.lang.String)
    java.util.jar.JarEntry java.util.jar.JarFile.getJarEntry(java.lang.Strin
    g)
    java.util.jar.Manifest java.util.jar.JarFile.getManifest()
    or when trying to execute the class from the same command prompt...
    C:\>D:\jdeveloper\jdk\bin\java.exe -hotspot -classpath D:\jdevtests\Workspace3\F
    _dwld\classes;D:\jdeveloper\jdev\lib\jdev-rt.jar;D:\jdeveloper\forms90\java\f90a
    ll.jar oracle.forms.demos.un_jar C:\temp\jar\fdwld.jar
    Exception in thread "main" java.lang.NoClassDefFoundError: oracle/forms/demos/un
    _jar
    Note that the classes folder contains a oracle.forms.demos subfolder
    I've even tried the command line with another local JDK 1.3.1 and it is the same exception
    I'm totaly confused...what am I missing,that JDeveloper does with the PJCs and the command line isn't??

    I've investigated further the problem,and , look what i've found: when trying to execute a jar file deployed by JDeveloper from the class file,a exception occured...I've altered the manifest.mf file,and something else happens now: JDK13,or jdk14 can't see the oracle.forms.demos.VBean class located in f60all.jar file
    I have a forms6i release 2 installed,and the command line points to the f60all.jar in the forms60\java folder...
    Here is the command line,and, the output:
    C:\temp>d:\jdk14\bin\java -jar -classpath d:\jdk14\jre\lib\rt.jar;D:\forms6i\FORMS60\java\f60all.jar fdwld.jar fdwld.jar
    the class takes a filename as arg
    the output is
    Exception in thread "main" java.lang.NoClassDefFoundError: oracle/forms/ui/VBean
    at java.lang.ClassLoader.defineClass0(Native Method)
    at java.lang.ClassLoader.defineClass(ClassLoader.java:509)
    at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:12
    3)
    at java.net.URLClassLoader.defineClass(URLClassLoader.java:246)
    at java.net.URLClassLoader.access$100(URLClassLoader.java:54)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:193)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:186)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:265)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:262)
    at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:322)
    Any ideas why the VBean class isn't found by the JVM ??
    The file is there in the F60all.jar

  • Execute system command line instructions

    Hi,
    suppose that my java program has to execute a system command line instrction(let's say dir/p for dos or ls * f or linux)
    how can we execute these system command line instructions programmatically from within a java program?
    thanks indeed for helping...

    i want to thank jfbriere for the usefull link he/she provides me with. 1- He
    2- You're welcome :-)

  • Need help to convert GUI to command line

    Hi Guys ,
    Need some help with respect to scripting
    I am working on a Unix platform(sun), where in I am asked to invoke table menu via command line which has lots of option like STATUS, REPORT ….
    It goes like this
    After login in to unix box , I am entering “yct”
    It brings me a table with lot of option , I need to scroll down and then select “Report “ which display the report
    Is it possible to for me to convert this entire action in to a single unix commad or can i call it via script. 

    Actually WIndows NT has always run Unix (Posix) which was the original Linux before Linux.  Posix used to come on the CD/Disk set.  MS eventually dropped Posix from the box.  Now we just load almost any version Linux into a VM.
    I am surprised at how many new young users think that Unix is a Microsoft product. THey think theonly competitor is Apple so Unix must be Microsoft. Funny thing that Mac is Unix. OS/X was named for Jobs advanced version of Unix called "neXt" or "X".
    The board bought it but wouldn't allow the name.
    The problem that jobs solved with Unix was getting rid of X-Windows in favor of the Mac Windows API on Unix.   Mac API is very close to the WIndows API.  They share the same philosophy.   X-Windows is completely backwards and very
    difficult to design with.
    It is interesting that in Unix the users question has an answer evry much like a PowerShell solution.  We would pipe the data to a formatter which would generate a table (Format-Table) or a list (Format-List).
    I no longer remember the commands to convert a data stream or data file into a report. 
    cat?  grep? list? mtable?
    ¯\_(ツ)_/¯

  • Execute windows command line to a file

    Hi,
    I would like to run a windows command line from Java and output the result to a file.
    eg.
    cmd> mycommand hello > output.txt
    in windows ">" is to output the result to a file.
    I've tried
    String command  = "mycommand hello > output.txt";
    Process process = Runtime.getRuntime().exec(command);But that exec() didn't output to a file.
    Can someone give me an example on how to do this?
    Thanks

    You are falling for one of the traps described here. The redirection operator '>' has to be interpreted by a shell or command processor. On windows this would be
    String command  = "cmd.exe /C mycommand hello > output.txt";and on Linux this would beString command  = "sh -c mycommand hello > output.txt";You should read all 4 sections of the traps article and implement ALL the recommendations or you will be back here again.

  • Execute Process Task :Executing DOS Command lines in Execute Process Task

    Hi All,
    I am trying to sftp files using Tectia Client from my local system. For that I have used the Execute Process Task in SSIS. First I open DOS command and try to instantiate the sftp3.exe.
    Then I write down the below command
    binary
    open username@hostname
    lcd C:\Test
    cd <Destination Path name>
    put test.txt
    How to execute the command in execute process task ?
    help is appreciated
    Thanks

    Hi ConnectDebz,
    According to your description and script example, do you use WinSCP.exe to perform the SFTP files transfer? If so, you should set the Executable of the Execute Process Task to the path of the WinSCP.exe, save the script in a .txt file and set the Argument
    of the Execute Process Task like “/script=C:\Temp\sftploader.txt” (without quotes).
    References:
    http://www.sqlservergeeks.com/blogs/raunak.jhawar/sql-server-bi/395/sql-server-sftp-with-ssis-execute-process-task 
    http://gregcaporale.wordpress.com/2012/02/23/using-sftp-in-sql-server-ssis/ 
    Regards,
    Mike Yin
    If you have any feedback on our support, please click
    here
    Mike Yin
    TechNet Community Support

  • EDI Inbound ( need code sample )

    Hi Guus,
          I have an object to develop , its and EDI inbound interface . Can some one send me sample code or atleast guide me from where I can start.
    Regards
    Avi.......

    Hi ,
    plz go through the below code..
    FUNCTION zsd_idoc_input_order_change.
    ""Local Interface:
    *"  IMPORTING
    *"     VALUE(INPUT_METHOD) LIKE  BDWFAP_PAR-INPUTMETHD
    *"     VALUE(MASS_PROCESSING) LIKE  BDWFAP_PAR-MASS_PROC
    *"  EXPORTING
    *"     REFERENCE(WORKFLOW_RESULT) LIKE  BDWFAP_PAR-RESULT
    *"     REFERENCE(APPLICATION_VARIABLE) LIKE  BDWFAP_PAR-APPL_VAR
    *"     REFERENCE(IN_UPDATE_TASK) LIKE  BDWFAP_PAR-UPDATETASK
    *"     REFERENCE(CALL_TRANSACTION_DONE) LIKE  BDWFAP_PAR-CALLTRANS
    *"  TABLES
    *"      IDOC_CONTRL STRUCTURE  EDIDC
    *"      IDOC_DATA STRUCTURE  EDIDD
    *"      IDOC_STATUS STRUCTURE  BDIDOCSTAT
    *"      RETURN_VARIABLES STRUCTURE  BDWFRETVAR
    *"      SERIALIZATION_INFO STRUCTURE  BDI_SER
    *"  EXCEPTIONS
    *"      WRONG_FUNCTION_CALLED
    Work areas for the idoc tables.
      DATA: wa_data    TYPE edidd.
      status = '53'. "initial
    Read the control data information of idoc.
      READ TABLE idoc_contrl INTO gwa_control WITH KEY mestyp = 'ZORDRPLY'.
      IF sy-subrc EQ 0.
    Extract the data from the segments.
        LOOP AT idoc_data INTO wa_data             "LOOP AT idoc_data
        WHERE docnum = idoc_contrl-docnum.
          CASE wa_data-segnam.                     " CASE gwa_data-segnam
            WHEN 'Z1SCSK'.                          "Header data
              MOVE wa_data-sdata TO gwa_z1scsk.
              CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
                EXPORTING
                  input  = gwa_z1scsk
                IMPORTING
                  output = gv_vbeln.
            WHEN 'Z1SCSP'.                          "Item data
              MOVE wa_data-sdata TO gwa_z1scsp.
              CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
                EXPORTING
                  input  = gwa_z1scsp-posnr
                IMPORTING
                  output = gv_posnr.
              gwa_z1scsp-posnr = gv_posnr.
              APPEND gwa_z1scsp TO i_z1scsp.
          ENDCASE.                                 " CASE gwa_data-segnam
        ENDLOOP.                                     "LOOP AT idoc_data
    Update the sales order
        PERFORM order_change.
      ELSE.
    Begin of Mod-001
        status = '51'.
        bapi_retn_info-type       = 'E'.
        bapi_retn_info-id         = 'ZSDM'.
        bapi_retn_info-number     = '028'.
        bapi_retn_info-message_v1 =  'Wrong'.
        bapi_retn_info-message_v2 =  'Message'.
        bapi_retn_info-message_v3 =  'Type'.
       RAISE wrong_function_called.
      ENDIF.                                            " IF sy-subrc EQ 0
    *Start wf
      PERFORM wf_start
                 USING
                        idoc_contrl-docnum
                        gv_vbeln
                       CHANGING
                         bapi_retn_info.
    *end of starting of wf
    *set status
      IF status = '53'.
        bapi_retn_info-type       = 'S'.
        bapi_retn_info-id         = 'ZSDM'.
        bapi_retn_info-number     = '028'.
        bapi_retn_info-message_v1 =  gv_vbeln.
        bapi_retn_info-message_v2 =  'Changed.'.
        bapi_retn_info-message_v3 = 'Succcessfully'.
      ENDIF.
      PERFORM idoc_status_ord_change
              TABLES idoc_data
                     idoc_status
                     return_variables
               USING idoc_contrl
                     bapi_retn_info
                     status
                     workflow_result.
    End of Mod-001
    ENDFUNCTION.
    FORM idoc_status_ord_change
         TABLES idoc_data    STRUCTURE  edidd
                idoc_status  STRUCTURE  bdidocstat
                r_variables  STRUCTURE  bdwfretvar
          USING idoc_contrl  LIKE  edidc
                value(retn_info) LIKE   bapiret2
                status       LIKE  bdidocstat-status
                wf_result    LIKE  bdwf_param-result.
      CLEAR idoc_status.
      idoc_status-docnum   = idoc_contrl-docnum.
      idoc_status-msgty    = retn_info-type.
      idoc_status-msgid    = retn_info-id.
      idoc_status-msgno    = retn_info-number.
      idoc_status-appl_log = retn_info-log_no.
      idoc_status-msgv1    = retn_info-message_v1.
      idoc_status-msgv2    = retn_info-message_v2.
      idoc_status-msgv3    = retn_info-message_v3.
      idoc_status-msgv4    = retn_info-message_v4.
      idoc_status-repid    = sy-repid.
      idoc_status-status   = status.
      APPEND idoc_status.
      IF idoc_status-status = '51'.
        wf_result = '99999'.
        r_variables-wf_param   = 'Error_IDOCs'.
        r_variables-doc_number = idoc_contrl-docnum.
        READ TABLE r_variables FROM r_variables.
        IF sy-subrc <> 0.
          APPEND r_variables.
        ENDIF.
      ELSEIF idoc_status-status = '53'.
        CLEAR wf_result.
        r_variables-wf_param = 'Processed_IDOCs'.
        r_variables-doc_number = idoc_contrl-docnum.
        READ TABLE r_variables FROM r_variables.
        IF sy-subrc <> 0.
          APPEND r_variables.
        ENDIF.
      ENDIF.
    ENDFORM.                    "idoc_status_ord_change
    ***INCLUDE LZSD_FS007_ORDERCHANGEF01 .
    *&      Form  order_change
          This Form is used for updating the DB tables(vbap,vbep)        *
    FORM order_change .
    Declaration of internal tables.
      DATA : i_vbap TYPE STANDARD TABLE OF vbap,
             i_vbep TYPE STANDARD TABLE OF vbep.
    Declaration of workareas.
      DATA : wa_vbap TYPE vbap,
             wa_vbep TYPE vbep.
    Declaration of constants.
      CONSTANTS : lc_sno(3)     TYPE c VALUE '039',
                  lc_ino(3)     TYPE c VALUE '040',
                  lc_msg(4)     TYPE c VALUE 'ZSD',
                  lc_emsgty(1)  TYPE c VALUE  'E',
                  lc_smsgty(1)  TYPE c VALUE  'S',
                  lc_estatus(2) TYPE c VALUE  '51',
                  lc_sstatus(2) TYPE c VALUE  '53'.
    Declaration of variable.
      DATA : lv_index TYPE syindex,
             lv_zzproddt TYPE sydatum.
    Fetch the data from vbap
      SELECT * FROM vbap INTO TABLE i_vbap
      WHERE vbeln EQ gv_vbeln.
      IF NOT i_vbap IS INITIAL.
    Fetch the data from vbep
        SELECT * FROM vbep INTO TABLE i_vbep
          FOR ALL ENTRIES IN i_vbap
          WHERE vbeln EQ i_vbap-vbeln
          AND posnr EQ i_vbap-posnr.
    Modify production option date (zzproopdt) of i_vbap
    and production date(zzproddt) & original production date(zzoprodt)
    of i_vbep with the data sent by SCS.
        lv_index = 1.
        LOOP AT i_z1scsp INTO gwa_z1scsp.
          LOOP AT i_vbap INTO wa_vbap WHERE posnr = gwa_z1scsp-posnr.
            IF sy-subrc EQ 0 .
      Copies the date value in gwa_z1scsp-zzproopdt to wa_vbap-zzproopdt,
      if valid date is there in gwa_z1scsp-zzproopdt
              PERFORM validate_date USING gwa_z1scsp-zzproopdt
                                          wa_vbap-zzproopdt.
              IF NOT wa_vbap-zzproopdt IS INITIAL.
                MODIFY i_vbap FROM wa_vbap TRANSPORTING zzproopdt.
              ENDIF.
      Copies the date value in gwa_z1scsp-zzproddt to lv_zzproddt,
      if valid date is there in gwa_z1scsp-zzproddt
              PERFORM validate_date USING gwa_z1scsp-zzproddt
                                          lv_zzproddt.
      If gwa_z1scsp-zzproddt is not initial then only update in VBEP.
              IF NOT lv_zzproddt IS INITIAL.
                LOOP AT i_vbep INTO wa_vbep FROM lv_index.
                  IF wa_vbep-posnr GT wa_vbap-posnr.
                    lv_index = sy-tabix.
                    EXIT.
                  ELSEIF wa_vbep-posnr EQ wa_vbap-posnr.
                    wa_vbep-zzproddt = lv_zzproddt.
             Update Original Production date only when its initial.
                    IF wa_vbep-zzoprodt IS INITIAL.
                      wa_vbep-zzoprodt = wa_vbep-zzproddt.
                    ENDIF.
                    MODIFY i_vbep FROM wa_vbep TRANSPORTING zzproddt zzoprodt.
                  ENDIF.
                  CLEAR wa_vbep.
                ENDLOOP.
              ENDIF.
            ELSE.
    Begin of Mod-001
              status =  lc_estatus.
              bapi_retn_info-type       = lc_emsgty.
              bapi_retn_info-id         = lc_msg.
              bapi_retn_info-number     = lc_ino.
              bapi_retn_info-message_v1 =  gwa_z1scsp-posnr.
            ENDIF.
          ENDLOOP.
           IF sy-subrc EQ 4.
            status =  lc_estatus.
            bapi_retn_info-type       = lc_emsgty.
            bapi_retn_info-id         = lc_msg.
            bapi_retn_info-number     = lc_ino.
            bapi_retn_info-message_v1 =  gwa_z1scsp-posnr.
          ENDIF.
          CLEAR: wa_vbap, gwa_z1scsp.
        ENDLOOP.
      ELSE.
        status =  lc_estatus.
        bapi_retn_info-type       = lc_emsgty.
        bapi_retn_info-id         = lc_msg.
        bapi_retn_info-number     = lc_sno.
        bapi_retn_info-message_v1 =  gv_vbeln.
        EXIT.
    End of Mod-001
      ENDIF.
    Update the DB tables
        UPDATE vbap FROM TABLE i_vbap.
        UPDATE vbep FROM TABLE i_vbep.
    ENDFORM.                    " order_change
    *&      Form  VALIDATE_DATE
    Converts the date into DATS format and check if it is valid,
    if valid returns date in p_date_dats else clear it.
         -->p_date_c8    Date in Char format send by SCS
         -->p_date_dats  Date in DATS format.
    FORM validate_date  USING    p_date_c8 TYPE char8
                                 p_date_dats TYPE dats.
      CLEAR p_date_dats.
      p_date_dats = p_date_c8.
      CALL FUNCTION 'DATE_CHECK_PLAUSIBILITY'
        EXPORTING
          date                      = p_date_dats
        EXCEPTIONS
          plausibility_check_failed = 1
          OTHERS                    = 2.
      check sy-subrc NE 0.
        CLEAR p_date_dats.
    ENDFORM.                    " VALIDATE_DATE
    *&      Form  wf_start
          text
         -->P_IDOC_CONTROL_DOCNUM  text
         -->P_GV_VBELN  text
         <--P_BAPI_RETN_INFO  text
    FORM wf_start  USING    p_idoc_control_docnum
                            p_gv_vbeln
                   CHANGING p_bapi_retn_info TYPE bapiret2.
      INCLUDE <cntn01>.
      DATA: agents  LIKE swhactor OCCURS 1 WITH HEADER LINE,
            process_type TYPE char1,
            idoc_no TYPE edidc-docnum,
            creator LIKE swwwihead-wi_creator.
      swc_container wi_container.
      swc_create_container wi_container.
      swc_set_element wi_container 'Document_no' p_gv_vbeln.
      swc_set_element wi_container 'Process_type' '1'.
      swc_set_element wi_container 'Idoc_no' p_idoc_control_docnum.
      CALL FUNCTION 'SWW_WI_START_SIMPLE'
        EXPORTING
          creator                      = creator
          task                         = 'WS90200019'
        TABLES
          agents                       = agents
          wi_container                 = wi_container
        EXCEPTIONS
          id_not_created               = 1
          read_failed                  = 2
          immediate_start_not_possible = 3
          execution_failed             = 4
          invalid_status               = 5
          OTHERS                       = 6.
      IF sy-subrc <> 0.
        p_bapi_retn_info-type   = 'E'.
        p_bapi_retn_info-id = sy-msgid.
        p_bapi_retn_info-number = sy-msgno.
        p_bapi_retn_info-message_v1 = sy-msgv1.
        p_bapi_retn_info-message_v2 = sy-msgv2.
        p_bapi_retn_info-message_v3 = sy-msgv3.
        p_bapi_retn_info-message_v4 = sy-msgv4.
      ENDIF.
    ENDFORM.                    " wf_start..
    The idoc configurations for customized idoc (inbound) are..
    1>WE81
    2>WE31
    3>WE30
    4>BD51(Attach ur zfunction mdoule)
    5>WE57(Attach ur zfunction mdoule to message type and basic type)
    6>we42
    7>WE20...
    Regards,
    nagaraj

Maybe you are looking for

  • SAP GUI Logon Control wdtlog.ocx

    Hi, I'm trying to use the SAP Logon Control to use SNC / Single Sign-on (SSO Works with SAPGUI and SAP Logon), I created a VB Script and it works if Silent = False "v_connection.Logon(0, False )" but if Silent = True the logon fails. Is there another

  • I have a 3G Iphone and can't get it to pair with the Uconnect phone in my car. Help?

    I have a 3G iphone with bluetooth.  I have been unable to get the iphone to pair with the Uconnect Phone in my car.  Any suggestions?

  • Problem opening a certain site properly

    Hello, I have problem opening a certain site properly. I use firefox 4.0.1 and have tried pretty much everything that has already been suggested in other similar problems I found posted here but the site continues to look wrong. No images, blue lette

  • "emergency calls only" - but only sometimes!

    Hi everyone, I bought the new iphone 4, and it worked just fine. The guy at the store (mobile phones store) inserted microsim, activated the device and everything was fine untill it was turned off by me. Then, when i would power it on, it would prese

  • CS5 illustrator 'shift arrow'/cmd shift arrow' keys wont work! (Help!)

    Hi, I have just installed the CS5 web suite and are loving it so far, however for some strange reason when I try to move an object or point by holding down the shift - arrrow or cmd shift arrow key, (as you do) nothing happens! Have tried restarting