XBP - stands for External Interface for Background Processing. It is used to enable external entity/system to schedule, start and monitor jobs inside SAP. In XBP, we have many RFC enabled function modules (provided by SAP) which can help external systems to control various background activities in job (like create, modify, delete, start, terminate, monitor etc. inside SAP).
Business Scenario
Many customers use both SAP and non-SAP system to perform different activities. There will be different background jobs scheduled in Non-SAP systems and SAP systems (as per the business needs).
There will be a case that - if one of the background jobs in non-SAP system is finished successfully then only the job in SAP should be started.
Normally if there is a job dependency, it can be handled only in that particular system and there is no way to handle the job dependency between the cross systems.
For such scenario (as explained in above bullet points) XBP is the solution inside SAP to overcome this issue.
In our sample scenario, middleware takes the control of scheduling and monitoring the job inside SAP, once the job in non-SAP system is finished.
Solution Approach
1. Schedule a sample background job with all the required steps in SAP. This is a sample job which the middleware will use every time to create a new job and schedule it.
Job name: SEV1_JOB_MONI
Job number: 17132000
External RC username: RFCUSER
2. The external system, in our case, the middleware should call the RFC ‘BAPI_XBP_JOB_COPY’ with the below input parameters to create a new job inside SAP. This RFC will return a new job number (05463500) in the parameter ‘TARGET_JOBCOUNT’, if the job is created successfully.
3. To fire the new job, the middleware should call the RFC ‘BAPI_XBP_JOB_START_IMMEDIATELY’ with the new job name, job number and RFC username. There is a return parameter from the BAPI to check the log. This RFC will make the job active and running.
4. The RFC ‘BAPI_XBP_JOB_STATUS_GET’ can be used to know the relevant job status by accepting the Job name, Job id and RFC username as input.