Ansicht
Dokumentation

CRM_FM_JOB_FWK - Set Up Job Framework Process

CRM_FM_JOB_FWK - Set Up Job Framework Process

rdisp/max_wprun_time - Maximum work process run time   BAL Application Log Documentation  
This documentation is copyright by SAP AG.
SAP E-Book

The job framework tool allows you to implement batch jobs. You can configure jobs with:

  • Parallel processing; reduces process time by doing several jobs at once.
  • Reprocess last items in error; reprocesses jobs that encountered errors the last time they were processed.

The job framework searches for jobs and then processes them. The job search must return a maximum three keys.

To create a new job you must:

Implement a Job Class to Perform Search and Process Objects

  1. Create a class that inherits from abstract class CL_CRM_FM_ACL_JOB.
  2. Implement the following two main methods:

This method searches for objects based on criteria and returns a table of keys. The object keys will be passed to the process method later on for processing.

This method processes the results of the search object. It receives the process parameters and the list of object keys from the search method.
Once the method finishes processing the objects, it logs individual fail or success message and object data. The framework logs the messages to the respective application logs.
The second returnable parameter is the list of object keys that failed during the process. These keys are stored in a database enabling you to reprocess the error objects on the next execution.
Other methods of abstract class can be overwritten or simply used as utility methods.

Define a Job Type

Define a job type in Customizing for Customer Relationship Management, by choosing Basic Functions -> Batch Processing Framework -> Define Job Type.

Create a Report for the Job

  1. Add the include CRM_FM_BFW_REPORT_INCL in the top of the report. This include is required by the batch processing framework.
  2. Add the parameters or selection criteria for the job.
  3. Process the job. You can do this after the start-of-selection statement.
    1. Get job processing instance
go_job_process = cl_crm_fm_acl_job_processing=>get_instance( ).
  1. Start job.
call method go_job_process->start_job exporting
iv_job_type = cl_crm_fm_acl_rep_cal_run=>gc_acl_run_job_type
iv_number_per_batch = p_numpb
iv_background = sy-batch
iv_parallel_processing = p_para
iv_process_errors_only = p_err
iv_update_error_db = gv_update_err.
where:
IV_JOB_TYPE is the job type defined in customizing. IV_NUMBER_PER_BATCH is the number of objects to process per batch.
IV_BACKGROUND indicates if the report is run in the background or not.
IV_PARALLEL_PROCESSING indicates if the job is run in parallel or not.
IV_UPDATE_ERROR_DB indicates if the error objects are updated in the database or not.
  1. Add parameters.
The following method allows you to add parameters or selection-options as the name-value for the job.
call method go_job_process->add_report_parameter exporting
iv_param_name = cl_crm_fm_acl_rep_cal_run=>gc_param_test_only
iv_param_value = p_test
iv_param_usage = if_crm_fm_acl_job_report_il=>gc_param_usage_process.
where:
IV_PARAM_NAME is the parameters name.
IV_PARAM_VALUE is the parameters value.
IV_PARAM_USAGE is the parameter usage.
The possible values are:
P: constant IF_CRM_FM_ACL_JOB_REPORT_IL=>GC_PARAM_USAGE_SEARCH
S: constant IF_CRM_FM_ACL_JOB_REPORT_IL=>GC_PARAM_USAGE_PROCESS
  1. Execute job
call method go_job_process->execute_job.
  1. End job
call method go_job_process->end_job.

For more information about the job processing method, refer to interface CL_CRM_FM_ACL_JOB_PROCESSING.

Job implementation class: CL_CRM_FM_ACL_REP_CAL_RUN.

Report: RCRM_FM_ACL_ACCRUAL_RUN.






Vendor Master (General Section)   Addresses (Business Address Services)  
This documentation is copyright by SAP AG.

Length: 6107 Date: 20240523 Time: 172617     sap01-206 ( 59 ms )