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

schedule one program in BACKGROUND

Former Member
0 Likes
686

Hi Friends,

I am Developing one FM.There at end of the program i want to submit one program ie

RHINTE30 (Create Batch Input Folder for Infotype 0001).

It should schedule automatically. how can i do this coding.

Please help me.

regards,

Kumar.

5 REPLIES 5
Read only

Former Member
0 Likes
617

Hi,

Didyou try using the function modules

job_open

job_submit

job_close

SUBST_SCHEDULE_BATCHJOB

Read only

Former Member
0 Likes
617

Hi,

Check the sample code

&----


  • Form to open the job with the particular job name

----


FORM f_open_job USING v_jobname TYPE any.

CALL FUNCTION 'JOB_OPEN'

EXPORTING

jobname = v_jobname

IMPORTING

jobcount = v_jobcount

EXCEPTIONS

OTHERS = 8.

IF sy-subrc NE 0.

WRITE: /3 v_werks,

11 text-008, v_jobname.

ENDIF.

ENDFORM. " f_open_job

&----


*& Form f_submit_job

&----


  • Form to submit the program (ZACC0014_COST_COLLECTORS_BDC) as job

----


FORM f_submit_job.

v_prog = text-016.

SUBMIT (v_prog) WITH so_matnr IN r_matnr

WITH p_werks EQ v_werks

WITH p_date EQ p_date "CCT51576

WITH ck_trg EQ c_trg

TO SAP-SPOOL

SPOOL PARAMETERS v_params

WITHOUT SPOOL DYNPRO

USER sy-uname VIA JOB v_jobname NUMBER v_jobcount

AND RETURN.

IF sy-subrc > 4.

WRITE: /3 v_werks,

11 text-009, v_jobname.

ENDIF.

ENDFORM. " f_submit_job

&----


*& Form f_job_close

&----


  • Form to close the job

----


FORM f_job_close.

CALL FUNCTION 'JOB_CLOSE'

EXPORTING

jobcount = v_jobcount

jobname = v_jobname

strtimmed = 'X' "start immediately

EXCEPTIONS

cant_start_immediate = 1.

it will help u.

Read only

Former Member
0 Likes
617

Hi,

Changes in your program:

first inside your function module call RHINTE30 by submit statement.

then create a report program and call your FM , created above.

Background Job creation:

Create Background job In SM36 and monitor it in SM37.

for step by step details check:

[background job schduling |http://help.sap.com/saphelp_nw70/helpdata/en/c4/3a7f87505211d189550000e829fbbd/content.htm]

Regards,

Anirban

Read only

Former Member
0 Likes
617

Hi,

Use these function modules

job_open

job_submit

job_close

SUBST_SCHEDULE_BATCHJOB

Regards,

Jyothi CH.

Read only

Former Member
0 Likes
617

Hi,

if u want to submit the program in backgroung you ca use the following functional modules

1.job_open

2.job_submit

3.job_close

are u can go through the transactions like SM36 - job scheduling ,

SM37 - Job overview.

these r the two types we can schedule the program in back groung.

Regards,

Madhu