SAP-BI: Starting Process-Chain via Programm RSPC_API_CHAIN_START and wait for result

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
RSPC_API_CHAIN_START

This can be called synchonous with the following example:
call function 'RSPC_API_CHAIN_START'
exporting
i_chain = 'ZMYPROCCESSCHAIN
* I_T_VARIABLES =
i_synchronous = 'X'
* I_SIMULATE =
* I_NOPLAN =
* I_DONT_WAIT =
* IMPORTING
* E_LOGID =
exceptions
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.

SAP-BI: Starting Process-Chain via Programm RSPC_API_CHAIN_START and wait for result

Ein Gedanke zu „SAP-BI: Starting Process-Chain via Programm RSPC_API_CHAIN_START and wait for result

  1. Klaus schreibt:

    Another option is to use wait and RSPC_API_CHAIN_GET_STATUS in a while loop. This works witht every chain.

Schreibe einen Kommentar

Deine E-Mail-Adresse wird nicht veröffentlicht. Erforderliche Felder sind mit * markiert.