Parallel Processing : when a huge number of records needs to be processed and it takes a lot of time to produce the output, this parallel processing technique can be applied to achieve run time improvement. So this Parallel processing is an asynchronous call to the Function Module in parallel sessions/ different session/ multiple sessions.
--------------------------------------------------------------------------------------------------------------------------
Step1. Create the below report and execute it.
REPORT zparallel_processing.
DATA: chk1, chk2.
DATA: stat1 TYPE TABLE OF bapisdstat,
stat2 TYPE TABLE OF bapisdstat,
stat TYPE bapisdstat.
PARAMETERS: p_sdoc1 TYPE bapivbeln-vbeln,
p_sdoc2 TYPE bapivbeln-vbeln.
START-OF-SELECTION.
CALL FUNCTION 'BAPI_SALESORDER_GETSTATUS'
STARTING NEW TASK 'TASK1'
DESTINATION 'NONE'
PERFORMING call1 ON END OF TASK
EXPORTING
salesdocument = p_sdoc1.
CALL FUNCTION 'BAPI_SALESORDER_GETSTATUS'
STARTING NEW TASK 'TAKS2'
DESTINATION 'NONE'
PERFORMING call2 ON END OF TASK
EXPORTING
salesdocument = p_sdoc2.
* Receive all asynchronous replies from the FMs
* Without wait statement the subroutines: call1 / call2 will not be triggered
* Either a logical wait condition or a wait condition with soem time
* able to trigger the Subroutines call1/ call2.
WAIT UNTIL chk1 = abap_true
AND chk2 = abap_true.
* wait UP TO 10 SECONDS.
LOOP AT stat1 INTO stat.
WRITE :/ stat-doc_number , stat-material, stat-net_price.
ENDLOOP.
CLEAR stat.
LOOP AT stat2 INTO stat.
WRITE :/ stat-doc_number , stat-material, stat-net_price.
ENDLOOP.
*&---------------------------------------------------------------------*
*& Form call1
*&---------------------------------------------------------------------*
FORM call1 USING taskname.
RECEIVE RESULTS FROM FUNCTION 'BAPI_SALESORDER_GETSTATUS'
TABLES
statusinfo = stat1.
chk1 = abap_true.
ENDFORM.
*&---------------------------------------------------------------------*
*& Form call2
*&---------------------------------------------------------------------*
FORM call2 USING taskname.
RECEIVE RESULTS FROM FUNCTION 'BAPI_SALESORDER_GETSTATUS'
TABLES
statusinfo = stat2.
chk2 = abap_true.
ENDFORM.
--------------------------------------------------------------------------------------------------------------------------
Step1.1 - If you want to debug it then put a breakpoint and execute it.
Step2. Provide the input as sale orders and execute it.
Step3. Press F5 button twice and the FM will open in two different external sessions.
Step4. In SM50 tcode also we can can found the program and the FMs are in debugging mode.
Step5. At last we observe this output.
-------------------------------------------------------------------------------------------------------------------------
Step3.
--------------------------------------------------------------------------------------------------------------------------
Step1. Create the below report and execute it.
REPORT zparallel_processing.
DATA: chk1, chk2.
DATA: stat1 TYPE TABLE OF bapisdstat,
stat2 TYPE TABLE OF bapisdstat,
stat TYPE bapisdstat.
PARAMETERS: p_sdoc1 TYPE bapivbeln-vbeln,
p_sdoc2 TYPE bapivbeln-vbeln.
START-OF-SELECTION.
CALL FUNCTION 'BAPI_SALESORDER_GETSTATUS'
STARTING NEW TASK 'TASK1'
DESTINATION 'NONE'
PERFORMING call1 ON END OF TASK
EXPORTING
salesdocument = p_sdoc1.
CALL FUNCTION 'BAPI_SALESORDER_GETSTATUS'
STARTING NEW TASK 'TAKS2'
DESTINATION 'NONE'
PERFORMING call2 ON END OF TASK
EXPORTING
salesdocument = p_sdoc2.
* Receive all asynchronous replies from the FMs
* Without wait statement the subroutines: call1 / call2 will not be triggered
* Either a logical wait condition or a wait condition with soem time
* able to trigger the Subroutines call1/ call2.
WAIT UNTIL chk1 = abap_true
AND chk2 = abap_true.
* wait UP TO 10 SECONDS.
LOOP AT stat1 INTO stat.
WRITE :/ stat-doc_number , stat-material, stat-net_price.
ENDLOOP.
CLEAR stat.
LOOP AT stat2 INTO stat.
WRITE :/ stat-doc_number , stat-material, stat-net_price.
ENDLOOP.
*&---------------------------------------------------------------------*
*& Form call1
*&---------------------------------------------------------------------*
FORM call1 USING taskname.
RECEIVE RESULTS FROM FUNCTION 'BAPI_SALESORDER_GETSTATUS'
TABLES
statusinfo = stat1.
chk1 = abap_true.
ENDFORM.
*&---------------------------------------------------------------------*
*& Form call2
*&---------------------------------------------------------------------*
FORM call2 USING taskname.
RECEIVE RESULTS FROM FUNCTION 'BAPI_SALESORDER_GETSTATUS'
TABLES
statusinfo = stat2.
chk2 = abap_true.
ENDFORM.
--------------------------------------------------------------------------------------------------------------------------
Step1.1 - If you want to debug it then put a breakpoint and execute it.
Step2. Provide the input as sale orders and execute it.
Step3. Press F5 button twice and the FM will open in two different external sessions.
Step4. In SM50 tcode also we can can found the program and the FMs are in debugging mode.
Step5. At last we observe this output.
-------------------------------------------------------------------------------------------------------------------------
Step3.
2 comments:
the explanation of this topic you posted is very good. please upgrade the new technologies about this topic.
Selenium Training in Bangalore
Best Selenium Training Institute in Bangalore
Data Analytics Courses in Bangalore
Digital Marketing Courses in Bangalore
Python Training in Bangalore
Big Data Training in Bangalore
Hacking Course in Bangalore
Selenium Course in Bangalore
I would like to thank you so much for sharing with us and I have many ideas after visiting your post. Well done...
JMeter Training in Chennai
JMeter Certification
Linux Training in Chennai
Pega Training in Chennai
Primavera Training in Chennai
Unix Training in Chennai
Placement in Chennai
Tableau Training in Chennai
Oracle Training in Chennai
JMeter Training in T Nagar
JMeter Training in OMR
Post a Comment