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

Triggering a Background Program using an Event

Former Member
0 Likes
441

Hi All,

I have an urgent requirement where in I have to Submit a Program in Background, and trigger it using an event.

The following is the process followed,

Step 1,

  • CALL FUNCTION 'JOB_OPEN'

  • EXPORTING

  • jobname = jobname

  • IMPORTING

  • jobcount = gv_jobcount

Step 2,

Submit the Program in Background,

  • SUBMIT zf_ddi_activity_closure with

  • p_kunnr = i_kna1-kunnr

  • VIA JOB jobname

  • NUMBER gv_jobcount

  • AND RETURN.

Step 3,

Close Job,

  • CALL FUNCTION 'JOB_CLOSE'

  • EXPORTING

  • event_id = event_id

  • jobcount = gv_jobcount

  • jobname = jobname

Step 4,

Triggering the Event,

  • CALL FUNCTION 'BP_EVENT_RAISE'

  • EXPORTING

  • eventid = event_id

This proceedure is not working could anyone let me know of any other way.

Thanks in advance,

Vijay

2 REPLIES 2
Read only

Former Member
0 Likes
414

Hi Vijay

How about approching this way.

1. Define the event.

2. Define a JOB via SM36 with start condition as AFTER EVENT.

3. Raise the event accordingly.

Hope this will serve your purpose.

Kind Regards

Eswar

Read only

andreas_mann3
Active Contributor
0 Likes
414

Hi,

instead of your 4 steps try fm K_BATCH_REQUEST

(look documentation with se37 1st)

A.