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: 

Convert Internal Table to Exs Format and Send mail.

Former Member
0 Kudos

Hi.

Please help me.

Business Requirement : Run ALV report in Background Daily Schedule  and Send Mail with Excel Attachment.

Problem :  We are Convert Internal Table to EXCEL formate through  SOLISTI1 structure type but problem is WIDTH is max. 255

                  so some data of last 3 column are not appearer in Email Attachment.

Please help me urgent.

Pradip Patel.

3 REPLIES 3

rajkumarnarasimman
Active Contributor
0 Kudos

Hi Pradip,

The maximum character is 255, in order to use beyond that we can do it by using Contents_hex attribute in FM SO_NEW_DOCUMENT_ATT_SEND_API1.

Please find the link below.

To send a mail attachment with more than 255 characters in a line - Code Gallery - SCN Wiki

But i recommend to use CL_BCS method for email.

Send email from ABAP with class CL_BCS - Code Gallery - SCN Wiki

Sending attachment using cl_bcs classes - Code Gallery - SCN Wiki

Regards

Rajkumar Narasimman.

0 Kudos

Hello Rajkumar Narasimman.

Thanks for reply.

My Code like below.

DATA :  IATTACH       TYPE STANDARD TABLE OF SOLISTI1 WITH HEADER LINE,

CONCATENATE header 1 to header 38 into  IATTACH SEPARATED BY CON_TAB.

APPEND  IATTACH.


same data of internal table.

loop at it in wa

     data collect at ohter internal table.IDOWN

endloop.


loop IDOWN into WDOWN.

     CONCATENATE wdown-row1 to wdown-row38 into  IATTACH SEPARATED BY CON_TAB.

append  IATTACH.

endloop.


I send email with attachment of IATTACH file in EXCEL format.



Please help me.


Pradip Patel.

0 Kudos

Hi Pradip,

Here you are using SOLISTI1 structure, that is the reason the value truncated to 255 characters.


Instead of that use Binary concept.


  1. We Convert the table contents for attachment to xstring using FM SCMS_STRING_TO_XSTRING.
  2. Then Xstring -> Binary USING SCMS_XSTRING_TO_BINARY


Please find the link below.


To send a mail attachment with more than 255 characters in a line - Code Gallery - SCN Wiki


Regards


Rajkumar Narasimman