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: 

writing a file to application server AL11 using ABAP

Former Member
0 Kudos

Hi all,

pls tell me how to write a file to application server AL11 using ABAP

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi,

To send a file to Application Server you have to use below code.

OPEN DATASET v_filepath FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.

TRANSFER v_data TO v_filepath.

CLOSE DATASET v_filepath.

v_filepath is the file path where file is to be placed in Application server.

Hope this may be helpful.

Regards,

Sravanthi

8 REPLIES 8

SuhaSaha
Advisor
Advisor
0 Kudos

Hello Friend,

Search in SDN you will find the solution. Innumerable posts are available on this

BR,

Suhas

Former Member
0 Kudos

Hi,

To send a file to Application Server you have to use below code.

OPEN DATASET v_filepath FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.

TRANSFER v_data TO v_filepath.

CLOSE DATASET v_filepath.

v_filepath is the file path where file is to be placed in Application server.

Hope this may be helpful.

Regards,

Sravanthi

Former Member

Hi

See the help for the statament OPEN DATASET, TRANSFER and CLOSE DATASET:

OPEN DATASET <FILE NAME> .....<----- Open file

TRANSFER <data> to <FILE NAME> <---- Download the data to file

CLOSE DATASET <FILE NAME>. <----- Close file

Max

tarangini_katta
Active Contributor
0 Kudos

Hi U can use the function module

C13Z_FILE_UPLOAD_ASCII

if you press c13z there willbe somme function modules.

Just go through i hope above one may help you.

Thanks

Former Member
0 Kudos

Hello,

You have to do the following 3 steps.

1. OPEN DATASET

2. TRANSFER

3. CLOSE DATASET

you can write the following code.

PARAMETERS: P_FILE LIKE RLGRAP-FILENAME OBLIGATORY . " your path on you

"application server

*To open the dataset

OPEN DATASET P_FILE FOR OUTPUT IN TEXT MODE.

*To write data to a file on your application sever

LOOP AT TBL_FINAL. " TBL_FINAL contains data to be sent to file

TRANSFER TBL_FINAL TO P_FILE.

ENDLOOP.

  • Close the data set you have opened earlier

CLOSE DATASET P_FILE.

Regards

Arindam

Former Member
0 Kudos

Hi Abhishek,

Could you please give me an idea of how v_data to be declared ? is it the final internal table ??

Thanks.

0 Kudos

v_data must be a flat structure, normally a table work area though not necessary.

This post is over six years old.

Former Member
0 Kudos

Hi,

use standard reports for uploading and downloading,

CG3Y  - Downloading file from application server

CG3Z  - Uploading file to application server

- Regards,

  Kasif