Skip to Content
0

Export File with dynamic date DD/MM/YY

Dec 20, 2017 at 02:54 PM

79

avatar image

Hello,

I have a file export scheduled job to export the file to server using the process chain /CPMB/EXPORT_TD_TO_FILE

So everyday when the file is written it is replaced with old files, I know this is standard.

However can we customize the File name by adding date as dynamic parameter so that i have back up for each day?

something like TD_FILEBACKUP_DD/MM/YY

any thoughts?

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

2 Answers

Best Answer
Vadim Kalinin Dec 20, 2017 at 03:39 PM
0

You can't add current date to file name using advanced dm package script

Copy ABAP code of UJD_TEST_PACKAGE to Z program and add code to generate proper file name for output file prompt. Then create a custom chain with ZUJD_TEST_PACKAGE and schedule it.

About UJD_TEST_PACKAGE:

https://blogs.sap.com/2009/08/28/automate-execution-of-any-data-manager-package/

P.S. The code to create answer prompt in UJD_TEST_PACKAGE is:

 SPLIT L_PROMPT AT CL_ABAP_CHAR_UTILITIES=>CR_LF INTO TABLE LT_PROMPT.
  LOOP AT LT_PROMPT ASSIGNING <LS_PROMPT>.
    SPLIT <LS_PROMPT> AT CL_ABAP_CHAR_UTILITIES=>HORIZONTAL_TAB
      INTO LS_ANSWER_PROMPT-FIELDNAME LS_ANSWER_PROMPT-VALUE.
    INSERT LS_ANSWER_PROMPT INTO TABLE LTH_ANSWER_PROMPT.
  ENDLOOP.

Add lines after above code:

LS_ANSWER_PROMPT-FIELDNAME = '%OUTFILE%'.

LS_ANSWER_PROMPT-VALUE = 'Required_filename'.

INSERT LS_ANSWER_PROMPT INTO TABLE LTH_ANSWER_PROMPT.

Share
10 |10000 characters needed characters left characters exceeded
Ellora Dobbala Dec 20, 2017 at 06:48 PM
0

Thank you Vadim I will check the piece of code. Much appreciated for the quick response

Show 1 Share
10 |10000 characters needed characters left characters exceeded

For Z-program you have to specify all other lines of answer prompt except the line for Output File Name.

0