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

SO_DOCUMENT_SEND_API1 - Error

Hey everyone,

i am using SO_DOCUMENT_SEND_API1 in a loop. I just want to send text, i dont need an attachment.

The first email is sent fine.

But the second email it sends, contains the body of the first email and an attachement with the body of the first and second email..

So forexample..

Email 1 = ' First Email ' ---> sent on first pass in the loop.

Email 2 = ' Second Email ' ---> sent in the second pass of the loop.

I receive these two emails in my inbox:

Email 1: First Email

Email 2: First Email + txt attachment : First Email. Second Email

I ahve also tried SO_NEW_DOCUMENT_ATT_SEND_API1. and i get the same thing.

Thanks..

-


HERE IS MY CODE ( inside the loop ): -


  • Variable full_body changes. e.g. "First Email" on first pass, "Second Email" on second Pass

  • Creating the document to be sent

DOC_CHNG-OBJ_NAME = 'Reservation'.

DOC_CHNG-OBJ_DESCR = 'Reservation About to Expire'.

OBJTXT = full_body.

APPEND OBJTXT.

DESCRIBE TABLE OBJTXT LINES TAB_LINES.

READ TABLE OBJTXT INDEX TAB_LINES.

DOC_CHNG-DOC_SIZE = ( TAB_LINES - 1 ) * 255 + STRLEN( OBJTXT ).

  • Creating the entry for the compressed document

CLEAR OBJPACK-TRANSF_BIN.

OBJPACK-HEAD_START = 1.

OBJPACK-HEAD_NUM = 0.

OBJPACK-BODY_START = 1.

OBJPACK-BODY_NUM = TAB_LINES.

OBJPACK-DOC_TYPE = 'RAW'.

APPEND OBJPACK.

  • Entering names in the distribution list

RECLIST-RECEIVER = receiver_email.

RECLIST-REC_TYPE = 'U'.

APPEND RECLIST.

  • Sending the document

CALL FUNCTION 'SO_DOCUMENT_SEND_API1'

EXPORTING

DOCUMENT_DATA = DOC_CHNG

  • PUT_IN_OUTBOX = 'X'

COMMIT_WORK = 'X'

TABLES

PACKING_LIST = OBJPACK

  • OBJECT_HEADER = OBJHEAD

  • CONTENTS_BIN = OBJBIN

CONTENTS_TXT = OBJTXT

RECEIVERS = RECLIST

EXCEPTIONS

TOO_MANY_RECEIVERS = 1

DOCUMENT_NOT_SENT = 2

OPERATION_NO_AUTHORIZATION = 4

OTHERS = 99.

-


thanks...

Edited by: imatari on Sep 22, 2009 7:56 PM

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

4 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Sep 22, 2009 at 06:09 PM

    It looks like in each LOOP you APPEND OBJTXT, but you never REFRESH it.

    Rob

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Sep 22, 2009 at 06:18 PM

    Just before the endloop use

    REFRESH OBJTXT.
    CLEAR OBJTXT.
    

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 22, 2009 at 06:23 PM

    Wow, thanks alot Rob..

    i added ( at the end of the loop ):

    refresh objtxt.

    refresh objpack.

    refresh reclist.

    -- with just REFRESH OBJTXT, there is still an attachment is still created on the second email.

    i had tried CLEAR OBJTXT before. but that did not work.

    But REFRESH works perfect :)..

    This really helped, i spent so much time on this..

    God Bless Ya.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 22, 2009 at 06:27 PM

    Thanks Everyone..

    I appreciate it.

    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.