2009 Jan 22 6:28 AM
we have a report which would generate payslip on its execution . when we give the employee ID it would fetch the e-mail through infotype 9002 and sends the paylslip as an attachement to the user via mail .
Now the mail does not has any text in the body . The mail just carries the attachment and the subject . we need to add customized text in that display . we want the HR persons to give the customized text to be sent in the mail whenever they run the transaction along with addressing the user "Dear <emp_name>"
for the subject we use
** get title for mail subject
CONCATENATE TEXT-002 '-' MONTH INTO LS_OUTPUT_OPTIONS-TDTITLE.
could you please guide in displaying the text for this mail
2009 Jan 22 6:35 AM
HI
In this function module
contents_txt parameter use
CALL FUNCTION 'SO_DOCUMENT_SEND_API1'
EXPORTING
document_data = l_docdata
put_in_outbox = 'X'
commit_work = 'X'
sender_address = 'WF-BATCH'
sender_address_type = ' '
TABLES
packing_list = ts_packing_list
contents_bin = it_attachment
contents_txt = ts_message
receivers = ts_receivers
EXCEPTIONS
too_many_receivers = 1
document_not_sent = 2
document_type_not_exist = 3
operation_no_authorization = 4
parameter_error = 5
x_error = 6
enqueue_error = 7
OTHERS = 8.
IF sy-subrc NE 0.
ELSE.
MESSAGE i000(0k) WITH 'Error Message Send Sucessful'.
ENDIF.
USE this b4 code
CLEAR wa_ts_message.
REFRESH ts_message[].
CONCATENATE 'While Processing the Sales Document Number ' wa_vbak_vbap-vbeln ' the below errors were encountered:' INTO detail1 SEPARATED BY space.
wa_ts_message = detail1. * here type ur message*
APPEND wa_ts_message TO ts_message.
CLEAR wa_ts_message.
shiva