Hi everyone !
I have a process chain like this :
Start with an event --> ... --> steps --> ... --> In the last step an ABAP program relaunches the process chain but with conditions.
This process chain loads data in SAP-BW from csv files. I need this mecanism to load n files at each pass and to restart the chain if there are some other files to load.
I have to schedule this process chain daily.
If I schedule it daily as usual I will have an error if the loop takes more than 24h because two chains will be running at the same time.
So what can I do ?
My ideas are :
- to tell the chain to not start when an occurence of the same chain is already running ?
- to schedule dynamically the chain when at the end of the process chain in the ABAP program?
I've tried each of these but I've not been able to make it work...
Does anyone have an idea if either of these is possible ? If so, how ?
If not, any other suggestions ?
Thank you, best regards,
Try this :
REPORT ZPCNEW. TABLES : RSPCLOGCHAIN. DATA : IT_tab TYPE TABLE OF RSPCLOGCHAIN, WA_tab TYPE RSPCLOGCHAIN. FIELD-SYMBOLS <fs> LIKE LINE OF it_tab. PARAMETERS :LV_CHAIN type RSPCLOGCHAIN-CHAIN_ID. select * from RSPCLOGCHAIN into table it_tab where CHAIN_ID = LV_CHAIN and DATUM = sy-datum. SORT it_tab DESCENDING BY DATUM ZEIT. Read table it_tab INDEX 1 ASSIGNING <fs>. IF sy-subrc = 0. if <fs>-ZEIT < sy-uzeit. Message e000(sabapdocu) with 'Error'. else. MESSAGE i162(00) WITH 'Successful'. endif. else. MESSAGE i162(00) WITH 'Successful'. endif.
Thank you for the quick answers !
@Aparna : already done, I didn't know the "wait event". I'll read the documentation about that.
@Vikram : that's a good solution. Your code doesn't work if the process chain is not running but have already been running today. But in RSPCLOGCHAIN I found all I need (ANALYZED, ANALYZED_STATUS...) to check if the process chain is running, so that solve my problem !
Thank you both !