How to run Background Job by Raising an Event in SAP ABAP
How to run Background Job by Raising an Event in SAP ABAP
Here as a senior ABAP Consultant ,you have to learn creating event ,with the help of it ,you should run background job ,let us start Scheduling background job by triggering an event.
In addition to time- and calendar-based job scheduling, the background processing system supports event-driven scheduling. The image below illustrates how background processing events can be used and processed.
Event Types
There are two types of events:
● System events: Defined by SAP and triggered automatically by system changes, such as the activation of a new operation mode. You cannot modify system events.
● User events: Defined by users. These events must be triggered from ABAP or from external programs. For example, use an external program to trigger a background processing user event to signal the arrival of external data to be read into the SAP System.
Event Arguments
An event argument is an optional text string you can use to qualify an event. Event-based jobs can be scheduled to start not only after a specific event, but also after an event qualified by specific event parameter.
You can specify an event argument when:
● Scheduling a job to wait for the event
● Triggering an event
Unlike event IDs, event arguments are not defined in the SAP System.
If you specify an argument when you schedule a job, then the job is eligible to start only when the event is triggered with the argument.
If you don’t specify an argument when you schedule a job, then the job can start as soon as the event occurs. The job is eligible to start no matter what argument string is supplied with the event.
Steps to create an Event
Step1. To create an event go to Tx- SM62
Step2. Select the 4th tab and to create an event click on the Create button.
Step3. Provide the details and continue to Save.
Step4. The event is successfully created.
Step5. Create a program to raise an event by calling the Function module.
Step6. Here we have a report program.
Step7. Go to Tx- SM36 and create a job.
Step8. Provide the job step- i.e the report that will run when job will be executed. Save.
Step9. Go Back.
Step10. Select the Job Start Condition.
Step11. Click on the after Event button.
Step12. The below screen appears.
Step13. Provide the job name and check->Save.
Step14. Click on the Job Selection button.
Step15. Click on Execute button.
Step16. The below message shown when job is executed.
Step17. Executed the program to raise the event.
Step18. We have the report output.
Step19. Now Execute the job.
Step20. We have the job output. To see the spool click on the spool icon.
Step21. Click on the output type.
Step22. Here we have the job report output.
Advanced Business Application Programming for ABAP Stands
What is the scope of SAP - ABAP in India
Comments
Post a Comment