Skip to Content
avatar image
-1
Former Member

Upload multiple files of any format from desktop using a zprogram and send them as attachment

Hi,

I want to write a custom program which allows the user to upload file of any extension and send this files to a email id. I have tried using GUI_UPLOAD and cl_document_bcs class. But not able to send .DOCX or .XLSX or .PPT file.

Kindly Advice.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • Best Answer
    Dec 14, 2016 at 12:48 PM

    For the four digits suffix, first look at 1459896 - BCS: Support for four-digit file name extension. (Also use google/launchpad)

    Regards,
    Raymond

    Add comment
    10|10000 characters needed characters exceeded

  • Dec 14, 2016 at 12:27 PM

    Hi,

    What is the added benefit? You can upload anything to email using S00 transaction and recipient type U Internet address.

    Also how does this have more functionality than any other email software out there?

    Kind regards, Rob Dielemans

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Dec 14, 2016 at 02:45 PM

    Resolved.

    Added i_attachment_size. While adding attachment SAP calculates the attachment size automatically which results in junk values for 4 digit extensions. So we need to pass the attachment size to get proper attachment. Below is the code for reference.

    SAP Note - 1459896 - BCS: Support for four-digit file name extension helps to understand the same.

    CALL FUNCTION 'GUI_UPLOAD'
    EXPORTING
    FILENAME = lv_filename
    FILETYPE = 'BIN'

    IMPORTING
    FILELENGTH = lv_file_len

    TABLES
    DATA_TAB = lt_uploaded_data.

    CALL METHOD document->add_attachment
    EXPORTING i_attachment_type = l_att_type
    i_attachment_subject = l_subject " attachment description
    i_attachment_size = lv_file_size
    i_att_content_hex = lt_uploaded_data.

    Add comment
    10|10000 characters needed characters exceeded