2010 Mar 25 11:12 AM
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.
2010 Mar 25 11:29 AM
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.
2010 Mar 25 11:19 AM
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
2010 Mar 25 11:29 AM
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
2010 Mar 25 11:29 AM
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.
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |