Skip to Content

Fiori App - Documents as attachment does not work in Mobile/Tab Devices

Hello All

We have a custom App, where in a Link has been given thru which the user can open the document (pdf/doc) in a separate browser window. The document is coming from oData service as binary string. The URL is calculated using the following

/Service/EntitySet(key)/$value

The URL works fine in Desktops. However it does not work in Mobile devices . When the user clicks on the links, a download starts, after that the document does not open. Here are some screen shots

Thanks

Sandip

error1.png (25.4 kB)
error2.jpg (98.7 kB)
Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Nov 13, 2017 at 09:26 AM

    Hi Sandeep,

    Add below code snippet in your GET_STREAM.

    *---Set File Name for the file to be downloded
        ls_lheader-name = 'Content-Disposition'.
        concatenate 'outline; filename=' ls_zzupld-filename INTO ls_lheader-value.
        set_header( is_header = ls_lheader ).
        CLEAR ls_lheader.
    
    
    *---Set Content Type in header
        ls_stream-mime_type = ls_zzupld-mimetype.
        ls_stream-value = ls_zzupld-value.
    
        copy_data_to_ref(
      EXPORTING
        is_data = ls_stream CHANGING
          cr_data = er_stream ).
    

    Please mark as answered if this is helpful.

    Add comment
    10|10000 characters needed characters exceeded