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: 

while downloading file to application server its overwriting the earlier fi

Former Member
0 Kudos
111

hi if i am using below code with date time stamp the file is downloaded to the application server correctly and each time i execut eht program a difference file is generated as date time stamp differs each time but

whne i remove the date time stamp ie sy-datum and sy-uzeit as we dont need to display the date time stamp with the file each time i execute the program a file is generated but it overwrites the ealier existing file please suggest as each time it shoul generate a new file....

Concatenate file name sy-datum sy-uzeit '.txt' into v_datetimefile

.

  • file on Appplication Server is selected

CALL FUNCTION 'FILE_GET_NAME'

EXPORTING

  • CLIENT = SY-MANDT

logical_filename = 'ZFILE'

4 REPLIES 4

amit_khare
Active Contributor
0 Kudos
67

If there is no difference in the name then it will always overwrite the previous file. at the most you can append it to the old file.

You need to have difference in names to have different files each time.

Regards,

Amit

Reward all helpful replies.

Former Member
0 Kudos
67

Hi,

first of all decide you have to overwrite the existing file or you want to create the new, i think the answer is there in your query itself, if you want to create new then concatenate the date and time, else don't do that.

below are the additions we can use while opening the data set.

FOR INPUT

FOR OUTPUT

FOR APPENDING

IN BINARY MODE

IN TEXT MODE

AT POSITION p

TYPE ctrl

MESSAGE mess

FILTER f

Reward if useful.

Thanks,

Sreeram.

0 Kudos
67

hi Prasad

i already made myself clear that i want to create a new file with same name...and i dont want to overwrite it....

as date time stamp is not required

and file with same name generates different data each time so i dont want to overwrite it..

regards

Nishant

Former Member
0 Kudos
67

Hai,

How can you save more than one file with the same name?

If you do so obviously it overwrites the existing file.

No where exists this type of scenario.

If you want to do like this you have to save in different directory.