‎2008 Dec 03 12:42 AM
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
‎2009 Jan 12 10:39 PM
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.
‎2009 Jan 13 12:38 AM
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]
‎2009 Jan 14 8:32 PM
‎2009 Jan 14 8:41 PM