2011 May 20 3:06 PM
Hi,
I am trying to attach a 'TXT' format in the email but im not getting the proper format in the output.
READ TABLE T_ATTACHMENT_DATA INTO W_ATTACHMENT_DATA INDEX GV_TAB_LINES.
W_OBJPACK-TRANSF_BIN = 'X'.
W_OBJPACK-HEAD_START = 1.
W_OBJPACK-HEAD_NUM = 0.
W_OBJPACK-BODY_START = 1.
W_OBJPACK-BODY_NUM = GV_TAB_LINES.
W_OBJPACK-OBJ_DESCR = SY-DATUM.
W_OBJPACK-OBJ_NAME = 'Head count'.
W_OBJPACK-DOC_TYPE = 'TXT'.
W_OBJPACK-DOC_SIZE = ( GV_TAB_LINES - 1 ) * 255.
APPEND W_OBJPACK TO T_OBJPACK.
CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
EXPORTING
DOCUMENT_DATA = W_DOC_CHNG
PUT_IN_OUTBOX = ' '
COMMIT_WORK = 'X'
TABLES
PACKING_LIST = T_OBJPACK
CONTENTS_BIN = T_ATTACHMENT_DATA "T_ATTACHMENT_BIN "t_attachment
CONTENTS_TXT = T_MAILBODY
RECEIVERS = T_RECEIVER.
Regards,
Roop.
2011 May 20 11:02 PM
Hi
Please define the packing list for the email document object . Have only defined the packing list for mail attachment object.
Please note that the first entry in the packing list table is always for the email document , subsequent entries are each for one attachment. In your case , you have defined the packing list for email attachment , which should be second entry in packing list. Define one for email document and insert as first entry of the packing list.
Also would suggest to use SAP's communication services , class cl_document_bcs to send documents which is more beneficial.
Hope it helps.
Regards,
Pawan
Hi,
I am trying to attach a 'TXT' format in the email but im not getting the proper format in the output.
READ TABLE T_ATTACHMENT_DATA INTO W_ATTACHMENT_DATA INDEX GV_TAB_LINES.
W_OBJPACK-TRANSF_BIN = 'X'.
W_OBJPACK-HEAD_START = 1.
W_OBJPACK-HEAD_NUM = 0.
W_OBJPACK-BODY_START = 1.
W_OBJPACK-BODY_NUM = GV_TAB_LINES.
W_OBJPACK-OBJ_DESCR = SY-DATUM.
W_OBJPACK-OBJ_NAME = 'Head count'.
W_OBJPACK-DOC_TYPE = 'TXT'.
W_OBJPACK-DOC_SIZE = ( GV_TAB_LINES - 1 ) * 255.
APPEND W_OBJPACK TO T_OBJPACK.
CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
EXPORTING
DOCUMENT_DATA = W_DOC_CHNG
PUT_IN_OUTBOX = ' '
COMMIT_WORK = 'X'
TABLES
PACKING_LIST = T_OBJPACK
CONTENTS_BIN = T_ATTACHMENT_DATA "T_ATTACHMENT_BIN "t_attachment
CONTENTS_TXT = T_MAILBODY
RECEIVERS = T_RECEIVER.
Regards,
Roop.
2011 May 20 11:02 PM
Hi
Please define the packing list for the email document object . Have only defined the packing list for mail attachment object.
Please note that the first entry in the packing list table is always for the email document , subsequent entries are each for one attachment. In your case , you have defined the packing list for email attachment , which should be second entry in packing list. Define one for email document and insert as first entry of the packing list.
Also would suggest to use SAP's communication services , class cl_document_bcs to send documents which is more beneficial.
Hope it helps.
Regards,
Pawan
2011 May 23 7:14 AM
Hi Roob;
I send to email in HTM attach file from SAP. I checked your code and my code. I found only one difference between the two.
I'm using FM SO_DOCUMENT_SEND_API1. This function very similar to FM SO_NEW_DOCUMENT_ATT_SEND_API1.
Can you tyr to FM SO_DOCUMENT_SEND_API1.
Best regards.
2011 May 23 7:49 AM
> I send to email in HTM attach file from SAP. I checked your code and my code. I found only one difference between the two.
> I'm using FM SO_DOCUMENT_SEND_API1. This function very similar to FM SO_NEW_DOCUMENT_ATT_SEND_API1.
>
> Can you tyr to FM SO_DOCUMENT_SEND_API1.
Hello Melih,
SO_NEW_DOCUMENT_ATT_SEND_API1: If you want to send the email with attachments.
SO_NEW_DOCUMENT_SEND_API1: Send emails only. You cannot attach any files via this API.
@All: SAP recommends using the BCS classes to send mails instead of using the SO* APIs.
Cheers,
Suhas
2011 Jun 07 10:15 AM
hi all,
thanks for your valuable suggestion. now the problem is im not able to send the column length more 255 chars in the attachment. the type is SOLISTI1.
Regards,
Roops
2011 Jun 07 10:26 AM
Hi,
You would not be able to append more length than 255. Either use append in internal table and break lines.
Thanks,
Gaurav.
2011 May 23 7:25 AM
Hello,
W_OBJPACK-DOC_TYPE = 'TXT'. " This TXT is not available in TSOTD table..
So make sure of that.. And pass instead of TXT as RAW.
Regards,
Praveen
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |