cancel
Showing results for 
Search instead for 
Did you mean: 

How to get the particular field name from mapping to comm channel to create filename?

Former Member
0 Kudos

How to get the particular field name from mapping to comm channel to create file name dynamically?

Accepted Solutions (0)

Answers (5)

Answers (5)

Former Member
0 Kudos

Hi Chandra,

Please go through the below blog which explains in step by step .

SAPTechnical.COM - Enable Variable substitution in Receiver File adapter

Regards

Venkat

sahithi_moparthi
Contributor
0 Kudos

Hi Chandra,

Please find the below answer.Still if you have query please post your Structure and the target value you want to populate.

Let us suppose assume that you have a str like below:

      Test(root node)

          -Header

          -Body

             -DocumentHeader

                   DocumentNumber


Then at the target side if you want to cretae the file name with the DocumentNumber then you can go for Variable substitution.Please find the below Screenshots for the same.

Former Member
0 Kudos

Hi Monikandan,

Thanks for the info, but I want to create a file name in target comm channel with mapping input data.

Thanks,

Chandar

former_member192295
Active Contributor
0 Kudos

Hi Chandar,

If file name creating based on mapping input data than Variable substitution is easiest way to create file name.

Muniyappan
Active Contributor
0 Kudos

Hi Chandar,

Adding to monikandan comments.

if the file name is coming xml then you can use variable substitution also.

check this blog for detail http://wiki.scn.sap.com/wiki/display/XI/Dynamic+file+name+and+directory+in+Receiver+File+Adapter+-+s...

Regards,

Muniyappan.

Former Member
0 Kudos

Thanks Maraswamy. blog is useful to my query.

monikandan_p
Active Participant
0 Kudos

Hi Chander,

You can create file name dynamically by below UDF in message mapping.

1. Create a UDF

2. Set Dynamic configuration

UDF will accept two parameters


public String getFileName(Container container, var1 String, var2 String) throws StreamTransformationException{

//For getting filename

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

DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","FileName");

String filename = var1 + var2;

conf.put(key, filename);

return FileName;}

Best Regards,

Monikandan.