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

SO_NEW_DOCUMENT_SEND_API1

Hi frnds,

My requirement:

subject line should be changed from Customer Name to Customer Name + Credit Memo while sending email to customer.

I am using SO_NEW_DOCUMENT_SEND_API1 fn.mod

and not 'SO_NEW_DOCUMENT_ATT_SEND_API1'.

I am passing these values,

lv_doc_data-OBJ_NAME = 'Credit Memo'.

lv_doc_data-obj_desc = '广州宏亮油泵维修有限公司Credit Memo'

But the attachement file name is also chaning to '广州宏亮油泵维修有限公司Credit Memo' .for this i am getting file name wrong error.

The file name shud not be changed as per my requirement.

Please suggest me some soln.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Jun 16, 2008 at 12:35 PM

    dear friend

    pls go through the code

    if helpfull rewards are expecting.

    vivek

    *--Data declearation

    DATA: OBJPACK LIKE SOPCKLSTI1 OCCURS 0 WITH HEADER LINE.

    DATA: OBJHEAD LIKE SOLISTI1 OCCURS 0 WITH HEADER LINE.

    DATA: OBJBIN LIKE SOLISTI1 OCCURS 0 WITH HEADER LINE.

    DATA: OBJTXT LIKE SOLISTI1 OCCURS 0 WITH HEADER LINE.

    DATA: RECLIST LIKE SOMLRECI1 OCCURS 0 WITH HEADER LINE.

    DATA: DOC_CHNG LIKE SODOCCHGI1.

    DATA: TAB_LINES LIKE SY-TABIX.

    DATA: L_MSG(100) TYPE C.

    • Creation of the document to be sent

    DOC_CHNG-OBJ_NAME = 'Z2318S1B01'.

    DOC_CHNG-OBJ_DESCR = EMSUBJ .

    - Begin of update By NDASARI 05/17/2007 -


    *OBJTXT = 'your report from apple vacations is enclosed as

    • ATTACHMENT'.

    OBJTXT = 'your report from apple vacations is enclosed as ATTACHMENT'.

    - End of update By NDASARI 05/17/2007 -


    APPEND OBJTXT.

    DESCRIBE TABLE OBJTXT LINES TAB_LINES.

    READ TABLE OBJTXT INDEX TAB_LINES.

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

    • Creation of the entry for the compressed document

    CLEAR OBJPACK.

    OBJPACK-HEAD_START = 1.

    OBJPACK-HEAD_NUM = 0.

    OBJPACK-BODY_START = 1.

    OBJPACK-BODY_NUM = TAB_LINES.

    OBJPACK-DOC_TYPE = 'RAW'.

    APPEND OBJPACK.

    • Creation of the document attachment

    LOOP AT IT_ATTACHMENT.

    OBJBIN = IT_ATTACHMENT-EMAIL.

    APPEND OBJBIN.

    CLEAR OBJBIN.

    ENDLOOP.

    DESCRIBE TABLE OBJBIN LINES TAB_LINES.

    OBJHEAD = 'Airport Mainfest'.

    APPEND OBJHEAD.

    • Creation of the entry for the compressed attachment

    OBJPACK-TRANSF_BIN = 'X'.

    OBJPACK-HEAD_START = 1.

    OBJPACK-HEAD_NUM = 1.

    OBJPACK-BODY_START = 1.

    OBJPACK-BODY_NUM = TAB_LINES.

    OBJPACK-DOC_TYPE = 'RAW'.

    OBJPACK-OBJ_NAME = 'ANLAGE'.

    OBJPACK-OBJ_DESCR = 'Representation of object 138'.

    OBJPACK-DOC_SIZE = TAB_LINES * 255.

    APPEND OBJPACK.

    • Completing the recipient list

    CLEAR EMAILID.

    LOOP AT EMAILID.

    TRANSLATE EMAILID-LOW TO LOWER CASE.

    RECLIST-RECEIVER = EMAILID-LOW.

    RECLIST-REC_TYPE = 'U'.

    APPEND RECLIST.

    CLEAR RECLIST.

    ENDLOOP.

    CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_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

    DOCUMENT_TYPE_NOT_EXIST = 3

    OPERATION_NO_AUTHORIZATION = 4

    PARAMETER_ERROR = 5

    X_ERROR = 6

    ENQUEUE_ERROR = 7

    OTHERS = 8.

    IF SY-SUBRC = 0.

    LOOP AT RECLIST.

    IF RECLIST-RETRN_CODE = 0.

    CONCATENATE RECLIST-RECEIVER ':'

    'The document was sent' INTO L_MSG.

    MESSAGE S656 WITH L_MSG.

    ELSE.

    CONCATENATE RECLIST-RECEIVER ':'

    'The document was sent' INTO L_MSG.

    MESSAGE E656 WITH L_MSG.

    ENDIF.

    ENDLOOP.

    ELSE.

    CONCATENATE RECLIST-RECEIVER ':'

    'error occurred in sending mail' INTO L_MSG.

    MESSAGE S656 WITH L_MSG.

    ENDIF.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jun 16, 2008 at 01:07 PM

    Hi nivetha a

    U have to pass the name for attachment into tables parameter packing_list-obj_descr. Then u will get the correct name that u have entered.

    PACKING_LIST-OBJ_DESCR = 'ABCDE'

    append packing_list.

    Venkat.

    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.