Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

email body text

Hello,

we need to add a mailbody text to a standard mail (e.g. sales order confirmation using program SAPMV45A).

The output type was defined using transaction NACE with application V1 and medium 5 (external sending).

Currently we have only the PDF attachment without any text.

The mail text using transaction V/30 cannot be used for external sending (-> OSS 191470).

Is it possible to fill the mailbody text (argument: contents_txt in SO_DUCUMENT_SEND_API1) with standard customizing?

Or is a modification necessary?

Thanks in advance for your help.

Marian.

Former Member
Former Member replied

Hello,

I am working in a 4.7 environment using standard output configuration using transaction NACE and I also could not get standard SAP to add email disclaimer text into the body of the email. Here is what I did:

-


1) In function module SO_OBJECT_SEND, I added an include statement (this IS a modification to SAP):

tm = cl_os_system=>get_transaction_manager( ).

if not tm is initial.

t = tm->get_current_transaction( ).

if not t is initial.

t->set_mode_update( oscon_dmode_direct ).

endif.

endif.

catch cx_os_error cx_os_system_error.

endtry.

INCLUDE ZZMVxxxxxx.

  • create send request

CALL FUNCTION 'SBCOMS_SEND_REQUEST_CREATE'

exporting

originator = originator

originator_type = originator_type

IMPORTING

SEND_REQUEST = send_request

TABLES

OBJCONT = objcont

OBJHEAD = objhead

OBJPARA = objpara

OBJPARB = objparb

-


2) In the INCLUDE, I added this code which retrieves standard text object and populates the table which becomes the email body:

DATA: ZZ_lines LIKE tline OCCURS 0 WITH HEADER LINE.

CALL FUNCTION 'READ_TEXT'

EXPORTING

    • CLIENT = SY-MANDT*

ID = 'ST'

LANGUAGE = 'E'

NAME = 'Z_EMAIL_DISCLAIMER_GENERAL'

OBJECT = 'TEXT'

    • ARCHIVE_HANDLE = 0*

    • LOCAL_CAT = ' '*

    • IMPORTING*

    • HEADER =*

TABLES

LINES = ZZ_LINES

    • EXCEPTIONS*

    • ID = 1*

    • LANGUAGE = 2*

    • NAME = 3*

    • NOT_FOUND = 4*

    • OBJECT = 5*

    • REFERENCE_CHECK = 6*

    • WRONG_ACCESS_TO_ARCHIVE = 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.*

ELSE.

LOOP AT ZZ_LINES.

MOVE ZZ_LINES-TDLINE TO NOTE_TEXT-LINE.

APPEND NOTE_TEXT.

ADD 1 TO SIZE-NOTE_TEXT.

ENDLOOP.

ENDIF.

-


3) Finally, I created the standard text object Z_EMAIL_DISCLAIMER_GENERAL and added the following text:

PLEASE DO NOT REPLY TO THIS EMAIL. IF YOU HAVE QUESTIONS, PLEASE

CONTACT YOUR <your company's name> REPRESENTATIVE.

This communication is intended for the use of the addressee only and may

contain information that is privileged or confidential. If you are not

the addressee, you are hereby notified that any dissemination,

distribution or use of this communication is prohibited. If you received

this communication in error, please destroy it, all copies and any

attachments and notify the sender as soon as possible. Any comments,

statements or opinions expressed in this communication do not

necessarily reflect those of <your company's name>, its subsidiaries and

affiliates.

************************************************************************

Hope this helps.

Edited by: Bruce Risto on Jun 18, 2009 11:27 AM

Edited by: Bruce Risto on Jun 18, 2009 11:54 AM

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question