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

Submit Report running in loop

Former Member
0 Likes
1,849

My report name is yer00268

i use this logic

SUBMIT YER00268 TO SAP-SPOOL WITHOUT SPOOL DYNPRO

SPOOL PARAMETERS v_loc_mstr_print_parms

WITH SELECTION-TABLE i_int_seltab

AND RETURN.

but it go in loop.

I want to executed only once and skip,

How this can be done.

Pls. Replay

BR,

Ali

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,254

Hi,

There can be many ways of doing it:

One of them could be like this:-

Step 1. In your program create a new parameter on the selection screen. like this

PARAMETERS p_batch NO-DISPLAY.

This parameter will not be displayed on the screen.

Step 2. Put your SUBMIT statement in an IF block. Like this

IF p_batch IS INITIAL.

Here before calling submit you should set the Parameter p_batch to 'X' in the selection table.

SUBMIT YER00268 TO SAP-SPOOL WITHOUT SPOOL DYNPRO

SPOOL PARAMETERS v_loc_mstr_print_parms

WITH SELECTION-TABLE i_int_seltab

AND RETURN.

ENDIF.

This will work I am sure.

Regards,

Prakash Pandey

9 REPLIES 9
Read only

Former Member
0 Likes
1,255

Hi,

There can be many ways of doing it:

One of them could be like this:-

Step 1. In your program create a new parameter on the selection screen. like this

PARAMETERS p_batch NO-DISPLAY.

This parameter will not be displayed on the screen.

Step 2. Put your SUBMIT statement in an IF block. Like this

IF p_batch IS INITIAL.

Here before calling submit you should set the Parameter p_batch to 'X' in the selection table.

SUBMIT YER00268 TO SAP-SPOOL WITHOUT SPOOL DYNPRO

SPOOL PARAMETERS v_loc_mstr_print_parms

WITH SELECTION-TABLE i_int_seltab

AND RETURN.

ENDIF.

This will work I am sure.

Regards,

Prakash Pandey

Read only

0 Likes
1,254

hi Prakash Pandey

I am not using any selectio screen.

My code will be in FM

Read only

0 Likes
1,254

Hi,

I have just tested this and its working fine..... Please chek this out...

parameters :

p_cont type c no-display. " Continuation variable not

*displayed on the selection-screen.

if p_cont is initial.

SUBMIT YER00268 TO SAP-SPOOL WITHOUT SPOOL DYNPRO

SPOOL PARAMETERS v_loc_mstr_print_parms

WITH SELECTION-TABLE i_int_seltab

with p_cont EQ 'X'

AND RETURN.

endif.

Regards,

Siddarth

Read only

0 Likes
1,254

It is not wrong.

But i do not to execute the logic more than one.

Also, i will use the logic in side a FM.

and call that FM from Web Dynpro

Read only

0 Likes
1,254

Hi Ali,

If you are using an FM then use p_batch as an OPTIONA IMPORT parameter of the FM.

and rest all logic will remain same.

Regards,

Prakash Pandey

Read only

0 Likes
1,254

Alright,

in your function module write this query.

data w_cont type c.

Import w_cont to w_con from memory id CON.

if w_cont is inital.

w_cont = 'X'.

export w_cont to memory id CON.

SUBMIT YER00268 TO SAP-SPOOL WITHOUT SPOOL DYNPRO

SPOOL PARAMETERS v_loc_mstr_print_parms

WITH SELECTION-TABLE i_int_seltab

AND RETURN.

endif.

I think this should work and solve your problem

Regards,

Siddarth

Read only

0 Likes
1,254

Hi Siddharth Chordia

your answer is helpfull, but I ask me that the field CON is unkown.

Read only

0 Likes
1,254

H iAli,

I apologize for the mistake,

Please use the statements below, actually we should write CON within quotes 'CON'.

data w_cont type c.

Import w_cont to w_cont from memory id 'CON'.

if w_cont is inital.

w_cont = 'X'.

export w_cont to memory id 'CON'.

Read only

Former Member
0 Likes
1,254

hi.

for looping only once do just like this.

loop at ................
 do your work. 
 exit.  " Exit from loop.
endloop.