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: 

Naming file dynamically in Application server

Former Member
0 Kudos


Hi,

I am uploading a file in application server using open data set. The application server path is given in the selection screen. How can i name the file dynamically while it is getting uploaded in the application server?

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi,

Thanks for the reply.

But the condition here is, multiple pdf are being generated and i have to give seperate names to each pdf and then upload it into al11.

7 REPLIES 7

custodio_deoliveira
Active Contributor
0 Kudos

Hi Sri,

You can give it any name you want for a new file, so you just need to concatenate the path with whatever you want to name the file whatever you want, ie:

*concatenates path + constant "/myfile/" + system date

lv_file = |{ p_path }/myfile/{ sy-datum }|.


OPEN DATASET lv_file FOR OUTPUT.

aarif_baig
Active Participant
0 Kudos

Hi Shristi,

              Put your condition before your open dataset  code

If sy-name = x.

v_file = whatever name you want.

Endif.

OPEN DATASET v_file FOR OUTPUT IN TEXT MODE.


Thanks.


Former Member
0 Kudos

Hi,

Thanks for the reply.

But the condition here is, multiple pdf are being generated and i have to give seperate names to each pdf and then upload it into al11.

0 Kudos

Hi Shristi,

               So multiple pdf is displaying data from different internal tables right?

CASE 'PDF1'.

file = 'X'

OPEN DATASET v_file FOR OUTPUT IN TEXT MODE.

TRANSFER `1234567890` TO file.

CLOSE DATASET file.

CASE 'PDF2'.


OPEN DATASET v_file FOR OUTPUT IN TEXT MODE.

file = 'y'.

TRANSFER `1234567890` TO file.

CLOSE DATASET file.

and so on.

0 Kudos
  • You can concatenate file name with the system date (sy-datum) and system time (sy-uzeit) so that each and every file will be uniquely named.

Regards,

Philip.

0 Kudos

As I said, you can concatenate whatever you want to file name.  You can concatenate sy-uname / sy-uzeit as mention before (just don't forget to use get time before this or you may have same uzeit and even this is not guaranteed), or you can create a counter variable and concatenate this counter as well (guaranteed you will not have same filename)

0 Kudos

Thank you Custodio