2010 Apr 05 10:40 AM
Hi all,
How to use fm BP_EVENT_RAISE to raise an event to get some of the values from BADI and use it in program ?
Please explain me in detail.
Thanks,
Vinay.
2010 Apr 05 10:56 AM
Hi Vinay,
Follow the below steps to achieve the requirement:
Step1: Create event from transaction SM62.
Give event name and description and press save button
Step2: Create a program that triggers this event by calling the FM u2018BP_EVENT_RAISEu2019.
REPORT Z_Evnt_Trigger .
CALL FUNCTION 'BP_EVENT_RAISE'
EXPORTING
eventid = 'Z_TRIGGER_JOB'
EXCEPTIONS
BAD_EVENTID = 1
EVENTID_DOES_NOT_EXIST = 2
EVENTID_MISSING = 3
RAISE_FAILED = 4
OTHERS = 5
.
IF sy-subrc <> 0.
Write: 'Event failed to trigger'.
else.
Write: 'Event triggered'.
ENDIF.
Step3: Configure the background job from transaction SM36.
In the initial screen give job name and job class and press u201CStart conditionu201D button.
In the popup screen press u201CAfter eventu201D button and give the event name and then press save button.
Now go back to the initial screen and press u201CStepu201D button
Provide program and variant name and after providing all the values press save button.
In the initial screen press save button.
Step4: Now execute the program to trigger the event and as well check the background job.
Run transaction SM37
Check the status of job defined above
Now check the spool to see the generated list
Regards,
Soundarya.
Edited by: K.Soundarya Singh on Apr 5, 2010 11:59 AM
Edited by: K.Soundarya Singh on Apr 5, 2010 11:59 AM
2010 Apr 05 10:56 AM
Hi Vinay,
Follow the below steps to achieve the requirement:
Step1: Create event from transaction SM62.
Give event name and description and press save button
Step2: Create a program that triggers this event by calling the FM u2018BP_EVENT_RAISEu2019.
REPORT Z_Evnt_Trigger .
CALL FUNCTION 'BP_EVENT_RAISE'
EXPORTING
eventid = 'Z_TRIGGER_JOB'
EXCEPTIONS
BAD_EVENTID = 1
EVENTID_DOES_NOT_EXIST = 2
EVENTID_MISSING = 3
RAISE_FAILED = 4
OTHERS = 5
.
IF sy-subrc <> 0.
Write: 'Event failed to trigger'.
else.
Write: 'Event triggered'.
ENDIF.
Step3: Configure the background job from transaction SM36.
In the initial screen give job name and job class and press u201CStart conditionu201D button.
In the popup screen press u201CAfter eventu201D button and give the event name and then press save button.
Now go back to the initial screen and press u201CStepu201D button
Provide program and variant name and after providing all the values press save button.
In the initial screen press save button.
Step4: Now execute the program to trigger the event and as well check the background job.
Run transaction SM37
Check the status of job defined above
Now check the spool to see the generated list
Regards,
Soundarya.
Edited by: K.Soundarya Singh on Apr 5, 2010 11:59 AM
Edited by: K.Soundarya Singh on Apr 5, 2010 11:59 AM