2021 Jan 12 7:48 AM
Hi all
I have created a program that uses BGRFC:
DATA(lo_inbound) = cl_bgrfc_destination_inbound=>create( dest_name = 'YCAS1' ).
DATA(lo_trcf) = lo_inbound->create_trfc_unit( ).
CALL FUNCTION 'ZAMAR_BG_PROCESS' IN BACKGROUND UNIT lo_trcf
EXPORTING
iv_num = 1000000.
CALL FUNCTION 'ZAMAR_BG_PROCESS' IN BACKGROUND UNIT lo_trcf
EXPORTING
iv_num = 2000000.
CALL FUNCTION 'ZAMAR_BG_PROCESS' IN BACKGROUND UNIT lo_trcf
EXPORTING
iv_num = 2000000.
COMMIT WORK.
WRITE:/ cl_trfc_client_inbound=>if_bgrfc_client~get_unit_state( unit_id = lo_trcf->unit_id ).
WRITE:/ 'Hello'.
My question is, how to get the notification when the BGRFC tasks are finished.
Thanks
2021 Jan 12 6:58 PM
It's not intended to work like that, it executes asynchronously. Add the last processing in a function module at the end of the queue (function modules are processed sequentially in qRFC).
2021 Jan 13 6:22 AM
But I am using tRFC.
DATA(lo_trcf)= lo_inbound->create_trfc_unit().
Does it will execute sequentially?
When I going to change the code like:
DATA(lo_inbound1) = cl_bgrfc_destination_inbound=>create( dest_name = 'YCAS1' ).
DATA(lo_trcf1) = lo_inbound->create_trfc_unit( ).
DATA(lo_inbound2) = cl_bgrfc_destination_inbound=>create( dest_name = 'YCAS2' ).
DATA(lo_trcf2) = lo_inbound->create_trfc_unit( ).
DATA(lo_inbound3) = cl_bgrfc_destination_inbound=>create( dest_name = 'YCAS3' ).
DATA(lo_trcf3) = lo_inbound->create_trfc_unit( ).
CALL FUNCTION 'ZAMAR_BG_PROCESS' IN BACKGROUND UNIT lo_trcf1
EXPORTING
iv_num = 1000000.
CALL FUNCTION 'ZAMAR_BG_PROCESS' IN BACKGROUND UNIT lo_trcf2
EXPORTING
iv_num = 2000000.
CALL FUNCTION 'ZAMAR_BG_PROCESS' IN BACKGROUND UNIT lo_trcf3
EXPORTING
iv_num = 2000000.
Will it run in parallel? If yes, how to get the notification, when all are finished.
Thanks