Application Development and Automation 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: 
Read only

create an event for background processing

Former Member
0 Likes
13,852

How to trigger a job in background ,while new contracts are created. I have created a program to sent contract details by email. I want to trigger the program after any new contract is created in the system.Is it possible to create an event in sm62 for this purpose?

8 REPLIES 8
Read only

Former Member
0 Likes
5,865

Hi

The transaction SM62 is used to create a user event, i.e the evet user creates and trigers himself. If this is the case, u can try this. Or else try to schdule it in SM 36.

Regards

Gaurav

Read only

0 Likes
5,865

i will be scheduling in SM36 only.But i want the start condition as after creation of a new contract. how can i specify the 'After event' start condition for this

Read only

Former Member
0 Likes
5,865

Hi Misha,

there are two ways to create an event driven job.

1. In the program where you are generating success message, after that call function module BP_RAISE_EVENT.

you can get more detail on this function module by going to the below link :

http://help.sap.com/saphelp_sm32/helpdata/EN/fa/096e5e543b11d1898e0000e8322d00/content.htm

eg: you can Create a Event in the SM62

but you need to raise this event in a program using the function BP_RAISE_EVENT

The following example may help:

eventid = 'ZSUCCESS.(name of the event)

eventparm = 'SUCCESS'.(identification of the event)

FORM RAISE_EVNT.

CALL FUNCTION 'BP_EVENT_RAISE'

EXPORTING

EVENTID = EVENTID

EVENTPARM = EVENTPARM

TARGET_INSTANCE = ' '

EXCEPTIONS

BAD_EVENTID = 1.

ENDFORM. " RAISE_EVNT

Once an event is created, you can schedule

background jobs to wait for the event to be triggered.

1. Now you can directly go to sm36 ans there after creation of jobs you can specify the condition over there.

May be the above solution will be helpful to you.

Sourabh Batwara

Read only

0 Likes
5,865

thx for your reply Sourabh,

But my doubt is how will i recognize ,one new contract is created or not?

Read only

0 Likes
5,865

Hi,

When you create the user contact ther should be table which will be updated. Check if the table is updated with a new contact then call the FM to raise the event.

Regards,

Aditya

Read only

0 Likes
5,865

thx for your reply Sourabh,

But my doubt is how will i recognize ,one new contract is created or not?

Read only

0 Likes
5,865

thx for your reply Sourabh,

But my doubt is how will i recognize ,one new contract is created or not?

Read only

0 Likes
5,865

hi Mishi,

you must be passing some success message after creation of a contract and if not then do some debugging and find out the place where your program is creating the contract. there you can use the piece of code written in my last post.

Regards,

Sourabh Batwara