Skip to Content

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

Unable to send Subject Line while sending the email

Hi All,

I am using the FM SO_NEW_DOCUMENT_SEND_API1 to send email. This email does not have any attachments but only some body text. Everything is fine, but only the subject line is missing in the email. The code is attached for reference. Can you please help me out?

CLEAR WA_MAILATTR.



  WA_MAILATTR-OBJ_LANGU = SY-LANGU.
  WA_MAILATTR-OBJ_NAME = 'PO'.
  WA_MAILATTR-OBJ_DESCR   = 'Walmart PO Details'.
  WA_MAILATTR-SENSITIVTY = '0'.
  WA_MAILATTR-NO_CHANGE = 'X'.


 IF IT_MAILTXT[] IS INITIAL.
    WA_MAILTXT-LINE = 'The following are the details of the Purchase Orders :'.
    APPEND WA_MAILTXT TO IT_MAILTXT.
    CLEAR WA_MAILTXT.


    WA_MAILTXT-LINE =  'PO Number  PO Date    NoOfPO    Time Stamp'.
    APPEND WA_MAILTXT TO IT_MAILTXT.
    CLEAR WA_MAILTXT.

    WA_MAILTXT-LINE =  '                      Lines               '.
    APPEND WA_MAILTXT TO IT_MAILTXT.
    CLEAR WA_MAILTXT.

    LOOP AT IT_PODETAILS.
      WA_MAILTXT-LINE = IT_PODETAILS-VALUE.
      APPEND WA_MAILTXT TO IT_MAILTXT.
      CLEAR WA_MAILTXT.
    ENDLOOP.

  ENDIF.

CALL FUNCTION 'SO_NEW_DOCUMENT_SEND_API1'
     EXPORTING
          DOCUMENT_DATA              = WA_MAILATTR
          commit_work                = 'X'
*     IMPORTING
*          SENT_TO_ALL                = SENT_TO_ALL
*          NEW_OBJECT_ID              = NEW_OBJECT_ID
     TABLES
          OBJECT_HEADER              = it_OBJECT_HEADER
          OBJECT_CONTENT             = IT_MAILTXT
*          object_para                =
*          object_parb                =
          RECEIVERS                  = IT_MAILREC
     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.


Tags:
Former Member
Not what you were looking for? View more on this topic or Ask a question