Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

EMAIL subject need to be passed more than 50 chars

Former Member
0 Kudos

Hello ALL,

In my requirement i need to pass the email subject to more that 50 CHARS to FM SO_NEW_DOCUMENT_ATT_SEND_API1 But i can see the data type in structure SODOCCHGI1-OBJ_DESCR (field length data type max of 50 chars only).

In my case i am concatenating the other two strings and one field content into OBJ_DESCR its exceeding the max length.

* DOC_CHNG-OBJ_DESCR = 'GAPCAS Monitoring'.

CONCATENATE gc_obj_descr gc_rb_602 gf_doknr INTO DOC_CHNG-OBJ_DESCR SEPARATED BY ' '.

* Versenden des Dokuments

  CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'

    EXPORTING

      DOCUMENT_DATA                    = DOC_CHNG

      PUT_IN_OUTBOX                    = 'X'

      COMMIT_WORK                      = 'X'

*   IMPORTING

*     SENT_TO_ALL                      =

*     NEW_OBJECT_ID                    =

    TABLES

      PACKING_LIST                     = OBJPACK

      OBJECT_HEADER                    = OBJHEAD

      CONTENTS_BIN                     = gt_objbin_xls

      CONTENTS_TXT                     = OBJTXT

*     CONTENTS_HEX                     =

*     OBJECT_PARA                      =

*     OBJECT_PARB                      =

      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.

    WRITE: / 'Senden der Email mit XLS-Datei fehlgeschlagen:'(e12),

           / SY-MSGID, SY-MSGTY, SY-MSGNO.

    IF SY-MSGV1 IS NOT INITIAL. WRITE / SY-MSGV1. ENDIF.

    IF SY-MSGV2 IS NOT INITIAL. WRITE / SY-MSGV2. ENDIF.

    IF SY-MSGV3 IS NOT INITIAL. WRITE / SY-MSGV3. ENDIF.

    IF SY-MSGV4 IS NOT INITIAL. WRITE / SY-MSGV4. ENDIF.

    gf_send_error_mail = 'X'.

  ELSE.

    WRITE: ' ok'(i02), '   ', sy-uzeit.

  ENDIF.

Please let me know is there any other way we can pass email subject more than 50 chars and also suggest me if any other FM which is available to send mail with  email subject more than 50 chars.

Thanks in advance for your help.

Regards,

Mallikarjuna

1 REPLY 1

Former Member
0 Kudos

Hi Rao ,

Check this .

Regards,

Saddam