Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Problem with event raising code

Former Member
0 Kudos

Hai, I have the following code for raising an event after completion of a job. But the problem is the vent is not getting raised. can somebody recrtify the defect int his program?

Thank you.

REPORT Z_EVENT_RAISER.

selection-screen begin of block parametri with frame.

parameters:

EVENT like BTCH1250-EVENTID obligatory,

PARAM like BTCH1250-PARAMETER.

selection-screen skip.

selection-screen end of block parametri.

CALL FUNCTION 'BP_EVENT_RAISE'

EXPORTING

eventid = EVENT

EVENTPARM = PARAM

  • TARGET_INSTANCE = ' '

  • EXCEPTIONS

  • BAD_EVENTID = 1

  • EVENTID_DOES_NOT_EXIST = 2

  • EVENTID_MISSING = 3

  • RAISE_FAILED = 4

  • OTHERS = 5

.

IF sy-subrc <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

Thank you.

2 REPLIES 2

Former Member
0 Kudos

Hi

Just try with transaction SM64 . Its one and the same the code you have given.

Do you have the event defined in your system ??

Cheers

Former Member
0 Kudos

You can check if the event that you are passing to FM 'BP_EVENT_RAISE' exists or not from transaction SM62.

If it is not there you create the same in Transaction SM62.

Then you can test the FM 'BP_EVENT_RAISE' in SM37 to see if the event is raised.

Now you can attach this event to a background job in SM36. Put in the job name - fill in the ABAP/4 program you’ll want executed, but under "START DATE" select option AFTER EVENT. Then plug in your SAP event name you created. Fill in the remaining information on this screen and save.

The events raised here in 'BP_EVENT_RAISE' are dirent from workflow events.