SlideShare una empresa de Scribd logo
1 de 7
Implementing Parallel Processing in ABAP
Noman Hanif
Most of the time when dealing with huge amount of data, the run time / execution time of a
program should be within the specified time limit. To overcome this, SAP has provided a
wonderful tool called “Parallel processing”.
My attempt to provide an example for parallel processing.
Requirement:
Get the list of Contracts (New, Terminated and Active as on date) for a given period and retrieve the
additional information using parallel processing.
Solution:
Requirement is seems to be simple. But, yes scanning CRMD_ORDERADM_H for all the contracts
and retrieving the additional data (Partner, Product, Customer etc..) for each contract is not an easy
and quick task.
Parallel processing has been introduced to complete the report within the specified time.
Selection Screen:
Parallel processing code:
1. Do the Initial selection of contracts based on the Period.
2. Call the FM ‘SPBT_INITIALIZE’ to know the Maximum work process and free work process
by passing the server group name (parallel_generators)
3. Note: For server group details, the number of maximum work process you can use under this
group are best answered by your BASIS team. In practice, BASIS will provide a dedicated
application sever group for parallel processing.
4. Based on the selection screen entry (number of records per call), move these many records
into an internal table for parallel processing.
5. If you want to track the number of records processed, use below statements to see the job
log while the program is running.
6. CONCATENATE ‘Total Records to be processed are’ lv_gtot INTO lv_string.
MESSAGE lv_string TYPE ‘I’.
7. Here lv_gtot is the number of lines of the internal table which is passed to parallel processing
FM
8. Retrieve the resources info by calling FM ‘SPBT_GET_CURR_RESOURCE_INFO‘ and
check against the selection screen entry “Maximum no of work process to be used”.
9. If the available work process is greater than specified, and the running work process are
within the max limit, call the RFC Function module in Asynchronous mode. If not wait for the
free work process and try again.
10. When the RFC is called, please check the returned sy-subrc value. If it is initial, count the
number of submitted RFC.
11. Continue the submission of Asynchronous RFC till all the records are processed.
12. The RFC is executed in the next available work process in the said server group and the
results are captured under “Call back routine” ON END OF TASK.
13. In the receiving routine count the number of RFC received.
14. As this is asynchronous calls, we need to wait until the number of sent calls and received
should be equal.
Code snippet:
Perform f_init_server_group screen shot attached at the top of the page.
Here in below, we are calling the RFC Function module which does the actual work. It retries the
all the requested information for the passed chunk of data.
Once the FM is executed fully, then the call back routine “f_call_back*” is called.
In the below call back routine, we will capture the processed records with all the information.
The final internal table gt_*_in2 will holds the all the information.
If any data base update is required, then it should be done in the RFC itself.
For tracking of the records processed, use “MESSAGE” statement where ever required. And last
but not least, don’t forget to wait till the sent RFC calls should be equal to received RFC Calls.

Más contenido relacionado

La actualidad más candente

Ooabap notes with_programs
Ooabap notes with_programsOoabap notes with_programs
Ooabap notes with_programs
Kranthi Kumar
 
62620940 charm-configuration-procedures
62620940 charm-configuration-procedures62620940 charm-configuration-procedures
62620940 charm-configuration-procedures
narendar99
 
Step by Step guide for creating first ABAP report in SAP
Step by Step guide for creating first ABAP report in SAPStep by Step guide for creating first ABAP report in SAP
Step by Step guide for creating first ABAP report in SAP
nityaabap
 

La actualidad más candente (20)

Ooabap notes with_programs
Ooabap notes with_programsOoabap notes with_programs
Ooabap notes with_programs
 
Sap basis made easy
Sap basis made easySap basis made easy
Sap basis made easy
 
Module pool programming
Module pool programmingModule pool programming
Module pool programming
 
Introduction to ABAP
Introduction to ABAPIntroduction to ABAP
Introduction to ABAP
 
62620940 charm-configuration-procedures
62620940 charm-configuration-procedures62620940 charm-configuration-procedures
62620940 charm-configuration-procedures
 
SAP Basis Training Material | www.sapdocs.info
SAP Basis Training Material | www.sapdocs.infoSAP Basis Training Material | www.sapdocs.info
SAP Basis Training Material | www.sapdocs.info
 
Ab1011 module pool programming
Ab1011   module pool programmingAb1011   module pool programming
Ab1011 module pool programming
 
