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: 

customized text for email when sending e-payslip

Former Member
0 Kudos
119

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

1 REPLY 1

Former Member
0 Kudos
59

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