CL_HR99B_HRF_PARALLEL_JOBS - Class to create and split the parallel jobs

BAL_S_LOG - Application Log: Log header data   BAL_S_LOG - Application Log: Log header data  
This documentation is copyright by SAP AG.

Functionality

You use this class to manage a parallel execution step.

This class is part of the parallelization framework, which enables you to execute reports in parallel mode. SAP delivers two classes for this framework:

  • CL_HR99B_PARALLEL: manages a complete parallel execution. You cannot extend this class.
  • This class (CL_HR99B_HRF_PARALLEL_JOBS): manages a parallel execution step, by creating and splitting the parallel jobs. You can extend this class according to your needs.

For more information, see the Steps to Use the Paralellization Frameworksection below.

Note

Only SAP can enable a standardreport to be executed in parallel mode.

Methods

  • GET_MAINS_PARAMS
Returns the parameters to be used to the main task, in the parallel execution step.
  • DISPATCHER
Calls function module HR99B_PARALLEL_REPORT_RUN, which starts a new execution of the parallelized report and passes the parameters for this report.
  • COLLECT
Collects the results for all parallel tasks. It reads the stored data from the shared area and callsthe COLLECT_STANDARD_TABLE, COLLECT_SORTED_TABLE or COLLECT_HASHED_TABLE, depending on the table typewhere the final results will be saved. At the end, it calls the method FREE_PARALLEL_TASKS, which deletes the task name from the task table if this task is finished without errors.
  • RUN_PARALLEL
Starts the SPLIT_JOB_SHELL method to split parameters into slave tasks, according to the selected numberof jobs, and rebuilds the selection screen parameters of each one of them. Finally, it calls the DISPATCHER method for each parameter line in the parameters table, that is, for each task.
  • CONSTRUCTOR
Initializes some class parameters from selection-screen or T799BHRFPL table data and creates the shared memory area.
  • CREATE_SHARED_AREA
Creates the shared memory area to store all parallel tasks results, using the area name from the selection screen, or T799BHRFPL table data.
  • SYNC_PARALLEL_JOBS
Method used to wait until all parallel tasks are finished. The end of this method call means that the parallel results can be retrieved from the shared area.
  • SAVE_DATA_TO_SHARED_AREA
Method used to try to lock the shared memory to write the results using the method STORE_DATA. This method is static once it is called by all parallel tasks that do not have an instance of this class.
  • SPLIT_JOB
Calls method SPLIT_PNP. It can be overwritten to split the initial parameters using a different algorithm. In case of non-PNP report, it is needed to create a specific split method.
  • SPLIT_PNP
Divides the initial parameters into the number of parallel tasks customized on the selection screen, or in table T799BHRFPL. This method splits PNP parameters considering only the PERNR field.
  • STORE_DATA
Static method used to save the results of a parallel task into the shared area. It saves any kind of data, using the type of parameter P_DATA.
  • SPLIT_JOB_SHELL
Method used to call the SPLIT_JOB method, and mount a table with all necessary parameters to be passed to the parallel tasks.
  • COLLECT_STANDARD_TABLE
Inserts data into a standard table type.
  • COLLECT_SORTED_TABLE
Inserts data into a sorted table type.
  • COLLECT_HASHED_TABLE
Inserts data into a hashed table type.
  • GET_NEXT_FREE_TASK_NAME
Gets a unique task name, using a persistence class.
  • FREE_PARALLEL_TASKS
Deletes the task name from the task table.
  • IS_MAIN_TASK
Returns task name of main task.

Steps to Use the Parallelization Framework


To be able to use the parallelization framework delivered by SAP, you must execute the steps described below:

  1. Make the necessary adjustments to the parallel class as follows:
  • If your report does not use PNP logical database, you need to create a subclass from class CL_HR99B_HRF_PARALLEL_JOBS and overwrite the method SPLIT_JOB.

  • Check the collect methods from class CL_HR99B_HRF_PARALLEL_JOBS. If in your case you want to collectdata differently of what is implemented, then you will need to create a subclass from class CL_HR99B_HRF_PARALLEL_JOBSand overwrite the method COLLECT_* (depending to the table type that you will use to store the results).

  1. Enter the following code in your report:
  • TABLES: pernr. (If it is not yet included)

  • SELECT-OPTIONS: pnppernr FOR pernr-pernr NO-DISPLAY,
    pnpindex FOR pernr-pernr NO-DISPLAY. (If it is not yet included)

  • INCLUDE RPCUEDIF_PARALLEL. "Forms Parallel Procesing

  • DATA: gv_run_parallel TYPE abap_bool VALUE abap_false.

In SELECTION-SCREEN parameters declaration:
parameters_parallel_processing '' ''.
In AT SELECTION-SCREEN command:
parallel_at_pai.
In AT SELECTION-SCREEN OUTPUT command:
parallel_at_pbo.
In START-OF-SELECTION command:
gv_run_parallel = gr_parallel->a_job.
In the part where you want to start the parallel run:
PERFORM start_of_parallel_process USING ''.
In the part where you want to finish the parallel run and collect the
results:
PERFORM end_of_parallel_process
USING '01'
CHANGING pt_uedirdata[] "is refreshed in main job
lt_results_all[]. "Summary of all jobs
  1. Customize table T799BHRFPL (view V_T799BHRFPL): You do so in Customizing for Reporting Parallelization underDefine Parallelization Framework. Execute this activityand create a new entry with the class that you will use and a name for the shared memory area that will be created.





Addresses (Business Address Services)   CPI1466 during Backup  
This documentation is copyright by SAP AG.


Length: 7280 Date: 20120526 Time: 155845     triton ( 187 ms )