Application Development and Automation 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: 
Read only

Output format - SO_NEW_DOCUMENT_SEND_API1

Former Member
0 Kudos
346

Hi Guys,

when we use the above foresaid FM with doc type HTM, v usually get a mail as,

"Dear Sir,As per our system...This is system generated mail. Please do not reply to this mail....Warm Regards,XXXXX'."

Here i dont want to get an output in a continuous line, want as,

"Dear Sir,

As per our system...

This is system generated mail. Please do not reply to this mail....

Warm Regards,

XXXXX' "

How to achieve this?

Warm Regards,

DosS.

3 REPLIES 3
Read only

Former Member
0 Kudos
316

gd_subject = p_odescr.

gd_attachment_desc = p_adescr.

CONCATENATE 'INVOICE' ' ' INTO gd_attachment_name.

it_mess_bod = 'This is an automated invoice from SAP.'.

APPEND it_mess_bod.

it_mess_bod = 'Please do not reply to this mail id.'.

APPEND it_mess_bod.

  • If no sender specified - default blank

  • p_email1 = sy-uname.

  • IF p_sender EQ space.

  • gd_sender_type = space.

  • ELSE.

  • gd_sender_type = 'INT'.

  • ENDIF.

PERFORM send_file_as_email_attachment

TABLES it_mess_bod

pdf "it_mess_att

USING p_email1

p_odescr

'PDF'

gd_attachment_name

gd_attachment_desc

p_sender

gd_sender_type

CHANGING gd_error

gd_reciever.

FORM send_file_as_email_attachment TABLES it_message

it_attach

USING p_email

p_mtitle

p_format

p_filename

p_attdescription

p_sender_address

p_sender_addres_type

CHANGING p_error

p_reciever.

CALL FUNCTION 'SO_DOCUMENT_SEND_API1'

EXPORTING

document_data = w_doc_data

put_in_outbox = v_inbox

sender_address = v_email1

sender_address_type = space

  • commit_work = 'X'

IMPORTING

sent_to_all = w_sent_all

  • NEW_OBJECT_ID =

  • SENDER_ID =

TABLES

packing_list = t_packing_list

  • OBJECT_HEADER =

contents_bin = t_attachment

contents_txt = it_message

receivers = t_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 <> 0.

MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno

WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

ENDIF.

  • Populate zerror return code

ld_error = sy-subrc.

  • Populate zreceiver return code

LOOP AT t_receivers.

ld_receiver = t_receivers-retrn_code.

ENDLOOP.

Read only

viquar_iqbal
Active Contributor
0 Kudos
316

Hi

In TABLES

OBJECT_CONTENT = OBJCONT

OBJCONT = 'Hey guys, time for lunch !!!'.

APPEND OBJCONT.

OBJCONT = 'Lets get going !'.

APPEND OBJCONT.

append the message to OBJCONT instead of one full line.

Hope it helps

Thanks

Viquar Iqbal

Read only

0 Kudos
316

Hi Viquar,

I hav already populated OBJCONT with multipl lines.

even the beauty, i did like.

OBJCONT = 'Hey guys, time for lunch !!!'.

APPEND OBJCONT.

OBJCONT = ' '.

APPEND OBJCONT.

OBJCONT = 'Lets get going !'.

APPEND OBJCONT.

eventhough its not givin me correct output...