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 Statement

Former Member
0 Likes
533

Hi all,

i have to use submit statement and have to mail the user. We have own Z program to email.It have select option for s_email. i have to upload an excel file and mail the users about the details of report.i am able to send the output to one recipient but not to multiple users.the code looks like:

LOOP AT t_itab.

move: t_itab-s_email to s_mails.

SUBMIT zzemailreport VIA SELECTION-SCREEN

WITH p_send = 'X'

WITH p_prog = t_itab-p_prog

WITH p_var = t_itab-p_var

WITH p_subj = t_itab-p_subj

WITH s_email = s_mails

AND RETURN.

where s_mails is range(ranges:s_mails for SADRUD-ADDRESS.

)

An this is internal table:

DATA: BEGIN OF t_itab OCCURS 0,

p_prog(10) TYPE c, "Program Name

p_var(15) TYPE c, "Variant Name

p_subj(35) TYPE c, "Subject

s_email(65) TYPE c, "Email

s_email1(65) TYPE c, "Emailoptional

s_email2(65) TYPE c, "Emailoptional

s_email3(65) TYPE c, "Emailoptional

s_email4(65) TYPE c, "Emailoptional

END OF t_itab.

so can anyone pls suggest how can i send mail to multiple recipient.

thanks in advance

1 ACCEPTED SOLUTION
Read only

former_member221770
Contributor
0 Likes
503

Hi Anu,

Try this:


data: tbl_selections type table of rsparams with header line.

loop at t_itab.
clear tbl_selections.
tbl_selections-selname = 'S_EMAIL'.
tbl_selections-kind = 'S'.  "Selection Option
tbl-selections-sign = 'I'.
tbl_selections-option = 'EQ'.
tbl_selections-low = t_itab-email.
append tbl_selections.
endloop.

SUBMIT zzemailreport VIA SELECTION-SCREEN
WITH p_send = 'X'
WITH p_prog = t_itab-p_prog
WITH p_var = t_itab-p_var
WITH p_subj = t_itab-p_subj
WITH selection-table tbl_selections
and return.

Here is the blurb from SAP Help:

Modification 3

SUBMIT rep WITH SELECTION-TABLE seltab.

"The addition WITH SELECTION-TABLE seltab allows you to specify values passed via the WITH clause to report parameters or selection criteria in an internal table. Here, the table seltab has the structure of RSPARAMS. You can use the function module RS_REFRESH_FROM_SELECT_OPTIONS to fill the table with the contents of the current parameters or selection criteria (it replaces the key word REFRESH seltab FROM SELECT-OPTIONS). For further information, see the documentation on SUBMIT."

Cheers,

Pat.

PS. Kindly assign Reward Points tot he posts you find helpful.

Message was edited by: Patrick Yee

3 REPLIES 3
Read only

former_member221770
Contributor
0 Likes
504

Hi Anu,

Try this:


data: tbl_selections type table of rsparams with header line.

loop at t_itab.
clear tbl_selections.
tbl_selections-selname = 'S_EMAIL'.
tbl_selections-kind = 'S'.  "Selection Option
tbl-selections-sign = 'I'.
tbl_selections-option = 'EQ'.
tbl_selections-low = t_itab-email.
append tbl_selections.
endloop.

SUBMIT zzemailreport VIA SELECTION-SCREEN
WITH p_send = 'X'
WITH p_prog = t_itab-p_prog
WITH p_var = t_itab-p_var
WITH p_subj = t_itab-p_subj
WITH selection-table tbl_selections
and return.

Here is the blurb from SAP Help:

Modification 3

SUBMIT rep WITH SELECTION-TABLE seltab.

"The addition WITH SELECTION-TABLE seltab allows you to specify values passed via the WITH clause to report parameters or selection criteria in an internal table. Here, the table seltab has the structure of RSPARAMS. You can use the function module RS_REFRESH_FROM_SELECT_OPTIONS to fill the table with the contents of the current parameters or selection criteria (it replaces the key word REFRESH seltab FROM SELECT-OPTIONS). For further information, see the documentation on SUBMIT."

Cheers,

Pat.

PS. Kindly assign Reward Points tot he posts you find helpful.

Message was edited by: Patrick Yee

Read only

0 Likes
503

hello patrick

yur answer was osom...it was great help..thanks very much

Read only

andreas_mann3
Active Contributor
0 Likes
503

hi,

try:

SUBMIT zzemailreport VIA SELECTION-SCREEN

...

WITH s_email <b>in</b> s_mails

Andreas