cancel
Showing results for 
Search instead for 
Did you mean: 

Files in Netweaver Gateway

Former Member
0 Kudos

Experts,

I am building a custom Fiori application to display files that were attached by users in DMS. While testing the service in Gateway, I am getting output as below,

As seen above, I am not able to display my PDF file in Gateway. I am only getting <RESPONSE_BODY/> in the lower right pane and lower left pane file preview which is expected is missing.

I tried with XLS & XLSX files and output is the same. No preview in Gateway.

I am converting the file uploaded in DMS (CV01N Tcode) to XSTRING & then using GET_STREAM method of DPC class, I am trying to show it gateway.

Code used is as below,


  ls_stream-mime_type = 'application/pdf'. " (For Excel, I pass as 'application/msexcel')

  ls_stream-value = lv_fileasxstring. " --> This is XSTRING value of uploaded file

   copy_data_to_ref( EXPORTING is_data = ls_stream

                     CHANGING  cr_data = er_stream ).

To confirm whether file to xstring conversion is correct, I added code to re-convert the xstring back to binary(original file format) and downloaded it to my desktop. This works perfectly & file contents are displayed without any issues.

I read blogs in SCN related to file attachments in Gateway & still could not resolve my issue.

Can you please tell me what I am missing.

BR,

Aspire

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Experts,

Can someone please help me in this regard. Kindly let me know if my explanation about issue is not clear.

BR,

Aspire

Former Member
0 Kudos

Experts,

Has anyone faced similar issue? Please share your valuable inputs.

BR,

Aspire

0 Kudos

hi,

At the time fetching value, Make sure your file type has been map into exact file type work area.

Regards,

Ram

Former Member
0 Kudos

Hi Ram,

Thanks for your reply. As seen from my code, I am passing file type as 'application/pdf''.

BR,

Aspire