Application Development and Automation 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: 
Read only

SO_NEW_DOCUMENT_ATT_SEND_API1 FM issue

Former Member
0 Likes
590

Dear Experts,

I have created a program where in I send the applicant there Offer Letters through emals. It consist of a body text and a pdf attachment.

When I execute the tcode for the first time and emal it, it will go successfully.

But, when I again emal through the same session, the emal is trigerred but my emal body contains junk characters.

Every time I have to start the session again (Again run the tcode from scratch) then only it will get emaled with correct data in the body.

All the parameters which are been passed to function module SO_NEW_DOCUMENT_ATT_SEND_API1 are getting cleared properly.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
546

Hi Ashish Kansara ,

Refresh the message body Internal Table at the start of your code.


  CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
    EXPORTING
      DOCUMENT_DATA              = WA_DOC_CHNG
      PUT_IN_OUTBOX              = 'X'
      COMMIT_WORK                = 'X'
    TABLES
      PACKING_LIST               = I_OBJPACK
      OBJECT_HEADER              = WA_OBJHEAD
      CONTENTS_BIN               = I_OBJBIN
      CONTENTS_TXT               = I_OBJTXT
      RECEIVERS                  = I_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.

in the above example I_OBJTXT will contain message body,you need to refresh it at the start.

Hope it will solve your problem.

Thanks & Regards,

Rock.

Dear Experts,

I have created a program where in I send the applicant there Offer Letters through emals. It consist of a body text and a pdf attachment.

When I execute the tcode for the first time and emal it, it will go successfully.

But, when I again emal through the same session, the emal is trigerred but my emal body contains junk characters.

Every time I have to start the session again (Again run the tcode from scratch) then only it will get emaled with correct data in the body.

All the parameters which are been passed to function module SO_NEW_DOCUMENT_ATT_SEND_API1 are getting cleared properly.

3 REPLIES 3
Read only

Former Member
0 Likes
546

Dear Ashish,

Just whether you are clearing the parameters in initialization and check whether you are raising all the exceptions from FM or not.

Regards

Vikas

Read only

Former Member
0 Likes
546

Hi Ashish ,

The function module your are using for sending mail is being outdated , So try using BCS_Class for sending mail with PDF attachment . There are examples for this BCS_EXAMPLE_1 to BCS_EXAMPLE_6 . For sample codes u cud refer to previous posts .

regards

p.gurunath

Read only

Former Member
0 Likes
547

Hi Ashish Kansara ,

Refresh the message body Internal Table at the start of your code.


  CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
    EXPORTING
      DOCUMENT_DATA              = WA_DOC_CHNG
      PUT_IN_OUTBOX              = 'X'
      COMMIT_WORK                = 'X'
    TABLES
      PACKING_LIST               = I_OBJPACK
      OBJECT_HEADER              = WA_OBJHEAD
      CONTENTS_BIN               = I_OBJBIN
      CONTENTS_TXT               = I_OBJTXT
      RECEIVERS                  = I_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.

in the above example I_OBJTXT will contain message body,you need to refresh it at the start.

Hope it will solve your problem.

Thanks & Regards,

Rock.