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: 

Sending .xlsx file from ABAP

Former Member
0 Kudos

Hi Experts,

How can we send .XLSX file from ABAP.

I have done as suggested in note 1459896 but it's not working.

I have added the header table with such value

concatenate '&SO_FILENAME=' lv_filename into lv_text_line.

  append lv_text_line to lt_att_head.


passing header table to


lo_document->add_attachment( exporting i_attachment_type = 'XLS'

                                  i_attachment_subject = 'AttachmentFilename'

                                  i_attachment_size = lv_size

                                  i_attachment_header = lt_att_head

                                  i_att_content_hex    = binary_content ).

but when I try to open it in SOST it says," file format or extension is not valid " .

Do you think if I send thsi mail to outlook it will work. ?

Thanks

Willi

5 REPLIES 5

former_member235395
Contributor
0 Kudos

Hi Willi,

I had same problem... The solution was work with extension ".XLS", because the structure that keep the extension only support 3 positions. For example.... If the extension is XLSX, so cut to XLS, this is the reason for the message "file format or extension is not valid"

Regards,

0 Kudos

But SAP note says 1459896 , it can be done

using

filename = 'attachment.xlsx'

concatenate '&SO_FILENAME=' lv_filename into lv_text_line.

  append lv_text_line to lt_att_head.


but still not working.

0 Kudos

Willi,

Check the parameter "I_TYPE" of method CREATE_DOCUMENT and parameter "I_ATTACHMENT_TYPE" of method ADD_ATTACHMENT. Both receive char3. I think, this is the problem! because if you try to send file with XLSX extension, the send process will truncate to XLS.

Regards,

Former Member
0 Kudos

Hi All,

Please check note 1459896 before replying it says it is possible.

Its well known that it takes three character type only but we need to send .XLSX that is the requirement.

Please see if anyone has able to send XLSX file through ABAP programs.

Thanks

0 Kudos

Hi Robert,

Please tell me whether your query is resolved or not. Iam also facing the similar problem. I also implemented the SAP Note. But in SOST, it is showing in XLS format. When I send mail, It is in XLSX format, but file is not opening properly.

Thanks,

Suresh