Creating Alerts on the Basis of Status of the Background Jobs With the Help of ABAP Query

5
Creating Alerts on the basis of status of the Background Jobs with the help of ABAP Query By Gaurav Chawla, Infosys Introduction Many a times there is requirement such as user wants to know whether a background job was executed successfully or not. User wants to have updates or alerts or mails in case a scheduled job failed or aborted or executed successfully. For that purpose we can either write the entire code in ABAP or we can take help of ABAP Query. Writing a Code can be a cumbersome task as well as time consuming. With the help of ABAP Query our coding effort is saved and similar functionality can be achieved in very less time compared to writing an ABAP code. Steps to Generate Alerts 1. Create an ABAP Query With Help of SQ03 transaction create a user group Using Button “Assign users and InfoSets”, we can authorize users who can execute the ABAP Query.

description

Creating Alerts on the basis of status of the Background Jobs with the help of ABAP Query

Transcript of Creating Alerts on the Basis of Status of the Background Jobs With the Help of ABAP Query

Creating Alerts on the basis of status of the Background Jobs with the help of ABAP QueryBy Gaurav Chawla, InfosysIntroductionMany a times there is requirement such as user wants to know whether a background job was executed successfully or not. User wants to have updates or alerts or mails in case a scheduled job failed or aborted or executed successfully.For that purpose we can either write the entire code in ABAP or we can take help of ABAP Query. Writing a Code can be a cumbersome task as well as time consuming. With the help of ABAP Query our coding effort is saved and similar functionality can be achieved in very less time compared to writing an ABAP code.Steps to Generate Alerts1.Create an ABAP QueryWith Help of SQ03 transaction create a user groupUsing Button Assign users and InfoSets, we can authorize users who can execute the ABAP Query.

UsingSQ02transaction, Create InfoSet.To join two tables there is a button Insert table on next screen.

Click on InfoSet Maintenance button in application toolbar.A Pop Up is displayed. Click on Create Empty Field Groups radio button and press enter.Select a field group and insert fields into the field group by right click on fields and click on Add field to field group.

You can add other fields as well based upon what kind of output user wants.For example in this case we want to find out the jobs that are started by a particular person and the status of the job. So we added fields Initiator and State of background jobs in field groups.Generate Info SetUsing Role/User Group Assignment, assign the User Group ZABORT_UGRP created above to InfoSet and press Save.

Go to SQ01 transaction to create an ABAP Query.With the help of ABAP Query we can avoid coding and get the results based on the data entered on the selection screen.

You can select the output format. By click on Basic List button in application toolbar you can select the fields to be displayed in output and on Selection screen.