External process waiting

Hi All,
This one's got me.
I have the following requirement in my app:
- Ability to browse for, and save files to the database.
- View (and modify if required) saved files using the default external application.
- When the default external application exits, if the file has changed, resave it to the database automatically without the need for further user action.
First part's easy.
When viewing the file, I write the file (using it's stored filename and extension from when it was saved) to a temp directory under my app's installation directory.
Second part: I see three options using ProcessBuilder and process.waitFor():
1. Use the exe (eg winword.exe) directly (requires path to the exe).
2. Use "cmd.exe /c [absolute file path]" to open the file.
3. Use "rundll32 SHELL32.DLL,ShellExec_RunDLL [absolute file path]" to open the file.
All three approaches work fine, except only the first option complies with part three of the requirement, ie only using the exe directly waits for the external app to exit.
The issue with the first approach is that I need to know the absolute path to the exe, which can vary on user's machines (eg can't guarantee that winword.exe will always be in the same directory).
The other 2 (cmd.exe and rundll32) open the app in another external process and return immediately. This prevents me from being able to detect termination of the external process and resave the file, and as the process returns immediately I can't necessarily delete the file successfully.
A solution I see to the shortfall of the first approach is to have the default apps stored as preferences/config by allowing the user to browse to and select the default apps. Can't really expect computer illiterate users to know where to find winword.exe let alone know it starts Word.
I'm open to suggestions here. If I could open the file within Java (passing a byte[]) and allow the user view and / or modify it there without it ever touching the filesystem that would be awesome. However I suspect such functionality would mean a huge footprint.
I also thought about the app being able to do it's own file search to locate winword.exe on the filesystem (eg scan c:\program files etc).
Alternatively, does anyone know how to get cmd.exe or rundll32 to wait for gui apps? This is from CMD help:
"When executing an application that is a 32-bit GUI application, CMD.EXE does not wait for the application to terminate before returning to the command prompt."Any suggestions would be really appreciated.
Thanks in advance,
Paul C.

