Sometimes you want to start a Processchain via programm and wait for it to end. This is a bit tricky as a Processchain starts normaly in Background and doesn’t give you a result if it is ended correctly.
SAP provides for !!!small!!! Processchain the Function
This can be called synchonous with the following example:
call function 'RSPC_API_CHAIN_START'
i_chain = 'ZMYPROCCESSCHAIN
* I_T_VARIABLES =
i_synchronous = 'X'
* I_SIMULATE =
* I_NOPLAN =
* I_DONT_WAIT =
* E_LOGID =
failed = 1
others = 2
What you have to know is – the result of this function is given on the !!!first!!! finished step – and !!!not!!! for the whole chain. To wait you have to use a little trick:
While using a one-step-chain with a Sub-Processchain this little problem is solved.