cancel
Showing results for 
Search instead for 
Did you mean: 

Passing file name to the field

former_member223432
Participant
0 Kudos

Hi,

i have a file to jdbc interface.

I have a requirement of passing the timestamp from the file which i pick from the sender side and pass this to one of the field at the receiver side...can someone help me in doing this,

your help would really be appreciated.,

thanks

Accepted Solutions (1)

Accepted Solutions (1)

markangelo_dihiansan
Active Contributor
0 Kudos

Hello,

I have a requirement of passing the timestamp from the file which i pick from the sender side and pass this to one of the field at the receiver side...can someone help me in doing this,

You can use a UDF(simple Type) for your requirement. Here is the code


DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);

DynamicConfigurationKey key = DynamicConfigurationKey.create(u201Chttp://sap.com/xi/XI/System/Fileu201D,u201CFileNameu201D);

String filename = conf.get(key);
Return filename;

You can use string manipulation for getting the timestamp from the filename e.g substring. Also make sure that in your sender communication channel, the Adapter Specific Message Attributes are checked for FileName.

Hope this helps,

Mark

former_member223432
Participant
0 Kudos

Thanks MArk, problem solved

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

Please try out dynamic configuration, to extract the Timestamp of the source file.

You can refer to the below link for further help.

http://forums.sdn.sap.com/thread.jspa?threadID=2047580

Thanks