The below method seems to work with Word documents, although it is not very elegant and costs 2 file rename operations at worst:
          boolean locked = true;
          String fileName = "C:/test.doc";
          String newFileName = "C:/test_renamed.doc";
          try {
               File file = new File(fileName);
               File newFile = new File(newFileName);
               boolean renamed = file.renameTo(newFile);
               System.out.println(file.getName()+" renamed to "+newFile.getName()+" = "+renamed);
               if (renamed) {
                    File oldFile = new File(fileName);
                    renamed = newFile.renameTo(oldFile);
                    System.out.println(newFile.getName()+" renamed to "+oldFile.getName()+" = "+renamed);
                    if (renamed) locked = false;
          catch(Exception e){
               e.printStackTrace();
          finally {
               System.out.println("FILE "+fileName+" LOCKED = "+locked);
          }

Similar Messages

  • S.O.S PROBLEMS COMUNICANTING EXTERNAL PROCESSES IN JAVA UNDER LINUX

    I've programmed a little program in C called "cinterpreter" which works like
    an interpreter, when it launches it shows a welcome message to the display
    (standart output), then is always waiting for strings from the keyboard
    showing the length of the input strings until the "quit" string is received,
    in that case the C program named "cinterpreter" finish, here we can see the
    code:
    # include <stdio.h>
    # include <string.h>
    # include <stdlib.h>
    char presentacion[8][80] = {
    " ||||||||||||||||||\n",
    " --- Welcome to Maude ---\n",
    " ||||||||||||||||||\n",
    " Maude version 1.0.5 built: Apr 5 2000 15:56:52\n",
    " Copyright 1997-2000 SRI International\n",
    " Thu Aug 9 13:40:25 2001\n",
    " \n",
    " \n"};
    void longitud(char * cadena)
    int t;
    for(t=0;t<3;t++)
    printf("MAUDE_OUT> la cadena %s tiene %d caracteres\n",cadena,strlen(cadena));
    fflush(stdout);
    int main()
    char cadena[80];
    int i;
    char ch;
    for(i=0;i<8;++i) printf("%s",presentacion);
    printf("\n");
    fflush(stdout);
    do {
    printf("Press any key to continue\n");
    scanf("%c",&ch);
    printf("%c\n",ch);
    fflush(stdout);
    }while (ch != 'q');
    printf("\n");
    while( strcmp(cadena,"quit") !=0)
    printf("\nMAUDEENTRADA>");
    fflush(stdout);
    scanf("%s",cadena);
    longitud(cadena);
    I'm intereted in running this program, control it's standart input and
    starndart output through a java program through the Runtime , process class
    and the correponding methods like "exec", getInputStream, getOutputStream,
    getErrorStream, the question is that I do not Know what I'm doing wrongly but
    I don't get what I want, I'm interested in sending input to the C subprocess
    thorugh its stdin getting it by getoutputStream method, and then read its
    answer from its stdout getting it by getoutputStream, then question is that I
    can sent de first string and read the first answer but I can't repeat it
    again, and I would like to begin a dialog with the subprocess so I need to
    send many messages and receive its answer to it, but many times, not just one,
    by the moment I got it but just one, if any body can help with this please
    answer the question or send any answer to the next adresses
    e-mail:
    [email protected]
    [email protected]
    *************** java code **********************
    import java.io.*;
    public class mioss {
    static String proceso = "/bin/cinterprete";
    static Process p = null;
    //--------- input writting method -----------
    static void escribe(OutputStream procesoescribe, String s) {
    BufferedWriter laentrada = new BufferedWriter(new
    OutputStreamWriter(procesoescribe));
    try{
    laentrada.write(s + "\n");
    laentrada.flush();
    }catch(IOException e) {System.out.println("error de escritura");}
    //----------- output reading method ---------------
    static void leesalida(InputStream procesosalida){
    String l;
    BufferedReader lasalida = new BufferedReader(new
    InputStreamReader(procesosalida));
    try{
    while ((l = lasalida.readLine()) != null){
    System.out.println(l);
    } catch(IOException e) {System.out.println("error de readline");}
    //------------- reading error method --------------------
    static void leerror(Process p){
    String l;
    BufferedReader elerror = new BufferedReader(new
    InputStreamReader(p.getErrorStream()));
    try{
    while ((l = elerror.readLine()) != null){
    System.out.println(l);
    elerror.close();
    } catch(IOException e) {System.out.println("error de readline");}
    //--------------- principal method main -------------------------
    static Process proc = null;
    public static void main(String [] Args) {
    try{
    Runtime r = Runtime.getRuntime();
    proc = r.exec(proceso);
    escribe(proc.getOutputStream(),"map(+2)[3,3]");
    leesalida(proc.getInputStream());
    escribe (proc.getOutputStream(),"map(*3)[2,2]");
    leesalida(proc.getInputStream());
    }catch(Exception e) {System.out.println("error de ejecucion del
    proceso");}
    System.out.println("THE END OF THE PROGRAM");

    The problem is with the leesalida method.
    There you are reading form the output sream of the process usingBufferedReader.readLine.
    readLine returns null only when it gets to the end of the stream, or here the stream ends only when the external processes ends.
    You can modify your code like this:
    public class mioss {
        static String proceso = "cinterprete";
        static Process p = null;
        //--------- input writting method -----------
        static void escribe(OutputStream procesoescribe, String s) {
         BufferedWriter laentrada = new BufferedWriter(new
             OutputStreamWriter(procesoescribe));
         try{
             laentrada.write(s + "\n");
             laentrada.flush();
         }catch(IOException e) {System.out.println("error de escritura:" + e);}
        //----------- output reading method ---------------
        static void leesalida(InputStream procesosalida, int nLines){
         String l;
         BufferedReader lasalida = new BufferedReader(new
             InputStreamReader(procesosalida));
         try{
             while(nLines-- > 0) {
              l = lasalida.readLine();
                    System.out.println("from java:\t" + l);
         } catch(IOException e) {System.out.println("error de readline");}
        //------------- reading error method --------------------
        static void leerror(Process p){
         String l;
         BufferedReader elerror = new BufferedReader(new
             InputStreamReader(p.getErrorStream()));
         try{
             while ((l = elerror.readLine()) != null){
                    System.out.println(l);
             elerror.close();
         } catch(IOException e) {System.out.println("error de readline");}
        //--------------- principal method main -------------------------
        static Process proc = null;
        public static void main(String [] Args) {
         try{
             Runtime r = Runtime.getRuntime();
             proc = r.exec(proceso);
             leesalida(proc.getInputStream(), 9);
             escribe(proc.getOutputStream(),"first");
             leesalida(proc.getInputStream(), 4);
             System.out.println("Done first !\n");
             escribe (proc.getOutputStream(),"second");
             leesalida(proc.getInputStream(), 4);
             System.out.println("Done second !\n");
         }catch(Exception e) {System.out.println("error de ejecucion del proceso");}
         System.out.println("THE END OF THE PROGRAM");
    } Regards,
    Iulian

  • How to handle starting of external processes with Runtime.exec() properly

    hi people,
    you find a lot about starting external processes with the Runtime class in every forum.
    -> that the stdout of the started processes has to be redirected and read
    due to os buffer problems
    -> that calling batches is done by starting the interpreter and the batch as parameter (cmd.exe, /bin/sh,..)
    -> that the created process doesn't have an os environment
    -> ...
    but what if you don't know anything about the started process.
    what if you only want only to start an external process. if you don't want to wait til waitfor() returns and if you don't read the streams of the created processes, the os stdout buffer will overflow immediately an the started process will be blocked.
    you can read the stdout of the started process, but what if the process does print nothing to stdout, and your bufferreader.readLine() will block ?
    you can do this (read buffer, waitFor()) in an separate thread, but the thread lives til the started process will finish, so maybe you got dozens of senseless thread ?
    So, what is an effective and good way to start external programs/processes if you don't know about them.
    so i would be grateful for an answer
    regards
    Alen

    I realize that's a pat answer, but it's true. Spawing off another program without being able to predict its behavior is dangerous.
    But anyway, as I understand it creating a new process is relatively expensive. The cost of creating new threads to read the process's I/O and later garbage collecting those threads when the process dies, probably isn't much of an additional burden.

  • RW-50004: Error code received when running external process.

    Hi,
    I am trying to install 11.5.10 on windows vista and receiveing following error.
    RW-50004: Error code received when running external process. Check log for details. Running Database Install Driver for VIS Instance
    When checked on the log file following is the error. Could anyone pls help me with this regard
    There was an error while running the command - c:\OracleApps\visdb\9.2.0\temp\VIS_erp\adrun9i.cmd APPS APPS
    The process tried to write to a nonexistent pipe.
    The process tried to write to a nonexistent pipe.
    The process tried to write to a nonexistent pipe.
    The process tried to write to a nonexistent pipe.
    The process tried to write to a nonexistent pipe.
    The process tried to write to a nonexistent pipe.
    The process tried to write to a nonexistent pipe.
    The process tried to write to a nonexistent pipe.
    The process tried to write to a nonexistent pipe.
    The process tried to write to a nonexistent pipe.
    RW-50010: Error: - script has returned an error: 1
    RW-50004: Error code received when running external process.
    "dbInstancecfg" file shows below error
    Copyright (c) 1991, 2002, Oracle Corporation. All rights reserved.
    Connecting to (ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROCVIS))
    TNS-12541: TNS:no listener
    TNS-12560: TNS:protocol adapter error
    TNS-00511: No listener
    32-bit Windows Error: 2: No such file or directory
    Connecting to (ADDRESS=(PROTOCOL=TCP)(Host=erp.erp)(Port=1521))
    TNS-12541: TNS:no listener
    TNS-12560: TNS:protocol adapter error
    TNS-00511: No listener
    32-bit Windows Error: 61: Unknown error
    LSNRCTL for 32-bit Windows: Version 9.2.0.6.0 - Production on 13-JUL-2008 05:48:04
    Copyright (c) 1991, 2002, Oracle Corporation. All rights reserved.
    Starting tnslsnr: please wait...
    TNS-12546: TNS:permission denied
    TNS-12560: TNS:protocol adapter error
    TNS-00516: Permission denied
    32-bit Windows Error: 5: Input/output error
    addlnctl.cmd exiting with status 3
    OpenSCManager failed
    adsvdlsn.cmd exiting with status 1002
    ERRORCODE = 1002 ERRORCODE_END
    .end std out.
    System error 1060 has occurred.
    The specified service does not exist as an installed service.
    .end err out.
    File c:\OracleApps\visdb\9.2.0\appsutil\install\VIS_erp\afmkinit_inst.cmd not instantiated in the current pass, this file will not be executed
    Executing script in InstantiateFile:
    c:\OracleApps\visdb\9.2.0\appsutil\install\VIS_erp\afmkinit.cmd
    script returned:
    Sun 07/13/2008
    05:48 AM
    1 file(s) copied.
    1 file(s) copied.
    1 file(s) copied.
    "afmkinit.cmd exiting with status 0"
    ERRORCODE = 0 ERRORCODE_END
    .end std out.
    .end err out.
    Skipping INSTE8_PRF
    Skipping INSTE8_APPLY
    [AutoConfig Error Report]
    The following report lists errors AutoConfig encountered during each
    phase of its execution. Errors are grouped by directory and phase.
    The report format is:
    <filename> <phase> <return code where appropriate>
    [SETUP PHASE]
    AutoConfig could not successfully execute the following scripts:
    Directory: c:\OracleApps\visdb\9.2.0\appsutil\install\VIS_erp
    adsvdlsn.cmd INSTE8_SETUP 1002
    AutoConfig is exiting with status 1

    Thanks for the update and the link was informational.
    Can I install following on windows vista? Pls confirm.
    Oracle® Applications 11i Release 10.2 Media Pack for
    Microsoft Windows (32-bit) No That's not possible, if you would like to use this machine for Applications then the OS needs to be changed or install vmware/Microsoft Virtual PC with a Certified Operating system to be able to use Applications.
    Thanks
    Ronald

  • Starting of external processes with Runtime.exec() properly

    hi people,
    you find a lot about starting external processes with the Runtime class in every forum.
    -> that the stdout of the started processes has to be redirected and read
    due to os buffer problems
    -> that calling batches is done by starting the interpreter and the batch as parameter (cmd.exe, /bin/sh,..)
    -> that the created process doesn't have an os environment
    -> ...
    but what if you don't know anything about the started process.
    what if you only want only to start an external process. if you don't want to wait til waitfor() returns and if you don't read the streams of the created processes, the os stdout buffer will overflow immediately an the started process will be blocked.
    you can read the stdout of the started process, but what if the process does print nothing to stdout, and your bufferreader.readLine() will block ?
    you can do this (read buffer, waitFor()) in an separate thread, but the thread lives til the started process will finish, so maybe you got dozens of senseless thread ?
    So, what is an effective and good way to start external programs/processes if you don't know about them.
    so i would be grateful for an answer
    regards
    Alen

    http://forum.java.sun.com/thread.jspa?threadID=659862&tstart=0
    The first four might pass as accidents, but this one is simply idiocy, spamming and general bad manners.

  • Correlation termiatation ,external message wait and Notification.send

    Hi,
    In one of my process I have correlation (is being created using requestId)and external message wait to terminate this correlation .By using Correlation.terminate("ProcessName"); I am terminating correlation.Its working fine.
    My requirement is ,After correlation terminate ,If I call external message wait(by passing requestId) using following code then It should throw the exception.Currently It is not throwing exception.
    Fuego.Lib.Notification.send(processId : "ProcessName", activityName : "MessageWait",
              arguments : {argument is requestID  : "In");
    Please help me how to set up correlation or  external message wait to get exception when we call external message wait after termination of request
    Thanks
    Sailendra                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

    Please help me..still facing this issue
    Thanks
    Sailendra

  • Confirmation of external processing operation

    Dear All,
    I would like to know is it possible to prevent the confirmation of an external processing operation (pp02 control key) until the Purchase Order associated with that operation is received (GR) ?
    I checked the forum for this, but was unable to find any inputs & also in customizing where i find only settings for confirmation of orders & not at operation level.
    Hope my problem is clear, await inputs.
    Regards,
    Vivek

    Yes,
    it can be done but no through std SAP setting...but with user exit.
    Check this exit
    CONFPP03  PP order conf.: Cust. specific check after op. selection
    CONFPP04  PP order conf.: Customer specific input checks       
    CONFPP05  PP order conf.: Customer specific enhancements.

  • Product Costing:External Processing

    Hi Gurus,
    My doubt is I am comparing standard cost estimates of production client with another client which is its copy. The product cost estimate of a material, the cost component 'External Processing' is showing value 700 in PN client and 1000 in the New client. The cost element for 'External Processing is 700000000H as primary cost element and another as secondary cost element. I tried checking the GL account report in FBL3N regarding the postings happened in the GL accounts.
    1. My question is why there is a variation of 700(of PN client) and 1000(in NEW client).
    2. The second question is, from where these values are flowing.How we can trace back the flow of values for this particular cost component of External Processing' of a material cost estimate?
    Is it anyway related with Exchange Rate differences? If so, how and where it is linked?
    I'll be really grateful for your answers.
    Looking forward for you reply soon.
    Thanks,
    Prithwi.

    Hi,
    I have checked the valuation variant 001. The startegy sequence is same only. There's no change in configuration settings as the new client is copy of production client only.
    I wanted to know, the 'External processing' data or values from which.postings. How it gets picked up and how we can check its origin?
    Thanks in advance for your help.
    Prithwi.

  • How to pass BindVariables to External Process (Workflow)

    I build a shell script (unix) which accepts a command line parameter .... a "filename"
    The "filename" is a dynamic name!
    The workflow is build with a custom input parameter "filename" ... which I want to pass to an external process, which calls this shell script:
    How can I do that ?
    ExtProcess:
    Command : Val=/bin/ksh
    Parameter_List : Val=":/home/bin/myscript.sh:${Task.Input}:"
    (Binding ":Filename" replaces the whole value, sorry)
    Succes_Threshold: Val=0
    Script : Val="" , Binding=":Filename"
    ... does not pass the value of ":Filename"
    Script : Val="/tmp/fixed.name"
    ... works only with fixed names
    what I really need is something simple like:
    Parameter_list : Val=":/home/bin/myscript.sh:${Parameter.Filename}:FIXPARAM:"
    or Script : Val=":${Parameter.Filename}:${Parameter.Param2}:${Parameter.Pram3}"
    ... similar problem I had with FTP, I found no way to pass dynamic filenames or other parameters (except LOCATION Parameters)
    ... similar problem I had with EMAIL I found no way to include PARAMETERS to the mail body (except to replace the whole body by 1 parameter)
    Is there a solution or is in current version OWB 9.2 only "static" parameters supported.
    I also was missing to pass OUTPUT-parameters for example of a TRANSFORMation,
    I also was missing some urgent SYSTEM-parameters for self identification of the process(like "SYSTEM.TASK_NAME" "SYSTEM.EXECUTION_AUDIT_ID" "SYSTEM.ITEM_KEY" )
    Thanks for all hints and best regards
    Martin

    Actually... After further investigation this may not be needed. I'd be interested in the answer, to understand what is possible.
    The concept of passing parameters in the OWB workflow designer is rather limited, in my humble opinion. Sure, you can designate a "start" sequence that takes a parameter and you can pass that to mappings/transformations but there is no chance for feedback. Ie, if I manually (or through some rigged script) execute the flow with the "PARAMETER" then it will be able to bind. What about mid-flow. IE, select the record to be "processed", then call a "flow" with that as a parameter.
    Am I mistaken? Is there a way to expose the "out" parameters of a mapping, or the return of a "transformation function" as "OUTS" in the process flow.
    Of course, in a world where everything is OWB and in the DB one can leave data in tables, and pick it up on the other mappings. HOWEVER, most BI systems involve external retrievals, etc. that need a bit more "intelligence" then "run and return 1,2,3" . :)
    Hope this is helpful for product feedback. If I'm mistaken on the WF capabilities please clue me in. :)
    btw, I'm an OWB fan, certainly. The progress over the past two years has been excellent.

  • Error in using External Process in the Process Flow

    I Created a Process Flow with an external process to Move the file from one location to another location,
    I gave the below parameters for the External Process
    COMMAND: move
    PARAMETER_LIST: ?F:\\FlatFiles\\in\\company.txt?F:\\FlatFiles\\error\\company.err
    SUCCESS_THRESHOLD: 0
    SCRIPT:
    The environment is
    Windows 2003
    OWB 9.2.0.8
    OWF Builder 2.6
    When I deploy and execute using Deployment Manager, it gave me the below error
    Starting Execution TEST
    Starting Task TEST
    Starting Task TEST:EXTERNALPROCESS
    CreateProcess: move move F:\FlatFiles\in\company.txt F:\FlatFiles\error\company.err error=2
    Completing Task TEST:EXTERNALPROCESS
    Completing Task TEST
    Completing Execution TEST
    What am I missing something here?
    Is my Parameters correct?
    GIve me the link where I can find more on using External process.
    Please...please...help me..
    Shree

    Nikolai,
    I have created a simple process flow which only calls the external process. The script is on the same host as the process flow is deployed to.
    I have used two diffent values for the command parameter.
    1. I placed the full path of the file in the command parameter and left the script parameter blank:
    COMMAND: /edwftp/ppas/scripts/ClearPPAS.sh
    PARAMETER_LIST:
    SUCCESS_THRESHOLD: 0
    SCRIPT:
    2.I placed the bash command in the command parameter and the full path in the script parameter.
    COMMAND: /usr/bin/sh
    PARAMETER_LIST:
    SUCCESS_THRESHOLD: 0
    SCRIPT: /edwftp/ppas/scripts/ClearPPAS.sh
    Both of these appear to work as they print out the statements inside the script but the files that are supposed to be removed still remain.
    Starting Execution EXTER_FILE
    Starting Task EXTER_FILE
    Starting Task EXTER_FILE:EXTERNALPROCESS
    Removing ActivatedAudit.dat...
    Removing ActivatedCustomers.dat...
    Removing ActiveAudit.dat...
    Removing ActiveCustomers.dat...
    Done!
    Create the Activated Customers data file...
    Create the Active Customers data file...
    Done!
    WARNING: Log file truncated - see RAB for further information.
    /edwftp/ppas/scripts/ActivatedCustomers.sh: /edwftp/ppas/log/ActivatedCustomers.log: cannot create
    /edwftp/ppas/scripts/ActiveCustomers.sh: /edwftp/ppas/log/ActiveCustomers.log: cannot create
    WARNING: Log file truncated - see RAB for further information.
    Completing Task EXTER_FILE:EXTERNALPROCESS
    Completing Task EXTER_FILE
    Completing Execution EXTER_FILE
    The permissions on the /log direcotry are 775. The user I register the file location with owns this directory.
    Can't think of anything else I have missed. I really appreciate your help :)
    Ryan

  • External Processing with material Provided to Vendor

    Dear All,
    I have a problem in external processing of Maintenance Order.
    When i have created external processing operation.
    I have assigned one component for that external operation which i have to send to vendor.
    After saving the Maintenance order, system is generating Purchase Requisition for that operation.
    That purchase requisition is having account assignment category F. But it is not picking the item category L and the component assigned for this external operation is not flowing to the purchase requisition.
    Please guide me to solve this issue.
    Thanks & Regards
    Bala

    Hi
    For external service we can use PM03, for that we have to create service sheet and proceed further.
    But here my requirement is, just like PP external processing they are doing one operation outside.
    If you look at PP routing, Operation overview there is given external processing data and there will be subcontracting tick.
    If we tick the sub-contracting button, then system will pick the component assigned to that operation to the Purchase requisition.
    If we don't tick that button, system will not copy the component to PReq. .
    Is there any option available here in PM?
    Please guide me.
    Thanks & Regards
    Bala

  • External processing in the plant as vendor under same company code

    Hi friends,
    In our project under implementation we have following scenario.
    we have 4 plants under one company code. one of the plant does powder coating as manufacturing activity. Other 3 plants sends components to the powder coating plant for coating purpose.
    In IDES Standard scenario of external processing, a purchase requisition is raised thro info record maintained for the external operation. This scenarion works if the vendor is external.
    In our case, the vendor is one of the other plant under same company code/client. Also the powder coating needs to be done without any profit margin for internal customers.
    Our FICO guys have the opinion that, intra plant can't be a vendor; because raising invoices among plants under the same company codes is against accounting standars.
    If anybody has faced this type of scenario nd found the solution, Please share it here.
    Thanx in advance

    Hi Shiva
    STO scenario
    You can not create only STO as you need to send the unpainted components to another plant through SAP & have them painted back with only payment of paining charges without margin.
    Subcontracting scenario
    You can not create the Subcontracting PO as this is not your external vendor.
    Does this involves excise?
    Then the PR/PO ctreated should be of combination of STO and subcontracting. If so this is not possible, as item category is the only field in PR/PO that identifies it as STO and subcontracting. obiviously it cann't have 2 values.
    My suggesion on this as...
    Create a BOM for painted component with sp procurement key as produced in another plant(paining plant). this will have STO cretaed for paining plant. This will inturn cretae a production order in painitng plant.
    The BOM in painting plant will have the unpainted component with sp procurement key as produced in another plant ( fabricated plant) this will have STO created for unpainted components.
    I hope I am clear & not confused you much.
    Regards
    Mahesh
    Regards
    Mahesh

  • Production operation external processing goods receipt for subcontract PO

    Hi PP/MM experts,
    I searched for existing forum entries but no luck or final answer.
    I have a question about the goods receipt for a subcontracting PO that is account assigned to an operation of a production order (external processing for operation).
    The following situation:
    Production order type PP02 - external processing
    There is only one operation in the production order with control key PP02 - external processing. I marked the control key PP02 in configuration for 'Automatic goods receipt'.
    I created a PO for the PR is the operation
    When I'm doing the goods receipt of the subcontrating PO a 101 posting is triggered for the finished product and components are consumed by 543 O movements. So far so good. But the inventory for the finished style is not increased. In MIGO I even see that even a batch number for the finished product is determined. Looks like that only the service is posted but not the inventory. I assumed when I mark the operation contol key for 'goods receipt' that the MIGO will also post the inventory for the finished style.
    Reason for PP order and not only subcontract order is that we want to manage capacities of external suppliers with PP capacity planning.
    Is that a bug in our system or normal behaviour? We use SAP ERP 6.5 with IS AFS.
    Thanks in advance for your answers.
    Best Regrads,
    Harry

    Hi Rizzi and all others,
    thanks for your replies.
    I'm using a production order for the following reasons:
    We want to use capacity planning for external suppliers. At least to have some overview of work they have to do in a month
    The external assembly can also be changed to internal assmebly and for that reason we will start always with the same kind of document -> production order.
    But one more thing what is really confusing. In the materials document list MB51 the 101 movement for the service is listed even if the inventory was not increased. That is really confusing for the users.
    Best Regards,
    Harry

  • Sub-contracting External Processing PP-PI

    hI,
    I am trying to create sub-contracting order through SAP PP-PI.
    I have a FG - X, with components X1 & X2.
    I have 3operations and 3 phases in the Recipe for X.
    The 2nd phase is having the control key for external processing, because of which i had to assign Purc.Info record to this phase.
    ( Pls note that its not allowing me to enter a PIR of material/vendor combination, hence had to create for Material Group/ Vendor).
    Now when i Create and release a Process order for X, there is a Pur req created but it has no material, and i cant change anything in this Pur. req.
    Please help.

    Hi,
    When a Preq is created for external processing, the material is not copied in to the Preq. This is std SAP behavior. However with EhP4, this functionality is made available. You need to activate this functionality and then some code changes has to be done in the BADI in order to copy the material from order to Preq. I don't remember the BADI, but I am sure there is one.
    Thanks

  • Tracking of wip material in externally processed operation

    Hi All,
    As part of production process, most of the operations would be processed internally in the manufacturing plant and some of the operations would be
    performed by vendor at his own premises (outside the manufacturing plant). Material will be called as WIP (work in process) material if it completes some of the operations (two operations completed out of four operations) in production process without forming its final product shape
    WIP (work in process) material will be sent out to vendor against externally processed operation in production order. We’ve a business requirement to track the WIP (Work in Process, No inventory yet in system) material status details such as when was the WIP material shipped out to service provider by purchasing department or returned back to production floor from stores after receiving from vendor for externally processed operation in production
    order
    The scenario is explained below and the process in SAP would be as follows.
    1. Production order would be created for
    respective header material (semi-finished/finished) with required quantity with five operations to be processed, for example: OP10 (turning), OP20 (drilling), OP30 (milling), OP40 (shaping), OP50 (powder coating). OP10, OP20, OP40, OP50. would be processed internally in the shop floor of the manufacturing plant
    2.After finishing the internal processing at OP10 and OP20,  Operation no 30 (OP30-milling) for the respective header
    material would be processed externally by sending the partially processed part(WIP) to vendor outside the manufacturing plant. In SAP, the partially processed part doesn't have any material code and will not be updated in the inventory and will be treated as WIP (work in process) and automatic purchase requisition for external processing through production order is generated as follows
    For OP30 Milling (Externally processed operation), from PP module perspective, we would be maintaining a control key which supports external
    processing in the Operation 30 (OP30, external processed operation - An externally processed operation is not carried out within own organization, but is assigned to a vendor, who then does the work) with relevant information such as material group, purchase group, description of operation, cost element to track costs in the production order.
    When the respective production order is saved, system creates a purchase requisition for external processed operation 30. We can see
    the number of the purchase requisition on the external processing tab of operation details screen of OP30 in SAP Production order.
    Purchasing department generates a purchase order against the automatic purchase requisition generated in production order, which informs the
    vendor which service is required.
    With reference to the purchase order – service oriented, the WIP material (no material code exists in SAP) is sent out to vendor. After the material has been processed, the vendor delivers the material back to manufacturing plant. When a goods receipt against purchase order is posted at manufacturing plant, the system displays the received quantity on the external processing tab of operation details screen of the operation - OP30 in production order and also displays in order information system reports. It also possible to track the cost incurred for external operation. However, Goods receipt against production order does not cause an increase in the quantity and value of the warehouse stock of header material of production order.
    The above mentioned process is not a subcontracting process - where in we send raw materials and receive semi-finished/finished materials from vendor
    3. The respective partially processed part (WIP) received from vendor is sent to shop floor to complete the rest of the process
    in OP40 (shaping) and OP50 (powder coating).
    4. After OP50, the respective header material (semi-finished/finished) of the production order will be received (goods
    receipt against production order) as inventory in respective storage location.
    With reference to the above process, we can track the status of receipt of WIP material from vendor after processing at his premises;
    however, we can’t track when WIP material ( after completing processing at OP20) was sent out to vendor for external processing by purchasing department and when WIP material was returned back to production shop floor for further processing at OP40 after receiving from vendor by stores.
       Please provide your feedback for the possibility to track the details of WIP material (no material code exists in SAP system) sent out to
    vendor and received back at shop floor from stores for external processed operation of production order
    Thanks for help in advance.
    Regards,
    Rajesh

    Hi Rajesh,
    Process what ever you have explained is the right process with respective to operation wise subcontracting as per SAP Best practice. As you rihtly said in operation wise subcontracting PR is created with any material code. Once PR is created after PO and GR actual cost of that particular operation will be seen on the order. I believe sub contact operation after GR can be confirmed through confirmation transactions. Since it is subcontract operation specfic to peration seperate inventory is not tracked instead cost is reflecting directly on order
    If you to want to track the inventory of the intermdiate product then you need to have a seperate material code for intermediate product (Eg A) received after second operation and do seperate subcontacting PR for seperate new material (Eg B) by issuing the intermediate material (Eg. A). Upon receivng GR for PO inventory will be updated for the new material (Eg B).This new material can be issued to your final product which has operation 0040 and 0050. Here two different material codes will be required.
    Else follow the suggestion given by expert Caetano.
    Thanks & Regards,
    Ramagiri

Maybe you are looking for

  • Polish Characters are extracting as # values

    Hi All,         We are facing an issue while extracting Polish characters (Names) from HCM system. The Source system has proper Polish characters but when extracting into BI, it displays as # values in place of polish characters. The BI system has Po

  • Problems with Safari Loading Sites and Photos

    For the past week (Feb. 2015) I've experience problems with Safari loading websites on my 2009 20" iMac desktop. Running version OSX Lion 10.7.3  4 GB.   Intel Duo Core 2.66 GHz Mac also will frequently not upload photos at websites like Yahoo News o

  • Showing "Backup" in System Info on Internal SSD

    I was in System Info looking at how much SSD space I have left in my New MacBook Pro.  When I looked about a week ago, it showed 0GB in Backups.  Today it said there was 14GB of Backups on the Internal SSD.  Can anyone tell me what this is and if and

  • Need to tune SGA SIZE AND PGA SIZE, SHARED POOL SIZE.

    Hi, We have 2node rac with 11g on Linux with 32 bit RAM on each machine. two instances are running on each machine. i.e on NODE1(OBI1,EBS1) and on node2(OBI2,EBS2) instances. we allocated memory parameter as follows. FOR OBI1,OBI2 :- sga_target --> 1

  • Does military discount stack with coporate discount?

    Does the military discount also stack with the corporate discount?