cancel
Showing results for 
Search instead for 
Did you mean: 

How to remove ":" in file name while using Variable substution

Former Member
0 Kudos

Hi ALL

I am using file adapter and I what to create file name dynamically by acesssing PO number and time stamp from the payload using variable substution.

But the problem is I am getting ":" in time stamp field value and it is not acceptable for file name .

So could you please tell me a way that I can remove this ":" from that particular field value and create the file name dynamically.

Note 1)Add Time stamp option will not help me as we require a time stamp of particular zone.

2) Dynamic Configuration code is also not use full as I am using 1:n file creation

Accepted Solutions (0)

Answers (3)

Answers (3)

udo_martens
Active Contributor
0 Kudos

Hi,

the best approach is to use a operating system command after execution to rename the file.

Regards,

Udo

Former Member
0 Kudos

Hi Martens

Thanks for you response.

This renaming will only works after file has been created.But not before file creation.

Windows file system will not allow this file which has ":" to be created.

Regards

Prasanna Kumar

Former Member
0 Kudos

Hi!

Maybe you can work with variables in a separate message mapping (just position it right after your java mapping in your operation mapping defintion) to create an "extra field" containing the time stamp w/o ":".

Regards,

Volker

Former Member
0 Kudos

Hi Prasanna,

may be just remove ':' symbol from time field during message mapping phase, and then get updated field during variable substitution.

Regards,

Dmitriy

Former Member
0 Kudos

Hi Dmitriy

Ya that will solve my problem but the requirement is that the time stamp should contian ":" in target payload field.And this is not acceptable in the file name.

I am using Java mapping to call Multiple bapis ( say around 3 BAPI's) and all these data is Mapped to target xml files (i.e 1:n) .So here I can not use Dynamic Configuration code also because as it is 1:N mapping (It is throwing exception JCO Call "System Failure").

If there is any other way please suggest me.

Regards

Prasanna Kumar .

Shabarish_Nair
Active Contributor
0 Kudos

>

> Hi ALL

>

> I am using file adapter and I what to create file name dynamically by acesssing PO number and time stamp from the payload using variable substution.

> But the problem is I am getting ":" in time stamp field value and it is not acceptable for file name .

> So could you please tell me a way that I can remove this ":" from that particular field value and create the file name dynamically.

>

> Note 1)Add Time stamp option will not help me as we require a time stamp of particular zone.

> 2) Dynamic Configuration code is also not use full as I am using 1:n file creation

does the time stamp with the ":" a part of your output file?

else use a replaceAll function in your mapping and replace the : with empty string then use the value in the variable substitution

Another option is use the normal BPM for 1: N message flow. The use a simple java mapping that will introduce a dynamic configuration and you can create the file name as you want. the java mapping will be used in the flow of messages from BPM to target system.

ref: /people/shabarish.vijayakumar/blog/2009/03/26/dynamic-configuration-vs-variable-substitution--the-ultimate-battle-for-the-file-name

Former Member
0 Kudos

Hi Shabarish,

Could you please eloborate your BPM solution as it is not clear for me.

Note: I am already using Java mapping to call Multiple bapis ( say around 3 BAPI's) and all these data is Mapped to target xml files (i.e 1:n) .So here I can not use Dynamic Configuration code also because as it is 1:N mapping (It is throwing exception JCO Call "System Failure").

Regards

Prasanna Kumar

Shabarish_Nair
Active Contributor
0 Kudos

the approach what i suggest is to have a BPM which will have your 1:N transformation.

then outside the BPM before transferring to your target you can have a mapping which will set the Dynamic configuration - file name. This mapping can be something that will just take your input payload and pass it out to an outputstream but handle your dynamic configuration