Skip to Content
0

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

Feb 28, 2017 at 09:05 AM

274

avatar image

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

10 |10000 characters needed characters left characters exceeded
Former Member

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

0

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

0

Hello SCN experts,

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

Pls respond.

Thanks,

SARIKA

0
* Please Login or Register to Answer, Follow or Comment.

3 Answers

Best Answer
Evgeniy Kolmakov Mar 01, 2017 at 10:56 AM
0

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.

Share
10 |10000 characters needed characters left characters exceeded
Manoj K Feb 28, 2017 at 12:02 PM
0

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

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

Hello Manoj,

Thanks for your response.

No Advantaco or Seeburger in our Landscape...

Thankyou

SARIKA

0
S Sarika Mar 03, 2017 at 07:03 AM
0

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

Share
10 |10000 characters needed characters left characters exceeded