Skip to Content
Author's profile photo Varun Mukund

Dynamic File Name in Multimapping – Standard Solution

Fellow SCNers,

All of us at one point of time in our career as SAP PO consultants would have have faced a requirement needing multimapping and to go with it a need for dynamic file name after multimapping. And at the same time, we would have realized that we cannot assign ASMA using a UDF in case of multimapping.

This blog does not intend to showcase any hidden functionality which makes it possible as it is still not possible to do a 1:N multimapping without using custom solutions. One such solution has been brilliantly showcased by my friend Praveen Gujjeti in A new approach: Multi-mapping Dynamic Configuration using a generic custom module

However, it is possible to do multimapping and Dynamic Configuration in cases of 1:N multimapping if the value of N is known and fixed. I have achieved this to Dynamically assign ASMA values to child messages in case of a 1:5 split.

I would like to mention our colleague and guru Stefan Grube whose blog Unknown use case of DynamicConfigurationBean: Store file name to JMS header without mapping showed me the light for the approach.


In your multimapping program, insert a UDF having the below code snippet. Please note that the you can increase the number of DynamicConfigurationKey objects based on the number of messages you have in your target.

public String putFileName(String inputFileName1, String inputFileName2, String inputFileName3, String inputFileName4, String inputFileName5, Container container) throws StreamTransformationException{

try {

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

  DynamicConfigurationKey key1 = DynamicConfigurationKey.create(““,”Message1”);

  DynamicConfigurationKey key2 = DynamicConfigurationKey.create(““,”Message2”);

  DynamicConfigurationKey key3 = DynamicConfigurationKey.create(““,”Message3”);

  DynamicConfigurationKey key4 = DynamicConfigurationKey.create(““,”Message4”);

  DynamicConfigurationKey key5 = DynamicConfigurationKey.create(““,”Message5”);






  return “”;


catch(Exception e){

return “Could not write filename”;


And then, in your receiver communication channels(Assuming you will have different communication channels to process each of the split messages) you need to maintain the below entries in the module tab.


With the below settings in Module Configuration.


And that’s it!!! The above example pick the value assigned to Dynamic Configuration Key Message3 from mapping to DCJMSMessageProperty0 attribute of the JMS adapter. Similar thing can be done for the attributes of File adapter to dynamically name the files at receiver end.

Assigned tags

      You must be Logged on to comment or reply to a post.
      Author's profile photo Eng Swee Yeoh
      Eng Swee Yeoh

      Hi Varun

      Thanks for sharing this concept, nice idea! 😉

      Just to add on, it is possible to achieve this without custom module solution even if N in the 1:N multimapping is dynamic. Check out the approach I have wrote about below:-

      Multi-mapping with Dynamic Configuration - SOAP loopback approach


      Eng Swee

      Author's profile photo Varun Mukund
      Varun Mukund
      Blog Post Author

      Hi Eng Swee Yeoh

      I'm wondering whether an XSL transformation using the MessageTransformBean could do the trick. I'm feeling too lazy today to try this out, but theoretically I believe it should work. What say?

      Author's profile photo Eng Swee Yeoh
      Eng Swee Yeoh

      Hi Varun

      I'm not really an XSL guy but it might be possible. Try it out on one of your non-lazy days and let us know how it goes. If it works, it will be quite worthy of a blog post 😉


      Eng Swee

      Author's profile photo Ganesh Gullipalli
      Ganesh Gullipalli

      Hi Varun,

      Thanks for sharing i got knowledge on handle multiple filenames.but had doubt that,

      Can we do the same in single JMS channel that will holds each values in Header for each message split. your help much appreciated .

      Thanks in advance ..