Object oriented approach to ALV Lists in ABAP
Object oriented approach to ALV Lists in ABAPObject oriented approach to ALV Lists in ABAP
Object oriented approach to ALV Lists in ABAP
 
Sap abap material
Sap abap materialSap abap material
Sap abap material
 
SAP Overview and Architecture
SAP Overview and ArchitectureSAP Overview and Architecture
SAP Overview and Architecture
 
Step by Step guide for creating first ABAP report in SAP
Step by Step guide for creating first ABAP report in SAPStep by Step guide for creating first ABAP report in SAP
Step by Step guide for creating first ABAP report in SAP
 
Sap abap tutorials
Sap abap tutorialsSap abap tutorials
Sap abap tutorials
 
Sap scripts
Sap scriptsSap scripts
Sap scripts
 
Exclusive SAP Basis Training Book | www.sapdocs.info
Exclusive SAP Basis Training Book | www.sapdocs.infoExclusive SAP Basis Training Book | www.sapdocs.info
Exclusive SAP Basis Training Book | www.sapdocs.info
 
500+ SAP ABAP INTERVIEW QUESTIONS WITH ANSWERS
500+ SAP ABAP INTERVIEW QUESTIONS WITH ANSWERS500+ SAP ABAP INTERVIEW QUESTIONS WITH ANSWERS
500+ SAP ABAP INTERVIEW QUESTIONS WITH ANSWERS
 
Sap Abap Reports
Sap Abap ReportsSap Abap Reports
Sap Abap Reports
 
SAP Overview
SAP Overview SAP Overview
SAP Overview
 
Table maintenance generator and its modifications
Table maintenance generator and its modificationsTable maintenance generator and its modifications
Table maintenance generator and its modifications
 
Sap User Exit for Functional Consultant
Sap User Exit for Functional ConsultantSap User Exit for Functional Consultant
Sap User Exit for Functional Consultant
 
Sap basis certification and interview questions answers
Sap basis certification and interview questions answersSap basis certification and interview questions answers
Sap basis certification and interview questions answers
 

Similar a Implementing parallel processing in abap

Lte kp is calculation
Lte kp is calculationLte kp is calculation
Lte kp is calculation
Klajdi Husi
 
Tutorial on Parallel Computing and Message Passing Model - C2
Tutorial on Parallel Computing and Message Passing Model - C2Tutorial on Parallel Computing and Message Passing Model - C2
Tutorial on Parallel Computing and Message Passing Model - C2
Marcirio Chaves
 
Unit 1
Unit 1Unit 1
Unit 1
siddr
 
Complete reference to_abap_basics
Complete reference to_abap_basicsComplete reference to_abap_basics
Complete reference to_abap_basics
Abhishek Dixit
 
Write a program in C or C++ which simulates CPU scheduling in an opera.pdf
Write a program in C or C++ which simulates CPU scheduling in an opera.pdfWrite a program in C or C++ which simulates CPU scheduling in an opera.pdf
Write a program in C or C++ which simulates CPU scheduling in an opera.pdf
sravi07
 

Similar a Implementing parallel processing in abap (20)

St22 abap programming
St22 abap programming St22 abap programming
St22 abap programming
 
programming errors
programming errorsprogramming errors
programming errors
 
Sap basis made_easy321761331053730
Sap basis made_easy321761331053730Sap basis made_easy321761331053730
Sap basis made_easy321761331053730
 
Lte kp is calculation
Lte kp is calculationLte kp is calculation
Lte kp is calculation
 
Tutorial on Parallel Computing and Message Passing Model - C2
Tutorial on Parallel Computing and Message Passing Model - C2Tutorial on Parallel Computing and Message Passing Model - C2
Tutorial on Parallel Computing and Message Passing Model - C2
 
Graphing Nagios services with pnp4nagios
Graphing Nagios services with pnp4nagiosGraphing Nagios services with pnp4nagios
Graphing Nagios services with pnp4nagios
 
Bdc
BdcBdc
Bdc
 
IRJET- Hadoop based Frequent Closed Item-Sets for Association Rules form ...
IRJET-  	  Hadoop based Frequent Closed Item-Sets for Association Rules form ...IRJET-  	  Hadoop based Frequent Closed Item-Sets for Association Rules form ...
IRJET- Hadoop based Frequent Closed Item-Sets for Association Rules form ...
 
Unit 1
Unit 1Unit 1
Unit 1
 
Sap fico fa qs(1)
Sap fico fa qs(1)Sap fico fa qs(1)
Sap fico fa qs(1)
 
