Skip to Content

How to add Date only in receiver channel(File in Target system should be filename_Date )

Hi SCN ppl,

From PI a file is been sent to receiver with filename as FILENAME_DATE_TIMESTAMP. Now I dont want timestamp only need date.

This is a pass through scenario. FileSender Channel uses NFS protocol and and receiver File Channel also uses NFS protocol.

I have checked in SCN on this and I could find that we can create dummy objects in ESR and import Java mapping or using Run operating system command.

Even variable sustitution ,but if the current date exists in payload then only we can use variable sustitution right.

Which is the best option to go with and how?

Any suggestions pls.

Thankyou

SARIKA

Add comment
10|10000 characters needed characters exceeded

  • Hi Sarika,

    There are total 3 options -

    1) Using dummy ESR you can use Java mapping.

    2) Custom module , but not recommended to use Java stack application module deployment for a single scenario which can be done through other options as well.

    3) As its is NFS, you can use OS command as well.

    Thanks,

    Apu

  • Hi Apu,

    If i go for OS command what exactly can be written their for the filename to be sent as filename_date .

    Any suggestions plsss..

    Thanks,

    SARIKA

  • Hello SCN experts,

    Can I know how to use OS command for changing the filename format as FILENAME_DATE.

    Pls respond.

    Thanks,

    SARIKA

  • Get RSS Feed

3 Answers

  • Best Answer
    Mar 01, 2017 at 10:56 AM

    Hi Sarika!

    You could use script to rename your target file.

    I'm not much experienced in shell scripts, but I had similar scenario where I used "Run OS command after message processing" in receiver file adapter.

    For Unix system script like this:

    #!/bin/bash
    SRC="${1}"
    BASE="${1##*/}"
    NEW=${1%/*}'/'${BASE%_*}'.'${BASE##*.}
    mv $SRC $NEW

    will rename your target file removing the part starting from last underscore.

    Calling syntax should look like:

    /your/bash/script/path/script.name %F

    where %F is absolute target file name, provided by file adapter.

    Regards, Evgeniy.

    Add comment
    10|10000 characters needed characters exceeded

  • Feb 28, 2017 at 12:02 PM

    Sarika,

    You may use the custom module :

    https://blogs.sap.com/2015/02/05/dynamicattributechangebean-the-no-mapping-solution-to-changing-dynamic-configuration-dynamically/

    Or do you have Advantaco or Seeburger in your landscape ?

    Br,

    Manoj

    Add comment
    10|10000 characters needed characters exceeded

  • Mar 03, 2017 at 07:03 AM

    Hi ,

    We have used counter option in file construction and set the counter to 0000 as receiver channel is NFS transport protocol.

    And we achived filename as filename_datestamp.

    thanks

    sarika

    Add comment
    10|10000 characters needed characters exceeded