cancel
Showing results for 
Search instead for 
Did you mean: 

Receiver File Name assign dynamically

Former Member
0 Kudos

Hi friends,

In our scenario, receiver file name is assigned to dynamically. Example Inventory_Current date. Inventory is static, but CurrentDate is changed on runtime.

I was tried to Variable substitution method and UDF method. In this type dynamic value is mapped to target structure, so Receiver payload shows the dynamic value in output file. But we don't need that dynamic value. So, in variable substitution method and UDF method is not achived to my requirement.

Please any one help me how to change file name at runtime (receiver communication channel). If using any module program pls forward to me.

Thanks & Regards

Vijay

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi,

if we want to get the Output file name as One of the Field value from Payload and Current dase with it means,

1) Write one UDF & map Like this

Name(giri)-----UDFCurrent Date----MT_Target

2) Check the ASMA Option in Receiver Adapter Aloneu2026..

3)No need to check the ASMA Option in the Sender side

UDF Code:

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

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

String Outputfile = conf.put(key,a);

return Outputfile;

Regards

Seshagiri

Former Member
0 Kudos

Hi Seshagiri,

Without mapping how to do? Because using mapping, the filed comes receiver payload also. But we don't need that value on receiver payload.

Thanks & Regards

Vijay

dharamveer_gaur2
Active Contributor
0 Kudos

use this similar thread

Former Member
0 Kudos

HI Vijaya

using UDF you can set the Dynamic Configuration Filename and at receiver channel just use adapter specific attributes and it should pass the value.

UDF should set value of filename as Inventory_CurrentDate. pass Inventory value and current date to UDF.

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

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

String filename = Inventory_CurrentDate;

conf.put(key, filename);

If you explain me y you are not able to pass this value we can solve this.

Thanks

Gaurav Bhargava

Former Member
0 Kudos

Hi Gaurav Bhargava,

You say, In UDF method no need to map on receiver attribute. Is it correct. Please tell me, step by step how to do?

Thanks & Regards

Vijay

Former Member
0 Kudos

HI Vijaya

1. create UDF in mapping

2. pass inventory value and current date to UDF with any data that you have to map to the receiver side

UDF return the other mapping value.

ex- you pass a, inventory, currentdate

Aim is to do conf.put(key, Filename) and return a.

this will set the Filename to Dynamic and you can pass the value a to the required field in mapping.

3. Use Adapter attributes in receiver as well

Thanks

Gaurav

Former Member
0 Kudos

Hi Gaurav Bhargava,

Sorry, In my requirment is without mapping. Because using mapping, the filed comes receiver payload also. But we don't need that value on receiver payload.

Thanks & Regards

Vijay

former_member181985
Active Contributor
0 Kudos

Hi Vijaya,

Since there is no mapping in your requirement you can use java mapping by passing the source stream to target stream without any modification and at the same time you can dynamically set the Filename using dynamic configuration.

Thanks,

Gujjeti.