05-11-2008 12:22 PM
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
05-11-2008 12:44 PM
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.
05-11-2008 5:51 PM
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.