Skip to Content

Export File with dynamic date DD/MM/YY

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?

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Best Answer
    Dec 20, 2017 at 03:39 PM

    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.

    Add comment
    10|10000 characters needed characters exceeded

  • Dec 20, 2017 at 06:48 PM

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

    Add comment
    10|10000 characters needed characters exceeded