cancel
Showing results for 
Search instead for 
Did you mean: 

how to get a file using path

Omarrr
Explorer
0 Kudos

Hello Everybody,

i would like to get a file ( PDF) by using the Path ! Is there any Function Builder Or Methode who gives me the file as return value by calling it with the Path as Parameter.. ( files are on the Application server)

i m trying to use this Methode for getting this file in my web dynpro application without using the MIME Objects repository...

please put some light of this !

any suggestion will be vey appreciated !

Best regard

Omar

Accepted Solutions (1)

Accepted Solutions (1)

ramakrishnappa
Active Contributor
0 Kudos

Hi Omar,

You need to use OPEN_DATASET & READ DATASET statements to get the file from application server.

Steps:

  • Open dataset in read mode
  • Read the data set and collect into internal table
  • Now, convert this into XSTRING by using function module SCMS_STRING_TO_XSTRING
  • After converting into XSTRING, you can use CL_WD_RUNTIME_SERVICES=>ATTACH_FILE_TO_RESPONSE to download into local system

Please refer the below links

Upload File from SAP Application Server using ABAP

Application Server Program - ABAP Development - SCN Wiki


Hope this helps you.


Regards,

Rama

Omarrr
Explorer
0 Kudos

Hi Ramakrishnappa,

thank you very much for your reply ! i solved my issue and i'm able now to read all my pdf files and to display them in a Interactiv Form....

best Regards,

Omar

ramakrishnappa
Active Contributor
0 Kudos

You are welcome

Answers (1)

Answers (1)

Former Member
0 Kudos

Try with this

CL_WD_RUNTIME_SERVICES=>ATTACH_FILE_TO_RESPONSE(

          EXPORTING I_FILENAME = LV_FILENAME

                    I_CONTENT  = LV_CONTENT

                    I_MIME_TYPE = LV_CTYPE

                    I_IN_NEW_WINDOW = ABAP_TRUE ).