Skip to Content
0
Jan 22, 2019 at 10:55 AM

WebDynpro Execute SAP BW PRocess Chain in Background and wait

181 Views Last edit Jan 22, 2019 at 12:04 PM 4 rev

Hi together,

I'm trying to to the following:

WebDynpro -> one Button -> Calls Function Module RSPC_API_CHAIN_START -> Process Chain starts and Logging-ID is returned.

-> Now I want to Disable the Layout

Next Step:

while Process-Chain status is Aktive i call the function module RSPC_API_CHAIN_GET_STATUS every 5 seconds, to get the actual status of the process chain.

After Status of the chain has finished: the Layout is diabled.

So coding in WebDynpro is:

CALL FUNCTION 'RSPC_API_CHAIN_START'
EXPORTING
I_CHAIN = I_V_PROCESS_CHAIN
I_NOPLAN = 'X'
IMPORTING
E_LOGID = LV_PCLOGID
EXCEPTIONS
FAILED = 1
OTHERS = 2.

LV_STATUS = 'A'.

CONCATENATE 'Prozesskette gestartet. LOG-ID: ' LV_PCLOGID INTO LV_STRING.CALL METHOD

WD_CONTEXT->SET_ATTRIBUTE "Disable the Layout

EXPORTING

INDEX = USE_LEAD_SELECTION
VALUE = LV_STRING
NAME = 'LOGGING_TEXT_PC'.

WHILE LV_STATUS = 'A'.
C_COUNTI = SY-INDEX - ( ( C_WAITMIN * 60 ) / C_POLSEC ).
IF C_COUNTI > 0.
CLEAR LV_STATUS.
CONTINUE.
ENDIF.
WAIT UP TO C_POLSEC SECONDS.
CALL FUNCTION 'RSPC_API_CHAIN_GET_STATUS'
EXPORTING
I_CHAIN = I_V_PROCESS_CHAIN
I_LOGID = LV_PCLOGID
IMPORTING
E_STATUS = LV_STATUS
E_MANUAL_ABORT = LV_MAN_ABORT
E_MESSAGE = LV_MESSAGE
E_S_MESSAGE = LS_STATUS_MSG.
ENDWHILE.

IF LV_STATUS = 'G'.

"Enable the layout here again

ENDIF.

Any tips/ideas how to solve that?


Regards
Lars