Skip to Content
author's profile photo Former Member
Former Member

Body is not coming in send a smartform output to Email as PDF attachment

Hai experts,

Using this code, only 'Material Data as a PDF attachment' came as subject and file name of PDF file.

Body is not coming . what is the problem. very urgent

w_doc_chng-obj_name = 'TEST_ALI'.

w_doc_chng-obj_descr = 'Material Data as a PDF attachment'.

  • Main Text

i_objtxt = 'Test Document.'.

append i_objtxt.

i_objtxt = 'You will find an PDF attachment in this message.'.

append i_objtxt.

i_objtxt = 'Have a nice day.'.

append i_objtxt.

  • Send Message

call function 'SO_NEW_DOCUMENT_ATT_SEND_API1'

exporting

document_data = w_doc_chng

put_in_outbox = 'X'

commit_work = 'X' "used from rel. 6.10

  • IMPORTING

  • SENT_TO_ALL =

  • NEW_OBJECT_ID =

tables

packing_list = i_objpack

*object_header = w_objhead

contents_bin = i_objbin

contents_txt = i_objtxt

  • CONTENTS_HEX = objhex

  • OBJECT_PARA =

  • OBJECT_PARB =

receivers = i_reclist

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.

Add a comment
10|10000 characters needed characters exceeded

Related questions

2 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Dec 03, 2007 at 10:06 AM

    hi,

    If you want to send some text as Body of the Mail then follow this once

    when u r callin the FM'SO_NEW_DOCUMENT_ATT_SEND_API1'.. points to remember

    1.u have to pass the body of content in table CONTENTS_TXT(ia m using I_OBJBIN) (each line a record) then. suppose i have appended 11 records to the table CONTENTS_TXT .

    2.PACKING_LIST(iam usign I_OBJPACK) table u ahve to append a redord as follows

    I_OBJPACK-TRANSF_BIN = ' '.

    I_OBJPACK-HEAD_START = 000000000000001.

    I_OBJPACK-HEAD_NUM = 000000000000001.

    I_OBJPACK-BODY_START = 000000000000002

    I_OBJPACK-BODY_NUM = 000000000000010.

    I_OBJPACK-DOC_TYPE = 'RAW'.

    append I_OBJPACK-.

    by the above code system treat the first line in table I_OBJBIN as header and the 2nd line to 10 lines tread as body.

    CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'

    EXPORTING

    DOCUMENT_DATA = WA_DOC_CHNG

    PUT_IN_OUTBOX = 'X'

    TABLES

    PACKING_LIST = I_OBJPACK

    OBJECT_HEADER = WA_OBJHEAD

    CONTENTS_BIN = I_OBJBIN

    CONTENTS_TXT = I_OBJTXT

    RECEIVERS = I_RECLIST

    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.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Dec 03, 2007 at 01:59 PM

    Many times the problem is due to the wrong alignment of windows. Just adjust the window size to a smaller size and check it. If the problem not solved then check ur coding.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.