Issue regarding creating a process using Runtime in Windows 2003.

Hi all..
I need to resolve a small issue related to execute an external program using runtime execution method. But when i deploy the code in websphere application server 6.1V in windows 2003 server operating system, it is starting a process with min priority and not executing even i specified waitfor method.
The code is like below.
try{
Process p = Runtime.getRuntime().exec("C:\\CopyImages.exe "+toWrite);
int ep = p.waitFor();
System.out.println("process "+ep);
catch(Exception e)
e.printStackTrace();
Please help me in resolving this issue. The above code is working in my IDE which is in Window XP but when i port it in application server in windows2003 i'm getting this issue.

hi..
it is a typo error. i've given the slashes with that.
but still getting the problem.

Similar Messages

  • Error in creating a process using runtime class - please help

    Hi,
    I am experimenting with the following piece of code. I tried to run it in one windows machine and it works fine. But i tried to run it in a different windows machine i get error in creating a process. The error is attached below the code. I don't understand why i couldn't create a process with the 'exec' command in the second machine. Can anyone please help?
    CODE:
    import java.io.*;
    class test{
    public static void main(String[] args){
    try{
    Runtime r = Runtime.getRuntime();
         Process p = null;
         p= r.exec("dir");
         BufferedReader br = new BufferedReader(new InputStreamReader(p.getInputStream()));
         System.out.println(br.readLine());
    catch(Exception e){e.printStackTrace();}
    ERROR (when run in the dos prompt):
    java.io.IOException: CreateProcess: dir error=2
    at java.lang.Win32Process.create(Native Method)
    at java.lang.Win32Process.<init>(Win32Process.java:63)
    at java.lang.Runtime.execInternal(Native Method)
    at java.lang.Runtime.exec(Runtime.java:550)
    at java.lang.Runtime.exec(Runtime.java:416)
    at java.lang.Runtime.exec(Runtime.java:358)
    at java.lang.Runtime.exec(Runtime.java:322)
    at test.main(test.java:16)
    thanks,
    Divya

    As much as I understand from the readings in the forums, Runtime.exec can only run commands that are in files, not native commands.
    Hmm how do I explain that again?
    Here:
    Assuming a command is an executable program
    Under the Windows operating system, many new programmers stumble upon Runtime.exec() when trying to use it for nonexecutable commands like dir and copy. Subsequently, they run into Runtime.exec()'s third pitfall. Listing 4.4 demonstrates exactly that:
    Listing 4.4 BadExecWinDir.java
    import java.util.*;
    import java.io.*;
    public class BadExecWinDir
    public static void main(String args[])
    try
    Runtime rt = Runtime.getRuntime();
    Process proc = rt.exec("dir");
    InputStream stdin = proc.getInputStream();
    InputStreamReader isr = new InputStreamReader(stdin);
    BufferedReader br = new BufferedReader(isr);
    String line = null;
    System.out.println("<OUTPUT>");
    while ( (line = br.readLine()) != null)
    System.out.println(line);
    System.out.println("</OUTPUT>");
    int exitVal = proc.waitFor();
    System.out.println("Process exitValue: " + exitVal);
    } catch (Throwable t)
    t.printStackTrace();
    A run of BadExecWinDir produces:
    E:\classes\com\javaworld\jpitfalls\article2>java BadExecWinDir
    java.io.IOException: CreateProcess: dir error=2
    at java.lang.Win32Process.create(Native Method)
    at java.lang.Win32Process.<init>(Unknown Source)
    at java.lang.Runtime.execInternal(Native Method)
    at java.lang.Runtime.exec(Unknown Source)
    at java.lang.Runtime.exec(Unknown Source)
    at java.lang.Runtime.exec(Unknown Source)
    at java.lang.Runtime.exec(Unknown Source)
    at BadExecWinDir.main(BadExecWinDir.java:12)
    As stated earlier, the error value of 2 means "file not found," which, in this case, means that the executable named dir.exe could not be found. That's because the directory command is part of the Windows command interpreter and not a separate executable. To run the Windows command interpreter, execute either command.com or cmd.exe, depending on the Windows operating system you use. Listing 4.5 runs a copy of the Windows command interpreter and then executes the user-supplied command (e.g., dir).
    Taken from:
    http://www.javaworld.com/javaworld/jw-12-2000/jw-1229-traps.html

  • Spawn a java process using runtime.exec() method

    Hi,
    This is my first post in this forum. I have a small problem. I am trying to spawn a java process using Runtime.getRuntime().exec() method in Solaris. However, there is no result in this check the follwoing program.
    /* Program Starts here */
    import java.io.*;
    public class Test {
    public static void main(String args[]) {
    String cmd[] = {"java", "-version"};
    Runtime runtime = Runtime.getRuntime();
    try{
    Process proc = runtime.exec(cmd);
    }catch(Exception ioException){
    ioException.printStackTrace();
    /* Program ends here */
    There is neither any exception nor any result.
    The result I am expecting is it should print the following:
    java version "1.4.0"
    Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.0-b92)
    Java HotSpot(TM) Client VM (build 1.4.0-b92, mixed mode)
    Please help me out in this regard
    Thanks in advance
    Chotu.

    Yes your right. It is proc.getInputStream() or proc.getErrorStream(). That is what I get for trying to use my memory instead of looking it up. Though hopefully the OP would have seen the return type of the other methods and figured it out.

  • Monitoring a Process using Runtime.exce()

    Hi,
    In my Program, I'm using the
    new BufferedReader(new InputStreamReader(Runtime.getRuntime()                         .exec("ps -ef | grep xmlfeed").getInputStream()));
    The above statement is not returning any inputstream to the BuffredReader.
    When I gave the command as "PWD", it's returning the lines as expected.
    But it's not working even for "PS" command also.I'm running this in AIX machine.
    Any Ideas,Please help....
    Edited by: haijdp on Dec 21, 2007 1:11 AM

    Hello! And sorry I didn't reply earlier. I hope the Original Poster will find revisit this thread and it helps him.
    From your post I assumed that you were not a student trying to create some homework. That's why I felt free to simply code a solution and submit the code here. But first some remarks:
    I don't think that your code can work. Runtime.exec expects an array of type String, where the first element is the command and subsequent elements are a command line option each. I don't think you can use the pipe and call several commands using Runtime.exec, but that's just a kind of guess. YMMV.
    Running external Processes in Java is a bit complicated. Basically,
    * It's good to run the process in it's own thread. That way the main program can continue without getting stuck.
    * To extract stdout and stderr of your target process you must run two threads, one for stderr and one for stdout. Both threads extract the characters of their respective streams in a loop that runs inside the thread. Again, that way we avoid deadlocks, program getting stuck etc.
    This explanation is terrible, I know - I think a slice of source code speaks louder than words. I have attached five java files which together make a little process runner which extracts stdout and stderr in a safe manner. To run:
    * Cut'n paste them into five text files, one per class.
    * Save the each text file as {contained-class-name}.java
    * Compile the stuff
    * Run RunnerDemo (When I ran it, I got a directory listing printed on the console)
    Explanation sounds a bit sloppy, but I did it under the assumption that you are a seasoned java pro, so it should not pose any problems. Since you seem to be a different OS than I (AIX, I run Linux), the command may or may not work. Try other commands. For example, in the RunnerDemo class you could set the cmd field to this:
            String [] cmd =
                "ps",
                "-A",
                "-H"
            };This would give you a process listing (works on Linux).
    By the way, commands are passed as array. See Java documentation for java.lang.Runtime.exec (String []) for explanation of this array.
    One problem I see in your command is that the output of ps is piped to some other program. Sorry, I don't know whether my code could achieve this. All it can do is to rum one single command with command line options. But you should be able to adjust the given example, so it supports piping to another program.
    If you have any further questions, please don't hesitate to ask!
    Class: RunnerDemo
    *                           RunnerDemo.java
    *                     Demo for the process runner
    package rtimeexec;
    public class RunnerDemo
        public static void main (String [] args)
            String [] cmd =
                "ls",
                "-a",
                "-l"
            ProcessRunner   runner;
            String          stdOutStr;
            String          stdErrStr;
            runner = new ProcessRunner (cmd);
            runner.start ();
            runner.BlockUntilFinished ();
            stdOutStr = runner.GetStdOutText ();
            stdErrStr = runner.GetStdErrText ();
            System.out.println ("Process result, ls -a -l");
            System.out.println ("-----------------------------------------------------------------------");
            System.out.println ("Stdout:");
            System.out.println ("-----------------------------------------------------------------------");
            System.out.println (stdOutStr);
            System.out.println ();
            System.out.println ("-----------------------------------------------------------------------");
            System.out.println ("Stderr:");
            System.out.println ("-----------------------------------------------------------------------");
            System.out.println (stdErrStr);
    Class: ProcessRunner
    package rtimeexec;
    import java.io.IOException;
    import java.io.InputStream;
    import java.io.OutputStream;
    * Runs a system process and extracts stdout and stderr of that process.
    * Process will run in its own thread, so that the caller can simply continue
    * with less of a chance to get locked down. Caller can invoke the {@link BlockUntilFinished}
    * method after starting this thread. This method blocks until the thread is finished,
    * i.e. the process has finished.
    * Unfortunately, we haven't implemented any facility to stream characters to
    * stdin of the process called. If that facility would exist we could refactor
    * the classes and realize some sort of piping facility, as it's possible in
    * Linux, for example.
    * Example on how to run a process:
    * <pre>
    * String []         cmd  = {"ps", "-AH"};
    * String            sOut;
    * String            sErr;
    * ProcessRunner     runner;
    * runner = new ProcessRunner (cmd);
    * runner.start ();
    * runner.BlockUntilFinished ();
    * sOut = runner.GetStdOutText ();
    * sErr = runner.GetStdErrText ();
    * System.out.println ("Stdout:");
    * System.out.println (sOut);
    * System.out.println ("------------------------------------------------------");
    * System.out.println ("Stderr:");
    * System.out.println (sErr);
    * </pre>
    public class ProcessRunner extends Thread
        private String []                   command;
        private int                         execResult;
        private String                      stdOutText;
        private String                      stdErrText;
        private boolean                     isFinished;
        public ProcessRunner (String [] cmd)
            command     = cmd;
            execResult  = 0;
            stdOutText  = null;
            stdErrText  = null;
            isFinished  = false;
        public int GetResult ()
            return execResult;
        public String GetStdOutText ()
            return stdOutText;
        public String GetStdErrText ()
            return stdErrText;
        public boolean IsFinished ()
            return isFinished;
        public void BlockUntilFinished ()
            while (! isFinished)
                try {Thread.sleep (250);} catch (InterruptedException e) {}
        public void run ()
            Process         proc;
            Runtime         rt;
            InputStream     stdOut;
            InputStream     stdErr;
            CharStream      stdOutEx;
            CharStream      stdErrEx;
            int             res;
            isFinished = false;
            try
                res         = 0;
                rt          = Runtime.getRuntime ;       ();
                proc        = rt.exec ;                  (command);
                stdOut      = proc.getInputStream ;      ();
                stdErr      = proc.getErrorStream ;      ();
                stdOutEx    = new CharStream            (stdOut);
                stdErrEx    = new CharStream            (stdErr);
                stdOutEx.start ();
                stdErrEx.start ();
                try {res = proc.waitFor ();} catch (InterruptedException e) {}
                // Process has finished; now wait until any buffers are empty.
                stdOutEx.BlockUntilFinished ();
                stdErrEx.BlockUntilFinished ();
                stdOutText = stdOutEx.GetResult ();
                stdErrText = stdErrEx.GetResult ();
                execResult = res;
            catch (IOException e)
                isFinished = true;
                throw new ExtractionException (e.getLocalizedMessage());
            isFinished = true;
    Class: CharStream
    package rtimeexec;
    import java.io.IOException;
    import java.io.InputStream;
    * A Character extractor. Extracts characters from a stream and puts them
    * into a String. To protect from memory overflow we put a limit in place.
    * When storage demads exceed that limit, an exception is thrown.
    public class CharStream extends Thread
        private static final int    maxChunkLen         = 8192;
        private static final int    maxStorageSize      = 512 * 1024;   // 512 KBytes
        private InputStream     sourceStream;
        private StringBuffer    extracted;
        private boolean         isFinished;
        public CharStream (InputStream istream)
            sourceStream    = istream;
            extracted       = new StringBuffer ();
            isFinished      = false;
        public String GetResult ()
            String ret;
            ret = extracted.toString ();
            return ret;
        public void BlockUntilFinished ()
            while (! isFinished)
                SleepThread (250);
        public void run ()
            byte []                 buffer;
            int                     nBytesRead;
            byte                    b;
            char                    c;
            int                     iChar;
            int                     nCharsTotal;
            boolean                 isEOF;
            isEOF       = false;
            nCharsTotal = 0;
            isFinished = false;
            while (! isEOF)
                try
                    buffer      = new byte [maxChunkLen];
                    nBytesRead  = sourceStream.read (buffer);
                    if (nBytesRead >= 1)
                    {   // much faster stream extraction method than when we use
                        // BufferedReader(new InputStreamReader(sourceStream)).
                        for (iChar = 0; iChar < nBytesRead; iChar++)
                            nCharsTotal++;
                            if (nCharsTotal > maxStorageSize)
                                throw new StoreFullException
                                    "Storage limit exceeded (" + Integer.toString (maxChunkLen) + "Bytes)"
                            b = buffer [iChar];
                            c = (char) b;
                            extracted.append (c);
                    else if (nBytesRead <= -1)
                        isEOF       = true;
                catch (IOException e)
                    isFinished = true;
                    throw new ExtractionException (e.getLocalizedMessage());
                SleepThread (250);
            isFinished  = true;
        private void SleepThread (int mSec)
            try
                Thread.sleep (mSec);
            catch (InterruptedException e)
    Class: StoreFullException
    package rtimeexec;
    * Exception that gets thrown when a storage container is full.
    public class StoreFullException extends RuntimeException
        private static final long serialVersionUID = - 4996246591135389009L;
        public StoreFullException (String message)
            super (message);
    Class: ExtractionException
    package rtimeexec;
    * Thrown when there was some problem during stream extraction.
    public class ExtractionException extends RuntimeException
        private static final long serialVersionUID = - 6124525536783450209L;
        public ExtractionException (String message)
            super (message);
    }

  • Issue while creating Outbound Delivery using Standard BAPI

    Hi all,
    I am trying to create an outbound delivery for a Sales order using the Standard BAPI - BAPI_OUTB_DELIVERY_CREATE_SLS.
    After giving the valid inputs for Sales order no and doc no, am getting an error as "No instance of object type OutboundDelivery has been created. External reference:" But when trying to create manually there is no problem. Please suggest what may be the issue and how to correct it?
    Regards,
    Vimala P

    Hi Vimala,
    I am trying to create outbound delivery using BAPI_OUTB_DELIVERY_CREATE_SLS & BAPI_DELIVERYPROCESSING_EXEC. But no success. Getting "No instance of object type outbound delivery has been created" in return.
    1) Delivery Type
    2) Delivery selection date
    Needs to be passed in import parameters.
    Could you please tell me what are all the parameters to be passed under tables tab in RV_DELIVERY_CREATE?
    Thanks in Advance..
    Regards,
    Rajasekar .M

  • Issue regarding Sales Order creation using bapi BAPI_salesorder_createfromd

    Hi Experts,
    Can anyone help me what is the data I'm missing in creating sales order?
    I tried to create sales order using BAPI_salesorder_createfromdat2 and I recieve error regarding my creation.
    here's the lists of RETURN for the BAPI.
    "SALES_HEADER_IN has been processed successfully"
    "SALES_ITEM_IN has been processed successfully"
    "SALES_CONDITIONS_IN has been processed successfully"
    "The sales document is not yet complete: Edit data"
    Iam not able to get the message ""The sales document is not yet complete: Edit data"
    Please help in this regard.
    Regards,
    Sakti

    This is because you are still missing some segments or data.
    Maybe this thread will be helpful:
    BAPI_SALESORDER_CREATEFROMDAT2 to replace VA01, KBETR and NETWR
    You should also check the documentation from transaction BAPI.

  • Issue in creating sales order using process_header API

    Hi all,
    We have a requirement to create sales order using apps adapter in ebiz from SOA suite composite.I used OE_ORDER_PUB.Process_header API to create order header.
    When I pass the inputs and test the service,I get output with return_status='S'. But no record falls at the OE_ORDER_HEADER_ALL table.
    I cant identify where the problem is.Pls suggest me with the things to resolve this issue.
    Thanks,
    goutham

    Hi all,
    We have a requirement to create sales order using apps adapter in ebiz from SOA suite composite.I used OE_ORDER_PUB.Process_header API to create order header.
    When I pass the inputs and test the service,I get output with return_status='S'. But no record falls at the OE_ORDER_HEADER_ALL table.
    I cant identify where the problem is.Pls suggest me with the things to resolve this issue.
    Thanks,
    goutham

  • Outbound ORDRSP IDOC not created while processing  using ALE_PROCESSING .

    HI ALL,
    i have done all the requiured config for o/b message control for ORDRSP idoc along with config in sale for dist.. model and assigning msg type to model etc and when i save my PO i can see the o/p being proposed but when i process that with A as medium, it is incorectly processed and no ordrsp idoc is created.i am using std idoc_output_ordrsp FM,  when i debug the code the see an error in ALE_PROCESSING IN the perform new_dyn_perform
    can anyone pls tell me why the idoc is not created.
    thanks,

    Hi eswar,
    i have configured the partner profile for the LOGICAL SYSTEM that i hav created along with the message control deatils in msg ctrl tab( which i think should not really matter) as i have already created a distrib. model for my log. sys and attached my msg typ to that.
    when i debug the flow ( rsnast00-rsnasted-ale_processing-idoc_output_ordrsp) i think the error is somewhere in the call function tede1-routid( idoc_output_ordrsp) in the new_dyn_perform subroutine.
    but that FM is holding good for other ORDRSP idocs.i am really unable to understand where the error actually is.
    thanks

  • Is it possible to create Secondary Tile using Templates in Windows Store apps?

    Hi Team,
    We can update Secondary Tile with Templates using notificatations,  Is it possible to create Secondary Tile using Template in Start Menu
    Tanks,
    Siva Varri
    Thread response from msdn

    What do you mean by "in Start Menu"? Do you mean Live tile? See https://msdn.microsoft.com/en-us/library/windows/apps/hh465403.aspx
    https://msdn.microsoft.com/en-us/library/windows/apps/dn468032.aspx
    Best Regards,
    Please remember to mark the replies as answers if they help

  • VPN client using CLI on windows 2003 server

    Hello, first time poster here. Have an interesting issue I'm hoping to find help with.
    I'm using the VPN client (I have version 4.8.01.0300) in CLI mode (called from a script) to connect to a remote site. Got the connection setup and all working fine except for one small detail. Hopefully I can explain this well...
    I want this connection to run fully unattended as it will run numerous times per day, every day. The issue is the little pop-up message saying "VPN has disconnected".
    When I first setup the connection, it was on windows XP and everything was golden. I could issue the command : vpnclient connect <name> user <userid> pwd <passwd> sd, <other stuff>, vpnclient disconnect and all worked as expected.
    Then I installed same stuff on Windows 2003 server. Issuing same connect command gives error: "user authentication failed". Then I discovered that if I first launched the vpn client GUI then the CLI command, it would connect without error - but then the "disconnected" pop-up window came along.
    So - can I either:
    - Run vpn client in CLI mode without the GUI running.
    - Suppress the pop-up.
    Thanks in advance.
    Scott

    Hi,
    Thank you for the post.
    Please try register MSI installer or clean boot your system to install FEP client.
    Registered MSI Installer following the steps below:
    1.Run "cmd"--Browse to the "%systemroot%\system32" directory and execute: "msiexec /regserver" 
    2.Change directories to "%systemroot%\SysWow64" and execute: "msiexec /regserver" 
    3.Reboot the server
    http://technet.microsoft.com/en-us/library/ff823833.aspx
    If there are more inquiries on this issue, please feel free to let us know.
    Regards
    Rick Tan
    TechNet Community Support

  • Any options for using Captivate on Windows 2003?

    I am new to Captivate but I must get a demo done by Friday. I
    installed on Windows 2003 where the software I am demo-ing is
    installed. Now I find that 2003 is not supported. Can anyone
    suggest (quickly!) how I can use Captivate to do my demo?
    I am not savvy at all with demo software, so please be
    specific. Thank you!
    Janise

    Hi again Janise
    Yes, as long as you can display what you need on the XP
    desktop, you should be good to go.
    Keep in mind that your best result will likely be obtained by
    creating the voiceover as a separate process and not while you are
    recording the initial movie.
    Also, you may discover that the remote destop won't paint
    quite fast enough so Captivate will record "blank screens" here and
    there. Where you notice this happening, press the Print Screen key
    to force additional screen captures. It's always easier to delete
    unwanted slides than it is to re-create them when needed.
    Cheers... Rick

  • RAC using OCFS on windows 2003

    Hi,
    i am building a 2 node windows 2003 cluster (enterprise edition) and planning to install ORACLE RAC on it. What are the steps required to do this?. Do I need to use the Microsoft Cluster service to deploy a cluster and then install oracle rac on it. Or does oracle provide a clustring service on it own. Currently i have 2 servers each running windows 2003 connected together via a cross over cable.
    What kind of configuration is reuired with the file system, OCFS or raw partition.
    thanks

    I don't think MCS is required. Take a look at:
    http://download-west.oracle.com/docs/cd/B19306_01/install.102/b14207/prewin.htm#sthref198
    and check the certified combinations in Metalink.
    For your storage options, read:
    http://download-west.oracle.com/docs/cd/B19306_01/install.102/b14207/storage.htm#sthref252

  • ISSUE ON CREATE SALES ORDER USING BAPI

    Hi,
       I am creating a sales order using bapi BAPI_SALESORDER_CREATEFROMDAT2.But it it fails to create a sales order abd below is my code pls check and correct me to create a sales order.
    LOOP AT DATA_TAB.
    clear: l_order_header_in,
           l_salesdocument,
           l_order_partners,
           l_order_items_IN,
           l_order_schedules_IN.
    refresh: l_order_items_in,
             l_order_partners,
             l_order_schedules_IN,
             l_return.
    Order header
    l_order_header_in-DOC_TYPE    = DATA_TAB-AUART.
    l_order_header_IN-SALES_ORG   = DATA_TAB-VKORG.
    l_order_header_IN-DISTR_CHAN  = data_tab-vtweg.
    l_order_header_in-division    = DATA_TAB-SPART.
    l_order_header_in-REF_1_S     = DATA_TAB-IHREZ_E.
    l_order_header_in-PURCH_NO_S  = DATA_TAB-BSTKD_E.
    l_order_header_in-PO_DAT_S    = data_tab-bstdk_e.
    l_order_header_in-PO_METH_S   = DATA_TAB-BSARK_E.
    l_order_header_in-DOC_DATE    = DATA_TAB-AUDAT.
    l_order_header_in-REC_POINT   = DATA_TAB-EMPST.
    l_order_header_inX-DOC_TYPE    = 'X'.
    l_order_header_INX-SALES_ORG   = 'X'.
    l_order_header_INX-DISTR_CHAN  = 'X'.
    l_order_header_inX-division    = 'X'.
    l_order_header_inX-REF_1_S     = 'X'.
    l_order_header_inX-PURCH_NO_S  = 'X'.
    l_order_header_inX-PO_DAT_S    = 'X'.
    l_order_header_inX-PO_METH_S   = 'X'.
    l_order_header_inX-DOC_DATE    = 'X'.
    l_order_header_inX-REC_POINT   = 'X'.
    Partner data SOLD TO PARTY
    l_order_partners-ITM_NUMBER = DATA_TAB-POSNR.
    l_order_partners-partn_role = 'SP'.
    l_order_partners-partn_numb = DATA_TAB-kunnr1.
    append l_ordeR_partners.
    Partner data SHOP TO PARTY
    l_order_partners-ITM_NUMBER = DATA_TAB-POSNR.
    l_order_partners-partn_role = 'SH'.
    l_order_partners-partn_numb = DATA_TAB-kunnr2.
    append l_ordeR_partners.
    Order items
    l_order_items_IN-ITM_NUMBER = DATA_TAB-POSNR.
    l_order_items_IN-material   = DATA_TAB-MABNR.
    l_order_items_IN-BATCH      = DATA_TAB-CHARG.
    l_order_items_IN-REASON_REJ = DATA_TAB-ABGRU.
    append l_order_items_IN.
    l_order_items_INX-ITM_NUMBER = DATA_TAB-POSNR.
    l_order_items_INX-material   = 'X'.
    l_order_items_INX-BATCH      = 'X'.
    l_order_items_INX-REASON_REJ = 'X'.
    append l_order_items_INX.
    Schedules for quantity
    l_order_schedules_IN-itm_number = DATA_TAB-POSNR.
    l_order_schedules_IN-req_qty    = DATA_TAB-KWMENG.
    append l_order_schedules_IN.
    Schedules for quantity
    l_order_schedules_INX-itm_number = data_tab-posnr.
    l_order_schedules_INX-req_qty    =  'X'.
    append l_order_schedules_INX.
    Conditions for value
    l_order_conditions_IN-itm_number = DATA_TAB-POSNR.
    l_order_conditions_IN-cond_type  = DATA_TAB-KSCHL.
    l_order_conditions_IN-cond_value = DATA_TAB-KBETR.
    l_order_conditions_IN-currency   = DATA_TAB-KOEIN.
    append l_order_conditions_IN.
    Conditions for value
    l_order_conditions_INX-itm_number = DATA_TAB-POSNR.
    l_order_conditions_INX-cond_type  = 'X'.
    l_order_conditions_INX-cond_value = 'X'.
    l_order_conditions_INX-currency   = 'X'.
    append l_order_conditions_INX .
    endloop.
    BAPI to create sales order
    CALL FUNCTION 'BAPI_SALESORDER_CREATEFROMDAT2'
    EXPORTING
    SALESDOCUMENTIN =
      ORDER_HEADER_IN =      l_order_header_IN
      ORDER_HEADER_INX =     l_order_header_INX
    IMPORTING
      SALESDOCUMENT =        l_salesdocument
    TABLES
      RETURN =               l_return
      ORDER_ITEMS_IN =       l_order_items_IN
      ORDER_ITEMS_INX =      l_order_items_INX
      ORDER_PARTNERS =       l_order_partners
      ORDER_SCHEDULES_IN =   l_order_schedules_in
      ORDER_SCHEDULES_INX =  l_order_schedules_inX
      ORDER_CONDITIONS_IN =  l_order_conditions_in
      ORDER_CONDITIONS_INX = l_order_conditions_inX
    IF SY-SUBRC = 0.
    CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
    EXPORTING
       WAIT           = C_X
    IMPORTING
      RETURN        =
    ENDIF.
      Pls help me to solve the issue.
    Thanks,
    Rajendra.

    Hi Raj
    This is the sameple code which works fine for me,
    REPORT  zkb_sales_order.
    DATA: w_order_header_in TYPE bapisdhd1,
          i_order_partners TYPE TABLE OF bapiparnr,
          w_order_partners TYPE bapiparnr,
          i_return TYPE TABLE OF bapiret2,
          w_return TYPE bapiret2,
         i_order_items_in TYPE TABLE OF bapisditm,
         w_order_items_in TYPE  bapisditm,
         i_order_items_inx TYPE TABLE OF  bapisditmx,
         w_order_items_inx TYPE  bapisditmx,
        i_order_conditions_in TYPE TABLE OF bapicond,
        w_order_conditions_in TYPE bapicond,
        i_order_conditions_inx TYPE TABLE OF bapicondx,
        w_order_conditions_inx TYPE TABLE OF bapicondx.
    CLEAR w_order_header_in.
    w_order_header_in-doc_type  = 'ZSO'.
    w_order_header_in-sales_org =  '1000'.
    w_order_header_in-distr_chan = '01'.
    w_order_header_in-division =  '01'.
    w_order_header_in-req_date_h  = sy-datum.
    w_order_header_in-sales_dist =   '000001'.
    CLEAR: i_order_items_in,w_order_items_in.
    w_order_items_in-material = 77.
    w_order_items_in-salqtynum = 1.
    CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
      EXPORTING
        input  = w_order_items_in-material
      IMPORTING
        output = w_order_items_in-material.
    APPEND w_order_items_in TO i_order_items_in.
    * SP
    CLEAR: i_order_partners,w_order_partners.
    w_order_partners-partn_role = 'AG'.
    w_order_partners-partn_numb = '2000016'.
    CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
      EXPORTING
        input  = w_order_partners-partn_numb
      IMPORTING
        output = w_order_partners-partn_numb.
    APPEND w_order_partners TO i_order_partners.
    CLEAR: i_order_conditions_in,w_order_conditions_in.
    w_order_conditions_in-itm_number =  '000010'.
    w_order_conditions_in-cond_type  =   'PR00'.
    w_order_conditions_in-cond_value =  100.
    APPEND w_order_conditions_in TO i_order_conditions_in.
    CALL FUNCTION 'BAPI_SALESORDER_CREATEFROMDAT2'
      EXPORTING
    *   SALESDOCUMENTIN               =
        order_header_in               = w_order_header_in
    *   ORDER_HEADER_INX              =
    *   SENDER                        =
    *   BINARY_RELATIONSHIPTYPE       =
    *   INT_NUMBER_ASSIGNMENT         =
    *   BEHAVE_WHEN_ERROR             =
    *   LOGIC_SWITCH                  =
    *   TESTRUN                       =
    *   CONVERT                       = ' '
    * IMPORTING
    *   SALESDOCUMENT                 =
      TABLES
       return                        = i_return
       order_items_in                = i_order_items_in
    *   ORDER_ITEMS_INX               =
        order_partners                = i_order_partners
    *   ORDER_SCHEDULES_IN            =
    *   ORDER_SCHEDULES_INX           =
       order_conditions_in           = i_order_conditions_in
    *   ORDER_CONDITIONS_INX          =
    *   ORDER_CFGS_REF                =
    *   ORDER_CFGS_INST               =
    *   ORDER_CFGS_PART_OF            =
    *   ORDER_CFGS_VALUE              =
    *   ORDER_CFGS_BLOB               =
    *   ORDER_CFGS_VK                 =
    *   ORDER_CFGS_REFINST            =
    *   ORDER_CCARD                   =
    *   ORDER_TEXT                    =
    *   ORDER_KEYS                    =
    *   EXTENSIONIN                   =
    *   PARTNERADDRESSES              =
    READ TABLE i_return INTO w_return WITH KEY type = 'E'.
    IF sy-subrc NE 0.
      CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
        EXPORTING
          wait = 'X'.
    ENDIF.
    LOOP AT i_return INTO w_return .
      WRITE: / w_return-type,
      w_return-id,
      w_return-number,
      w_return-message.
    ENDLOOP.
    Regards
    Kathirvel

  • Confirmation Quantity issue while creating Sales order using BAPI

    Hi SDN,
    Can anyone of you help mein the below issue:
    I have a program to create a sales order using upload file. for this i use "BAPI_SALESORDER_CREATEFROMDAT2" & for changing existing "BAPI_SALESORDER_CHANGE".
    Now If the upload file contains the Same Material, Based on other conditions, it needs to create Multiple sales order.
    When the first Salesorder is created, the Quantity is getting confirmed (Confirmed quantity VBEP-BMENG). But during actual run, since the confirmation is getting done for the same material in the above Sales order, the confirmation is not being done in the subsequent Sales order".
    This poses a problem for business, user need to manual refresh the u201Cconfirmed quantity for each line item in the particular SO where it failed during program upload.
    Also while uploading using the BAPI, if we wait forsometime after creating the first sales order in Debug, then the above material is unlocked & the confirmation quantity is done for the subsequent sales order also.
    But in the actual run, this is creating a problem. Some Refresh or Unlocking problem.
    Can you please suggest a suitable solution for this issue.
    Thanks & regrads,
    Chaitanya LBK

    Have you tried backorder processing?
    V_V1
    V_V2
    V_RA
    V_R1
    V_R2

  • Issue while creating BPEL artifacts using BPEL command line tool

    All
    I am trying to create BPEL artificats for SQL server stored procedure for SQO Server 2005 using BPEL Command line tool.
    My demo.properties is
    ProductName=Microsoft SQL Server
    DriverClassName=com.microsoft.sqlserver.jdbc.SQLServerDriver
    ConnectionString=jdbc:sqlserver://10.10.20.2:1433;databaseName=dAP
    Username:apcdb
    Password:password1
    SchemaName:dev
    ProcedureName:spiSOATesting
    ServiceName:SQLServerSPService
    DatabaseConnection:MSSQLServer
    Destination:c:/temp/sqlprocedure
    and I have create a batch file called as generate.bat and it contains following information
    java -cp D:\jdevstudio10134\integration\lib\DBAdapter.jar;D:\jdevstudio10134\integration\lib\bpm-infra.jar;D:\jdevstudio10134\integration\lib\orabpel.jar;D:\jdevstudio10134\lib\xmlparserv2.jar;D:\jdevstudio10134\lib\xschema.jar;D:\jdevstudio10134\toplink\jlib\toplink.jar;D:\jdevstudio10134\integration\lib\connector15.jar;D:\temp\sqlprocedure\JDBC\sqljdbc.jar oracle.tip.adapter.db.sp.artifacts.GenerateArtifacts %1
    and when I try to run the command at BPEL PM Developer Prompt, I am getting Procedure not found, Can one please tell, what is the cause of this error. and how does this command line tool exactly work.
    Following is the output from command prompt.
    D:\product\10.1.3.1\OracleAS_1\bpel\samples>D:\temp\sqlprocedure\generate.bat D:\temp\sqlprocedure\demo.properties
    D:\product\10.1.3.1\OracleAS_1\bpel\samples>java -cp D:\jdevstudio10134\integration\lib\DBAdapter.jar;D:\jdevstudio10134\integration\lib\bpm-infra.jar
    ;D:\jdevstudio10134\integration\lib\orabpel.jar;D:\jdevstudio10134\lib\xmlparserv2.jar;D:\jdevstudio10134\lib\xschema.jar;D:\jdevstudio10134\toplink\j
    lib\toplink.jar;D:\jdevstudio10134\integration\lib\connector15.jar;D:\temp\sqlprocedure\JDBC\sqljdbc.jar oracle.tip.adapter.db.sp.artifacts.GenerateArtifacts D:\temp\sqlprocedure\demo.properties
    Procedure not found: dAP.spiSOATesting
    Thank you

    HI
      Pricing will be carried basing on the pricing
    procedure.
    Case1: Prices will be carried out automatically if
    necessary condition records are maintained for the
    condition type.
      For this you can go to Sales Order-> Item Conditions
    In the screen you can click on command button Analysis,
    which gives you the list of condition types associated
    to the pricing procedure. By clicking on the condition
    type you can know the action that has taken place.
    Case2: Manually forcing prices for Items.
      To do this, you have to populate ORDER_CONDITIONS_IN &
    ORDER_CONDITIONS_INX. Also note to identify the item
    numbers, you manually pass the item number for each item
    in the sales order, use the same item number for
    populating conditions.
      Parameters required:
    ORDER_CONDITIONS_IN:
      ITM_NUMBER, COND_TYPE, COND_VALUE, CURRENCY
    ORDER_CONDITIONS_INX:
      ITM_NUMBER, COND_TYPE, UPDATEFLAG, COND_VALUE,CURRENCY.
       Hope the above info helps you. Do revert back if you
    need more info.
    Kind Regards
    Eswar

Maybe you are looking for

  • Safari 3.0.4 and OSX 10.4.11 mess

    Hi all, Last night, I must have had too much of the painkiller that I click the software updates. My mac was updates to ver 10.4.11 and voila my Safari is a new version ver 3.0.4. My nightmare is Safari is not working. It was working fine without a h

  • Exchange 2010 Receive Connector intermittently getting an SMTP RSET from sending SMTP servers causing missing user email

    Users are receiving about 95% of their messages from sending SMTP servers. Intermittently, sending SMTP servers send the Exchange 2010 Server a SMTP RSET command for no apparent reason. The RSET Command (by SMTP specification) causes the Exchange 201

  • PDF links - open in new window

    I have a PDF document that has web links that were created in InDesign, then exported as a PDF. Once in the PDF, the links are fine but I would like for a new browser window to open when they are clicked rather than within the same browser window. I

  • Problem distributing javabean ActiveX component

    I have tried using javareg and using Sun's ActiveX Bridge to register my javabean (called NovaBean) as an ActiveX component for use by a VB project. Both javareg and the bridge work on my machine, but when I try to install the app on someone else's m

  • How to check that exception is not thrown for particular exception alone

    Hi, I want to check for Exception but I don't want it to throw exception when it is java.net.SocketException. I want to throw message for all other exception. Please let me know how to implement it. Thanks & Regards, Nasrin.N