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: 

select option

Former Member
0 Kudos

Hi,

I have parameter in the program, like:

parameters:

mailto type ad_smtpadr default testXgmail.com' obligatory.

How to mantain the select option, that I can enter more than one email address?

Thx

BRS

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Try this.


DATA: v_email TYPE ad_smtpadr.

PARAMETERS: p_mailto TYPE ad_smtpadr DEFAULT 'testXgmail.com' OBLIGATORY.
SELECT-OPTIONS: s_mailto FOR v_email DEFAULT 'testXgmail.com' OBLIGATORY.
SELECT-OPTIONS: s_mail2 FOR v_email DEFAULT 'testXgmail.com' OBLIGATORY NO INTERVALS.

4 REPLIES 4

former_member193821
Active Participant
0 Kudos

Hi,

Use Select-options for your requirement.On the selection screen, just go to multiple selection button.

There you will find a tab SELECT SINGLE VALUES.

Give all your values there and execute your code.

Thanks and Regards,

P.Bharadwaj

Former Member
0 Kudos

Try this.


DATA: v_email TYPE ad_smtpadr.

PARAMETERS: p_mailto TYPE ad_smtpadr DEFAULT 'testXgmail.com' OBLIGATORY.
SELECT-OPTIONS: s_mailto FOR v_email DEFAULT 'testXgmail.com' OBLIGATORY.
SELECT-OPTIONS: s_mail2 FOR v_email DEFAULT 'testXgmail.com' OBLIGATORY NO INTERVALS.

Former Member
0 Kudos

i would like to have more then one receipient in the program BCS_EXAMPLE_8

any ample code please?

parameters:

mailto type ad_smtpadr default 'testXXXgmail.com' obligatory.

&----


*& Form send

&----


form send.

try.

  • -------- create persistent send request ------------------------

send_request = cl_bcs=>create_persistent( ).

  • -------- create and set document -------------------------------

pdf_content = cl_document_bcs=>xstring_to_solix( pdf_xstring ).

document = cl_document_bcs=>create_document(

i_type = 'PDF'

i_hex = pdf_content

i_length = pdf_size

i_subject = 'test created by BCS_EXAMPLE_8' ). "#EC NOTEXT

  • add document object to send request

send_request->set_document( document ).

  • --------- add recipient (e-mail address) -----------------------

  • create recipient object

recipient = cl_cam_address_bcs=>create_internet_address( mailto ).

  • add recipient object to send request

send_request->add_recipient( recipient ).

  • ---------- send document ---------------------------------------

sent_to_all = send_request->send( i_with_error_screen = 'X' ).

commit work.

if sent_to_all is initial.

message i500(sbcoms) with mailto.

else.

message s022(so).

endif.

  • ------------ exception handling ----------------------------------

  • replace this rudimentary exception handling with your own one !!!

catch cx_bcs into bcs_exception.

message i865(so) with bcs_exception->error_type.

endtry.

endform. "send

Former Member
0 Kudos

Hi,,,

Try out the below code to maintan multiple email id in select options.

data : s_list TYPE RANGE OF AD_SMTPADR WITH HEADER LINE.

append s_list.
TABLES : adr6.

SELECT-OPTIONS : s_mail for ADR6-SMTP_ADDR.

INITIALIZATION.
s_list-sign = 'I'.
s_list-option = 'EQ'.
s_list-low = 'abc@com'.
append s_list.
s_list-sign = 'I'.
s_list-option = 'EQ'.
s_list-low = 'XYZ@com'.
append s_list.
s_list-sign = 'I'.
s_list-option = 'EQ'.
s_list-low = 'LIT@com'.
append s_list.

S_mail[] = s_list[].

After that in stsrt-of-selection

you can loop in this table. and u can add multiple receptinist.

recipient = cl_cam_address_bcs=>create_internet_address( mailto ).

 send_request->add_recipient( recipient ).

thanks.