Sap fico fa qs
Sap fico fa qsSap fico fa qs
Sap fico fa qs
 
OpenPOWER Application Optimization
OpenPOWER Application Optimization OpenPOWER Application Optimization
OpenPOWER Application Optimization
 
Sap abap training Overview
Sap abap training OverviewSap abap training Overview
Sap abap training Overview
 
AIX Advanced Administration Knowledge Share
AIX Advanced Administration Knowledge ShareAIX Advanced Administration Knowledge Share
AIX Advanced Administration Knowledge Share
 
Complete reference to_abap_basics
Complete reference to_abap_basicsComplete reference to_abap_basics
Complete reference to_abap_basics
 
3 modularisation and bdc
3 modularisation and bdc3 modularisation and bdc
3 modularisation and bdc
 
Oracle apps scm online training
Oracle apps scm online trainingOracle apps scm online training
Oracle apps scm online training
 
Sap security online training
Sap security online trainingSap security online training
Sap security online training
 
Write a program in C or C++ which simulates CPU scheduling in an opera.pdf
Write a program in C or C++ which simulates CPU scheduling in an opera.pdfWrite a program in C or C++ which simulates CPU scheduling in an opera.pdf
Write a program in C or C++ which simulates CPU scheduling in an opera.pdf
 
How to pinpoint and fix sources of performance problems in your SAP BusinessO...
How to pinpoint and fix sources of performance problems in your SAP BusinessO...How to pinpoint and fix sources of performance problems in your SAP BusinessO...
How to pinpoint and fix sources of performance problems in your SAP BusinessO...
 

Último

Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 

Último (20)

CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUKSpring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 

Implementing parallel processing in abap

  • 1. Implementing Parallel Processing in ABAP Noman Hanif
  • 2. Most of the time when dealing with huge amount of data, the run time / execution time of a program should be within the specified time limit. To overcome this, SAP has provided a wonderful tool called “Parallel processing”. My attempt to provide an example for parallel processing. Requirement: Get the list of Contracts (New, Terminated and Active as on date) for a given period and retrieve the additional information using parallel processing. Solution: Requirement is seems to be simple. But, yes scanning CRMD_ORDERADM_H for all the contracts and retrieving the additional data (Partner, Product, Customer etc..) for each contract is not an easy and quick task. Parallel processing has been introduced to complete the report within the specified time. Selection Screen: Parallel processing code: 1. Do the Initial selection of contracts based on the Period. 2. Call the FM ‘SPBT_INITIALIZE’ to know the Maximum work process and free work process by passing the server group name (parallel_generators)
  • 3. 3. Note: For server group details, the number of maximum work process you can use under this group are best answered by your BASIS team. In practice, BASIS will provide a dedicated application sever group for parallel processing. 4. Based on the selection screen entry (number of records per call), move these many records into an internal table for parallel processing. 5. If you want to track the number of records processed, use below statements to see the job log while the program is running. 6. CONCATENATE ‘Total Records to be processed are’ lv_gtot INTO lv_string. MESSAGE lv_string TYPE ‘I’. 7. Here lv_gtot is the number of lines of the internal table which is passed to parallel processing FM 8. Retrieve the resources info by calling FM ‘SPBT_GET_CURR_RESOURCE_INFO‘ and check against the selection screen entry “Maximum no of work process to be used”. 9. If the available work process is greater than specified, and the running work process are within the max limit, call the RFC Function module in Asynchronous mode. If not wait for the free work process and try again.
  • 4. 10. When the RFC is called, please check the returned sy-subrc value. If it is initial, count the number of submitted RFC. 11. Continue the submission of Asynchronous RFC till all the records are processed. 12. The RFC is executed in the next available work process in the said server group and the results are captured under “Call back routine” ON END OF TASK. 13. In the receiving routine count the number of RFC received. 14. As this is asynchronous calls, we need to wait until the number of sent calls and received should be equal. Code snippet:
  • 5. Perform f_init_server_group screen shot attached at the top of the page. Here in below, we are calling the RFC Function module which does the actual work. It retries the all the requested information for the passed chunk of data. Once the FM is executed fully, then the call back routine “f_call_back*” is called.
  • 6. In the below call back routine, we will capture the processed records with all the information.
  • 7. The final internal table gt_*_in2 will holds the all the information. If any data base update is required, then it should be done in the RFC itself. For tracking of the records processed, use “MESSAGE” statement where ever required. And last but not least, don’t forget to wait till the sent RFC calls should be equal to received RFC Calls.