cancel
Showing results for 
Search instead for 
Did you mean: 

Access interface related entries from within Receiver Communication Channel

former_member188019
Active Participant
0 Kudos

Hi,

when i open the interface determintation that i created, i can see.

Sender Details: Communication Component:Sys_Sample_One_D Interface: UserMasterQuery_Outb Namespace: urn:sample.com:I_Legacy_JDBC_Application Receiver Details: Communication Component:Sys_Sample_Two_D Interface:EmployeeEmailProcessing_Inb Namespace:urn:sample.com:I_Legacy_FileApplication Interface Mapping: UserMasterResultset_to_EmployeeEmail

I created a Generic File Receiver communication Channel for my receiver BS: CC_FileReceiver

In the target FileName field of the Communication channel, i would not like to hardcode any filename value, but my requirement is, the filename should be the same as the name of the Receiver Interface, that has been used in the message exchange.

in my case, it should be something like EmployeeEmailProcessing_Inb.xml

How can we access dynamically the interface related entries in the Communication channel, and how can we set those values in the Target Filename value of the File Receiver communication channel.

in short, if i use the same communication channel for other scenario, the received filename should be different based on the receiver interface name that is executed.

It would be even more better if i could access/set the receiver namespace value as part of the TargetFileName or TargetFileDirectory values.

pls let me know how this can be possible.

Thanks in advance,

Madhu

Accepted Solutions (0)

Answers (1)

Answers (1)

Shabarish_Nair
Active Contributor
0 Kudos

you can easily use dynamic configuration to achieve this.

to get your interface name, you can access the runtime constants and pass it to the dynamic configuration and write out your file name

http://help.sap.com/saphelp_nw04/helpdata/en/b3/9a2aeb24dc4ab6b1855c99157529e4/frameset.htm

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

former_member188019
Active Participant
0 Kudos

Hi Shabarish,

thanks for your blog.

After i saw the blog, the UDF can be created in ESR.


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

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

String MyFileName = a + "_" + b +".xml";
conf.put(key, myFileName); 

At this point, i can see that the required value is stored in certain key in the DynamicConfiguration.

In the blog, i could not see anything related to ID.

My question is, what do we need to do ID,

when we create the FileReceiver Communication Channel, in that we need to specify the mandatory field "Source File Name". what value do we need to enter here.

Are there any additional things do we need to do in Communication Channel in ID.

Shabarish_Nair
Active Contributor
0 Kudos

in ID, in the communication channel check the option Adapter specific message attributes -> File Name

in the actual file name parameter you can enter any dummy name which will be over written using the dynamic code during runtime...

Former Member
0 Kudos

Hi,

Just put % in the Source File name field.

Regards,

Divya

former_member200962
Active Contributor
0 Kudos

In the Communication Channel you can fill any value in the SourceFileName field...can be anything even your name....it wont matter......same logic to be followed when you use Dynamic Configuration for other adapters (like Target URL of SOAP Channel).

Regards,

Abhishek.