Skip to Content
author's profile photo Former Member
Former Member

how to handle more than 255 char in excel att. in FM SO_DOCUMENT_SEND_API1

hi all,

Good morning.

My requirement is to send a report as an excel attatchment to the respective managers mail box. For this I am using the function module SO_DOCUMENT_SEND_API1 as follows.

call function 'SO_DOCUMENT_SEND_API1'

exporting

document_data =

put_in_outbox =

sender_address =

sender_address_type =

commit_work =

tables

packing_list =

object_header =

contents_bin =

contents_txt =

receivers =

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.

Here the problem is contents_bin is of type SOLISTI1 which takes max 255 characters, As my report columns occupies more than 400 characters, I am unable to get all the column values in excel attachement.

Can anyone please help me to get all the column values in the excel attachment.

Thanks in Advance.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Oct 10, 2008 at 11:02 AM

    Hi Srivallika

    make a Z copy of FM ALSM_EXCEL_TO_INTERNAL_TABLE

    make a Z copy of structure ALSMEX_TABLINE

    change ZALSMEX_TABLINE-VALUE from char50 to char1000

    Regards.

    Eshwar.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Oct 10, 2008 at 11:07 AM

    Hi,

    Use this FM TABLE_COMPRESS

    Try like this....

    
    
    RECEIVER_list-RECESC = 'E'. "<- 
    RECEIVER_list-SNDART = 'INT'."<- 
    RECEIVER_list-SNDPRI = '1'."<- 
    
    APPEND receiver_list. 
    
    
    General data 
    w_object_hd_change-objla = sy-langu. 
    w_object_hd_change-objnam = 'Object name'. 
    w_object_hd_change-objsns = 'P'. 
    
    Mail subject 
    w_object_hd_change-objdes = 'Message subject'. 
    
    
    Mail body 
    APPEND 'Message content' TO message_content. 
    
    
    Attachment 
    CALL FUNCTION 'SAVE_LIST' 
    EXPORTING 
    list_index = '0' 
    TABLES 
    listobject = listobject. 
    CALL FUNCTION 'TABLE_COMPRESS' 
    IMPORTING 
    compressed_size = compressed_size 
    TABLES 
    in = listobject 
    out = compressed_attachment. 
    DESCRIBE TABLE compressed_attachment. 
    CLEAR packing_list. 
    packing_list-transf_bin = 'X'. 
    packing_list-head_start = 0. 
    packing_list-head_num = 0. 
    packing_list-body_start = 1. 
    packing_list-body_num = sy-tfill. 
    packing_list-objtp = 'ALI'. 
    packing_list-objnam = 'Object name'. 
    packing_list-objdes = 'Attachment description'. 
    packing_list-objlen = compressed_size. 
    APPEND packing_list. 
    
    CALL FUNCTION 'SO_OBJECT_SEND' 
    EXPORTING 
    object_hd_change = w_object_hd_change 
    object_type = 'RAW' 
    owner = sy-uname 
    TABLES 
    objcont = message_content 
    receivers = receiver_list 
    packing_list = packing_list 
    att_cont = compressed_attachment. 
    
    

    Hope it will helps

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.