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

Upload .csv from application server

HKany
Participant
0 Likes
592

Hi,

I am looking for the easiest way to upload a ".CSV" file from the application server and to save the the same file with another name in the same folder on the application server again.

At the moment I only find the way over datasets.

Is there another one?

Yes? Cool! - how?

Thanks in advance.

1 ACCEPTED SOLUTION
Read only

BH2408
Active Contributor
0 Likes
553

Hi ,

Use the Open dataset , READ DATASET and close dataset.

Regards,

Bharani

4 REPLIES 4
Read only

Former Member
0 Likes
553

Use of DATASET is fairly easy - for what reason do you not want to use that?

Read only

BH2408
Active Contributor
0 Likes
554

Hi ,

Use the Open dataset , READ DATASET and close dataset.

Regards,

Bharani

Read only

Former Member
0 Likes
553

hi Heiko,

The other posters are correct, particularly since you want to save a second file back to your application server. I tried many was, and the only successful option was to use OPEN DATASET ... CLOSE DATASET


DATA: dsn(40).
DATA: wa_itab like line of itab.

OPEN DATASET dsn FOR APPENDING IN TEXT MODE ENCODING DEFAULT.
IF SY-SUBRC = 0.
LOOP AT ITAB INTO wa_itab.
TRANSFER wa_itab TO dsn.
ENDLOOP.
ENDIF.
CLOSE DATASET dsn.

Read only

HKany
Participant
0 Likes
553

I found it.

To rename a file on the windows filesystem you have to use the SAP function 'SXPG_CALL_SYSTEM'.

It works.