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: 

Submit a batch job from ABAP program

former_member586438
Participant
0 Kudos

Hi

My client's requirement is a selection screen so that user will select certain criteria.

Thereafter the program will select data from a table and dump it in a text file.

I got all this working ,but now the requirement is that after the selection was made by the user,the rest of the data extract and creating of text file must happen as a batch job .

How would I add this requirement ?

Many thanks

Gerhard

2 REPLIES 2

mithun_shetty4
Contributor

You can use the below code for submitting ur original program from the main program


* Open Job
CALL FUNCTION 'JOB_OPEN'
EXPORTING
jobname = jobname
IMPORTING
jobcount = w_jobcount.

SUBMIT <program> WITH <parameter1> = <ur parameter>
                                WITH<parameter1> = <ur parameter>
                                  ..
VIA JOB jobname NUMBER w_jobcount
USER <User Name>
AND RETURN.

* Schedule and close job.
CALL FUNCTION 'JOB_CLOSE'
EXPORTING
jobcount = w_jobcount
jobname = jobname
sdlstrtdt = sy-datum
sdlstrttm = sy-uzeit.


raymond_giuseppi
Active Contributor
0 Kudos

Look at my answer in (Also use search tool)

Regards,

Raymond