on 01-20-2009 12:15 PM
Hi All,
How to send smartform output in an email without attachment?
Thanks & Regards,
Mamta Gupta.
Try this,
DATA:
ls_control_param TYPE ssfctrlop, "Control paramters
ls_output_options TYPE ssfcompop. "Output options
DATA:
lv_ip_mailaddr TYPE so_name, "Address of a Mail Recipient
lv_ip_type_id TYPE so_escape, "Recipient type
ls_recipient_id TYPE swotobjid, "Structure for recvr obj ID
ls_sender_id TYPE swotobjid. "Structure for sender obj id
CONSTANTS:
lc_ip_type_id TYPE so_escape VALUE 'U', "For internet address.
lc_smartform TYPE tdsfname VALUE 'ZVSF_ASN_DELNOTE', "Smart form name
lc_mail TYPE tddevice VALUE 'MAIL'. "Mail device
Assign recipient
lv_ip_mailaddr = gv_smtp_addr. "CSAM email id
lv_ip_type_id = lc_ip_type_id. "External address
Create Mail title
CONCATENATE text-001
nast-objky
INTO ls_output_options-tdtitle.
Create recipient object
CALL FUNCTION 'CREATE_RECIPIENT_OBJ_PPF'
EXPORTING
ip_mailaddr = lv_ip_mailaddr
ip_type_id = lv_ip_type_id
IMPORTING
ep_recipient_id = ls_recipient_id
EXCEPTIONS
invalid_recipient = 1
OTHERS = 2.
IF sy-subrc 0.
cf_retcode = sy-subrc.
PERFORM protocol_update.
ENDIF.
Get sender object id.
CALL FUNCTION 'CREATE_SENDER_OBJECT_PPF'
EXPORTING
ip_sender = sy-uname
IMPORTING
ep_sender_id = ls_sender_id
EXCEPTIONS
invalid_sender = 1
OTHERS = 2.
IF sy-subrc 0.
cf_retcode = sy-subrc.
PERFORM protocol_update.
ENDIF.
Assign the smart form name
w_ssfname = lc_smartform.
CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
EXPORTING
formname = w_ssfname
IMPORTING
fm_name = lf_fm_name
EXCEPTIONS
no_form = 1
no_function_module = 2
OTHERS = 3.
IF sy-subrc 0.
cf_retcode = sy-subrc.
PERFORM protocol_update.
ENDIF.
For Print output:
IF nast-nacha = '1'. "Print output
ls_control_param-preview = 'X'.
ls_control_param-no_dialog = 'X'.
ENDIF.
For Email output.
IF nast-nacha = '2'. "Email
Output options
ls_output_options-tdteleland = gs_kna1-land1.
ls_output_options-tdtelenum = gs_kna1-telfx.
ls_output_options-tdfaxuser = sy-uname.
ls_output_options-BCS_COMMIT = 'X'.
ls_control_param-device = lc_mail.
ENDIF.
dynamically call Fm behind the Smart form
CALL FUNCTION lf_fm_name
EXPORTING
control_parameters = ls_control_param
mail_recipient = ls_recipient_id
mail_sender = ls_sender_id
output_options = ls_output_options
user_settings = ' '
TABLES
delivery = gt_delivery
EXCEPTIONS
formatting_error = 1
internal_error = 2
send_error = 3
user_canceled = 4
OTHERS = 5.
IF sy-subrc 0.
cf_retcode = sy-subrc.
PERFORM protocol_update.
ENDIF.
Regards,
Joan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi mamta,
may be u can use the FM SO_NEW_DOCUMENT_SEND_API1
it will send the document created directly
I have checked its documention and it specifies that way only so ir will work
hope it helps !!
regards,
prashanti
Edited by: prashanti k on Jan 20, 2009 7:12 PM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
please check the link
Regards,
Madhu
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
85 | |
10 | |
10 | |
9 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.