06-24-2010 8:42 AM
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
06-24-2010 8:59 AM
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.
06-24-2010 8:55 AM
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
06-24-2010 8:59 AM
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.
06-24-2010 9:07 AM
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
06-24-2010 9:56 AM
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.