Skip to Content

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

Nov 10, 2017 at 07:42 AM


avatar image

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


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



error1.png (25.4 kB)
error2.jpg (98.7 kB)
10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Irfan Gokak 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.

    is_data = ls_stream CHANGING
      cr_data = er_stream ).

Please mark as answered if this is helpful.

10 |10000 characters needed characters left characters exceeded