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

How to handle Errors in Idoc-Inbound

Hi Everyone,

Its really very good oppurninty to share everyone thought's through Great SDN-SAP Network.

Mainly, i developed an inbound program. Now iam planning to record all my errors and send through an mail.

How can i do that? How to use the FM SO_NEW_DOCUMENT_SEND_API1

Thanks

Manju

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Jan 29, 2007 at 05:50 PM

    Hi Manju,

    Go through the following Code

    DATA: OBJPACK LIKE SOPCKLSTI1 OCCURS 2 WITH HEADER LINE.

    DATA: OBJHEAD LIKE SOLISTI1 OCCURS 1 WITH HEADER LINE.

    DATA: OBJBIN LIKE SOLISTI1 OCCURS 10 WITH HEADER LINE.

    DATA: OBJTXT LIKE SOLISTI1 OCCURS 10 WITH HEADER LINE.

    DATA: RECLIST LIKE SOMLRECI1 OCCURS 5 WITH HEADER LINE.

    DATA: DOC_CHNG LIKE SODOCCHGI1.

    DOC_CHNG-OBJ_NAME = 'TEST'.

    DOC_CHNG-OBJ_DESCR = 'Test-Dokument fur API1 Test'(001).

    OBJTXT = 'Mindestgebot : $250000'.

    APPEND OBJTXT.

    OBJTXT = 'Eine Abbildung des zur Versteigerung stehenden Bildes'.

    APPEND OBJTXT.

    OBJTXT = 'wurde als Anlage beigefugt.'.

    APPEND OBJTXT.

    DESCRIBE TABLE OBJTXT LINES TAB_LINES.

    READ TABLE OBJTXT INDEX TAB_LINES.

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

    • * ERSTELLEN DES EINTRAGS ZUM KOMPRIMIERTEN DOKUMENT

    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.

    • * ERSTELLEN DER ANLAGE FUR DAS DOKUMENT

    OBJBIN = '\O/ '. APPEND OBJBIN.

    OBJBIN = ' '. APPEND OBJBIN.

    OBJBIN = ' / \ '. APPEND OBJBIN.

    DESCRIBE TABLE OBJBIN LINES TAB_LINES.

    OBJHEAD = 'picasso.txt'. APPEND OBJHEAD.

    • * Erstellen des Eintrags zur komprimierten Anlage

    OBJPACK-TRANSF_BIN = 'X'.

    OBJPACK-HEAD_START = 1.

    OBJPACK-HEAD_NUM = 1.

    OBJPACK-BODY_START = 1.

    OBJPACK-BODY_NUM = TAB_LINES.

    OBJPACK-DOC_TYPE = 'TXT'.

    OBJPACK-OBJ_NAME = 'ANLAGE'.

    OBJPACK-OBJ_DESCR = 'Abbildung Objekt 138'.

    OBJPACK-DOC_SIZE = TAB_LINES * 255.

    APPEND OBJPACK.

    • * Fullen der Empfangerliste

    RECLIST-RECEIVER = SY-UNAME.

    RECLIST-REC_TYPE = 'B'.

    APPEND RECLIST.

    CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'

    EXPORTING

    DOCUMENT_DATA = DOC_CHNG

    PUT_IN_OUTBOX = '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.

    Regards

    Sreeni

    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.