Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

How to download files from content server using abap code.

Former Member
0 Kudos
454

Hello Experts,

I want to develop a program which downloads and decompress files from content server to our local desktop. Is there any FM or BAPIs to do this as my program should be generic and i can download files related all modules in SAP.

Please help me.

thank you

srinivas

1 REPLY 1

former_member434229
Active Participant
0 Kudos
129

Hi,

You can download file from application server as per the below menthod.

1. First get the file name (cg_file) using FM 'FILE_GET_NAME'.

2. Collect all the records into an internal table using below code:

OPEN DATASET cg_file FOR INPUT IN TEXT MODE ENCODING DEFAULT.

IF sy-subrc = 0.

WHILE f_fin = '0'.

READ DATASET cg_file INTO str.

IF sy-subrc NE 0.

f_fin = '1'.

ELSE.

IF NOT str IS INITIAL.

lt_str = str.

APPEND lt_str.

ENDIF.

ENDIF.

ENDWHILE.

Regards,

Ni3