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: 

upload file into application server

Former Member
0 Kudos

Hi ,

I created path in application server to upload data.

but path is not creating.

parameters: filename(128) default '/usr/tmp/testfile.dat'

lower case.

open dataset filename for output in text mode encoding default.

if sy-subrc ne 0.

write: 'File cannot be opened. '.

exit.

endif.

loop at gstring into wastr.

transfer wastr-fstring to filename.

endloop.

close dataset filename. " Closing the file

Thanks,

Asha

1 ACCEPTED SOLUTION

Former Member
0 Kudos

What i understood from your question is...your open dataset returns sy-subrc as 4. If yes, declare parameters as below and try:

PARAMETERS: FILENAME TYPE PATHEXTERN

default '/usr/tmp/testfile.dat'

Thanks,

SKJ

5 REPLIES 5

Former Member
0 Kudos

Dear Asha,

To upload data/ down load data application server use below transactions.

CG3Y

CG3Z

Regards

Former Member
0 Kudos

Asha

Try to upload a file using Transaction CG3Z with the same file path on Application Server... By doing so you may find the cause...

Thanks

Amol Lohade

former_member585060
Active Contributor
0 Kudos

Try this code

SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.

PARAMETERS : p_asfile TYPE rlgrap-filename DEFAULT '/usr/tmp/testfile.dat'.

.

SELECTION-SCREEN END OF BLOCK b1.

OPEN DATASET p_asfile FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.

IF sy-subrc <> 0.

EXIT.

ENDIF.

LOOP AT it_emp INTO wa_emp.

TRANSFER wa_emp TO p_asfile.

ENDLOOP.

CLOSE DATASET p_asfile.

Former Member
0 Kudos

To set up the path permanently ..basis help is needed..

Also check if there are proper authorization to save the file in application server and to open the dataset

Former Member
0 Kudos

What i understood from your question is...your open dataset returns sy-subrc as 4. If yes, declare parameters as below and try:

PARAMETERS: FILENAME TYPE PATHEXTERN

default '/usr/tmp/testfile.dat'

Thanks,

SKJ