Application Development and Automation 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: 
Read only

How to write the long string data into application server file

Former Member
0 Likes
602

I have data in a string ( very large volume ) i need to write this data into file in application server.

Could you suggest me a FM ..??

1 REPLY 1
Read only

former_member386202
Active Contributor
0 Likes
418

Hi,

Refer following code

*--Local Variables

DATA : lv_file TYPE string. "File name

*--Clear file

CLEAR : lv_file.

*--Concatanate filename and path fort application server

CONCATENATE p_path gc_slash p_file gc_txt INTO lv_file.

*--Open dataset for output mode to transfer the data

OPEN DATASET lv_file FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.

IF sy-subrc EQ 0.

IF NOT gt_file[] IS INITIAL.

LOOP AT gt_file INTO gs_file.

*--Transfer data into file to downlaod

TRANSFER gs_file TO lv_file.

*--Clear work area

CLEAR : gs_file.

ENDLOOP.

*--File is downloaded successfully to Application Server

MESSAGE s081.

ENDIF.

ENDIF.

Regards,

prashant