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

Variant Issue?

Former Member
0 Likes
505

Hi, expert:

when I schedule a job.

In the variant, how to define file name format like test_yyyy_mm_dd.txt.

for example, if today 2009Jan12, file name automatically change to test_2009_01_12.txt

Thanks

Edited by: Yunfa Zhang on Jan 12, 2009 11:30 PM

4 REPLIES 4
Read only

former_member191735
Active Contributor
0 Likes
486

You need to define two variables where as one is file name and the other one is date. Make the date field to today's date in variant decleration. Append these file names in your program.

In other words, under initialization event, concatenate 'Filename' sy-datum into selection screen parameter.

This will default to the selection screen but if you want to schedule the same for background you need to follow the first step.

Read only

Sandra_Rossi
Active Contributor
0 Likes
486

Transaction FILE (cross-client)

- Define ZLOGPATH as logical path, and assign it to physical path "/tmp/<FILENAME>"

- Define ZLOGFILE as logical file name, based on logical path "ZLOGPATH" and with file name "filename_<YEAR>_<PARAM_1>"

The following call will set filename = '/tmp/costcenter_2009_JJJJ'

CALL FUNCTION 'FILE_GET_NAME'
    EXPORTING 
      LOGICAL_FILENAME = 'ZLOGFILE'
      PARAMETER_1 = 'JJJJ'
    IMPORTING 
      FILE_NAME = filename.

[sap library : using platform-independent file names|http://help.sap.com/saphelp_nw70/helpdata/en/fc/eb3dc4358411d1829f0000e829fbfe/frameset.htm]

Read only

Former Member
0 Likes
486

Thank you so much. It's sovled

Read only

0 Likes
486

how? (see forum rules of engagement)