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: 

Application Server files accesssing

Former Member
0 Kudos

Hi

I Uploaded file into Application server

PEN DATASET '/usr/sap/tmp/file.txt' FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.

IF sy-subrc = 0.

LOOP AT t_typ_data INTO w_typ_data.

TRANSFER w_typ_data TO '/usr/sap/tmp/file.txt'.

ENDLOOP.

ENDIF.

CLOSE DATASET '/usr/sap/tmp/file.txt'.

The how to check the file uploaded or not

i trie in AL11 but it was not there

2 REPLIES 2

vinod_vemuru2
Active Contributor
0 Kudos

Hi Raji,

First put a break point at ur OPEN dataset statement and check the sy-subrc Value after executing this statement.

If it is zero then execure ur report. Now go to transaction

CG3Y Here give ur application server file name and download file name in ur PC. Now press Transfer. It will create a file in ur PC. Now compare ur original file and downloaded file.

Similarly for uploading file u can use transaction CG3Z.

Also avoid hardcoding the file name in ur program. Take some variable or parameter.

May be u haven't checked carefully in al11. Another important point is file name is case sensitive.

Thanks,

Vinod.

former_member156446
Active Contributor
0 Kudos

IF NOT p_ufile IS INITIAL.

OPEN DATASET p_ufile FOR OUTPUT IN TEXT MODE.
IF sy-subrc NE 0.
EXIT.
ENDIF.
LOOP AT p_output INTO wa_file.
TRANSFER wa_file TO p_ufile.
CLEAR wa_file.
ENDLOOP.
CLOSE DATASET p_ufile.