cancel
Showing results for 
Search instead for 
Did you mean: 

MultiMapping (ASMA) Dynamic Configuration -MultiMapping New Approach Praveen Gujjeti Blog

Former Member
0 Kudos

Hi All,

My requirement is to genrate multiple files from a single source file

I used multimapping for this scenario, however when we used dynamic ocnfiguration to generate file names, only the last value is appended to file name for all the files which got created as part of multimapping

so deployed the custom module avaible from praveen gujjeti blog - the new approach to multimapping and I have enhanced the target structure as per th blog

the receiver channel audit logs shows successfull but no file name is generated with mapped source value

The modules audit logs shows it is genrating multiple files with custom header structure and removing the header as it is not needed by receiving system but its not creating the file names as needed and which is main intension of this module

Questions:

1) Do we need dynamic configuration to be used in mapping between source and the "DCTechnicalName" field, if so it is still taking the last value from the source field for all the target file names

2)if we do not need dynamic configuration in mapping and ASMA to be checked in receiver channel, how does the filename is generated from the "DCTechnicalName" the custom module does not creates the file name reading the value from " DCTechnicalName"

http://scn.sap.com/community/pi-and-soa-middleware/blog/2014/03/05/a-new-approach-multi-mapping-dyna...

Accepted Solutions (0)

Answers (1)

Answers (1)

former_member181985
Active Contributor
0 Kudos

Hi Sruthi,

From your mapping snap shot it is not clear how the whole transformed multi payload is.

Paste or Attach the transformed payload from mapping with atleast two child messages in target structure

//BR,

Praveen Gujjeti

Former Member
0 Kudos

Thank you for the response Praveen

Please find the mapping screen shots with source and target results

Questions:

1) How will the filename will be generated, i mean how is the value from the custom generated header field ("DCTechnicalName") is read and appended to each of the multiple target filenames

- earlier when using dynamic configuration in mapping, we select filename in ASMA and this file name is appended reading the value from dynamic configuration in mapping, but how does it works in this scenario

2) I see the module is generating multiple files with different filenames in audit log but not when the file is generated, it still generates the last value of the source field to all the target generated files

3) No Dynamic configuration used in mapping and the ASMA file is unchecked, if I use DC and ASMA file checked the use of custom module will be obsolete ?


SOURCE Mapping XML:-


<?xml version="1.0" encoding="UTF-8"?>

      <ns1:MT_Multimap_Test xmlns:ns1="http://cf.com/test">

         <Row>

            <Name>Sruthi</Name>

            <Address>Test</Address>

            <ContactNo>123456789</ContactNo>

            <City>Test</City>

            <State>Test</State>

            <Zip>000000</Zip>

         </Row>

         <Row>

            <Name>Praveen</Name>

            <Address>Test</Address>

            <ContactNo>123456789</ContactNo>

            <City>Test</City>

            <State>Test</State>

            <Zip>000000</Zip>

         </Row>

         <Row>

            <Name>Pavan</Name>

            <Address>Test</Address>

            <ContactNo>123456789</ContactNo>

            <City>Test</City>

            <State>Test</State>

            <Zip>000000</Zip>

         </Row>

      </ns1:MT_Multimap_Test>

TAREGT Mapping XML:-

<ns0:Messages xmlns:ns0="http://sap.com/xi/XI/SplitAndMerge">

   <ns0:Message1>

      <ns1:MT_Receiver xmlns:ns1="http://Test.com/test">

         <DCHeader>

            <DCRecord>

               <DCValue DCNameSpace="http://sap.com/xi/XI/System/File" DCTechnicalName="Sruthi"/>

            </DCRecord>

         </DCHeader>

         <DT_Multimap_Test>

            <Row>

               <Name>Sruthi</Name>

               <Address>Test</Address>

               <ContactNo>123456789</ContactNo>

               <City>Test</City>

               <State>Test</State>

               <Zip>000000</Zip>

            </Row>

         </DT_Multimap_Test>

      </ns1:MT_Receiver>

      <ns1:MT_Receiver xmlns:ns1="http://Test.com/test">

         <DCHeader>

            <DCRecord>

               <DCValue DCNameSpace="http://sap.com/xi/XI/System/File" DCTechnicalName="Praveen"/>

            </DCRecord>

         </DCHeader>

         <DT_Multimap_Test>

            <Row>

               <Name>Praveen</Name>

               <Address>Test</Address>

               <ContactNo>123456789</ContactNo>

               <City>Test</City>

               <State>Test</State>

               <Zip>000000</Zip>

            </Row>

         </DT_Multimap_Test>

      </ns1:MT_Receiver>

      <ns1:MT_Receiver xmlns:ns1="http://Test.com/test">

         <DCHeader>

            <DCRecord>

               <DCValue DCNameSpace="http://sap.com/xi/XI/System/File" DCTechnicalName="Pavan"/>

            </DCRecord>

         </DCHeader>

         <DT_Multimap_Test>

            <Row>

               <Name>Pavan</Name>

               <Address>Test</Address>

               <ContactNo>123456789</ContactNo>

               <City>Test</City>

               <State>Test</State>

               <Zip>000000</Zip>

            </Row>

         </DT_Multimap_Test>

      </ns1:MT_Receiver>

   </ns0:Message1>

</ns0:Messages>

FINAL OUTPUT:-

1)

<?xml version="1.0" encoding="UTF-8" ?>

- <ns1:MT_Receiver xmlns:ns1="http://Test.com/test">

- <DT_Multimap_Test>

- <Row>

<Name>Sruthi</Name>

<Address>Test</Address>

<ContactNo>123456789</ContactNo>

<City>Test</City>

<State>Test</State>

<Zip>000000</Zip>

</Row>

</DT_Multimap_Test>

</ns1:MT_Receiver>


2)


<?xml version="1.0" encoding="UTF-8" ?>

- <ns1:MT_Receiver xmlns:ns1="http://Test.com/test">

- <DT_Multimap_Test>

- <Row>

<Name>Praveen</Name>

<Address>Test</Address>

<ContactNo>123456789</ContactNo>

<City>Test</City>

<State>Test</State>

<Zip>000000</Zip>

</Row>

</DT_Multimap_Test>

</ns1:MT_Receiver>


3)


<?xml version="1.0" encoding="UTF-8" ?>

- <ns1:MT_Receiver xmlns:ns1="http://Test.com/test">

- <DT_Multimap_Test>

- <Row>

<Name>Pavan</Name>

<Address>Test</Address>

<ContactNo>123456789</ContactNo>

<City>Test</City>

<State>Test</State>

<Zip>000000</Zip>

</Row>

</DT_Multimap_Test>

</ns1:MT_Receiver>

Former Member
0 Kudos

you need to enable the ASMA to populate the filename based on the Praveen's code.

Map the DCTechnical Name to constant - Filename , so your mapping output should be

           <DCValue DCNameSpace="http://sap.com/xi/XI/System/File" DCTechnicalName="FileName">test file</DCValue>


Code will take the input parameters DCtechnical and DC namespace from the mapping and set the values accordingly...

former_member181985
Active Contributor
0 Kudos

Please follow Ramkumar's point.

           <DCValue DCNameSpace="http://sap.com/xi/XI/System/File" DCTechnicalName="FileName">test file.xml</DCValue>




I will update my blog with an example payload for Reader's better understanding


Best Regards,

Praveen Gujjeti

Former Member
0 Kudos

Work perfect for both XML & EDI seeburger schemas

Cheers to Praveen !!!