Skip to Content
avatar image
Former Member

Sending .xlsx file from ABAP

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

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

2 Answers

  • Jul 10, 2014 at 07:12 PM

    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,

    Add comment
    10|10000 characters needed characters exceeded

    • 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,

  • avatar image
    Former Member
    Jul 10, 2014 at 10:11 PM

    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

    Add comment
    10|10000 characters needed characters exceeded

    • 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