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

Regarding Batch Processing

Former Member
0 Likes
1,144

Hi All,

I have a issue with batch processing.

The words in <b>FD</b> are as below:

<b>The program <b>REPORT2</b> will need to be modified to process in batch, which will require the <b>sy-batch</b> be checked and if this is a batch job then email the table data to specific users.</b>

What does the statement <b>REPORT2 will need to be modified to process in batch</b> meant for.

What i need to do to make it batch.

Once i make it batch i need to check <b>sy-batch</b> in program if it is <b>'X'</b> i will send email.

Also i am submitting above report <b>REPORT2</b> from <b>REPORT1</b> as below:

<b> SUBMIT REPORT2 VIA SELECTION-SCREEN

WITH SELECTION-TABLE RSPAR.</b>

While doing this i need to perform above task.

Can anybody give solution for the same!

Thanks in advance.

Thanks,

Deep.

10 REPLIES 10
Read only

Former Member
0 Likes
1,118

At the end of REPORT2, after you consolidate all your ouptut data in a internal table

IF SY-BATCH = 'X'.

The data you have in the internal table will have to sent as a mail.

ENDIF.

This needs to happen only when the report is running in the background and that is why you are checking the SY-BATCH variable. however, you need to get the information of which users the data has to be mailed and what are the mailing addresses.

You can use the function modules JOB_OPEN, JOB_SUBMIT and JOB_CLOSE to submit REPORT2 from REPORT1 in the background mode. You can track the background job in SM37

Regards,

Ravi

Note - Please mark all the helpful answers

Read only

aakash_neelaperumal2
Active Participant
0 Likes
1,118

ok deepa... this is what they mean... when the report is executed in the background obviously u wont be able to view the list or grid whatever...In that case when the report execution is over...I mean background..the spooled list or internal table needs to be send as a attachement or whay ever form to the user.

Read only

0 Likes
1,118

Hi,

While submitting REPORT2 from REPORT1 i am not using AND RETURN option in SUBMIT statement in that case. is it valid to use JOB_OPEN, JOB_SUBMIT, JOB_CLOSE as it will never come back to REPORT1!

Thanks for those replies.

Thanks,

Deep.

Read only

0 Likes
1,118

You can use JOB_OPEN, Submit statement, JOB_CLOSE or use JOB_SUBMIT in place SUBMIT statement, either way is fine.

Regards,

Ravi

Note - Please mark all the helpful answers and clsoe the thread if the issue is resolved.

Read only

0 Likes
1,118

Hi,

Though i am using JOB_OPEN Before SUBMIT statement Sy-BATCH is not becoming 'X' i am laso using JOB_CLOSE after SUBMIT.

Can anybody solve this issue!

Thanks for your replies.

Thanks,

Deep.

Read only

0 Likes
1,118

SY-BATCH will be X only when the program is getting executed in the background. That means it will be X only in REPORT2.

How are checking for the value of SY-BATCH?

Regards,

Ravi

<b>Note - Please mark all the helpful answers</b>

Read only

0 Likes
1,118

Hi,

When we use <b>JOB_OPEN</b> F.M will this SY-BATCH variable become 'X' directly (or) we need to chcek it by using any other F.M!

Thanks,

Deep.

Read only

0 Likes
1,118

Hi,

I am checking the value of SY-BATCH in REPORT2 only but here also SY-BATCH is blank.

Thanks,

Deep.

Read only

0 Likes
1,118

Hi,

Can anybody give me the solution for above posted issue!

Also i have one more issue.

Actually i am submitting <b>REPORT2</b> from <b>REPORT1</b> with selection-screen data of <b>REPORT2</b> along with <b>SUBMIT</b> statement as below:

<b> SUBMIT REPORT2 VIA SELECTION-SCREEN

WITH SELECTION-TABLE RSPAR.</b>

But here though selection-screen in<b> REPORT2</b> is getting updated with data we are sending from <b>REPORT1</b>, After Submit it is stopping at <b>REPOR2</b> selection-screen i have to execute from there once again though data is coming and updating all the fileds correctly.

Can anybody tell me how can i execute <b>REPORT2</b> without showing <b>sel-screen</b>!

Thanks in advance.

Thanks,

Deep.

Read only

0 Likes
1,118

Hi Deep,

Please change the SUBMIT statement as mentioned below to skip the selection screen

<b>SUBMIT REPORT2 WITH SELECTION-TABLE RSPAR.</b>,

i.e., u've to remove the <b>VIA SELECTION SCREEN</b> addition of the SUBMIT statement