cancel
Showing results for 
Search instead for 
Did you mean: 

SAP Integration Suite; Iterate over Value and write it into other Value in Message Mapping

filipagatic
Explorer
0 Kudos

Hello together,

i have an issue regarding the message mapping.
I want to map every single value of "name" into Produkt1,Produkt2 and so on. 

filipagatic_0-1708964058355.png

filipagatic_1-1708964105209.png

Is there a way to get the solution through a combination of node functions? I already tried nearly every combination but i didnt get any working solution.

The results from the simulation always are like this but i need different values for every produkt entry.

filipagatic_3-1708964310711.png

Thanks in advance. 

Best regards

Filip Agatic

MartyMcCormick
Product and Topic Expert
Product and Topic Expert
0 Kudos
Hello-It's not to me what the target payload is. Is there a 1:1 relationship between Name and Produkt? Can you show a mockup of what you expect the target record to be?

Accepted Solutions (1)

Accepted Solutions (1)

Ryan-Crosby
Active Contributor
0 Kudos

You wouldn't use graphical mapping for this because it's static (if your map has up to produkt4, but then your list has 5 entries it fails and you need a software update).  You need to use XSLT for something like this where you can dynamically set the element name based on an index.

 

Regards,

Ryan Crosby

filipagatic
Explorer
0 Kudos

Thanks.. Now i have splitted the message into dynamic and static mapping. The payload after xslt script mapping looks like this now:

<Produkt1>631-00015-00</Produkt1>
<Produkt2>661-00003-00</Produkt2>
<Produkt3>660-00000-00</Produkt3>
<Produkt4>803-130000-0001</Produkt4>

How can i now combine this payload with the payload of the static message mapping? Usage of content modifier?

Thanks for your help.

best regards

MartyMcCormick
Product and Topic Expert
Product and Topic Expert
0 Kudos
I think Ryan was suggesting to map the entire payload using XSLT. But if you have mapped the records to have a maximum of 4 Produkts per records so the visual mapping won't fail, you can use the graphical mapping after the xslt step. Each record should be bound 1...4 from a product perspective right? Thanks, Marty
filipagatic
Explorer
0 Kudos

The incoming message contains too many values to map them in a simple xslt script. The point is that the amount of the products can vary. The script is working quite good, i just need to put the payload in to the payload which will be created after the static mapping which is processed in a different route.

filipagatic_0-1709030144941.png

 

Ryan-Crosby
Active Contributor
0 Kudos
@filipagatic you would need to use gather and join, which for different XML formats is only a concatenation. In order to join at a specific place you would need a final mapping to combine the data, which also requires comparable keys in both XML outputs.
filipagatic
Explorer
0 Kudos

@Ryan-Crosby  This is my payload after the join and gather: But i want to store the values for Produkts right under   <PaleteHhe>0</PaleteHhe> and not separate. How can i achieve this?

<YY1_KLASSIFIZIERUNG>
    <YY1_KLASSIFIZIERUNGType>
        <ProduktID>TSI6K3DTSB6</ProduktID>
        <SAP_Description>Tigo EI Heimspeichersystem: TSI-6K3D Hy</SAP_Description>
        <Produktgruppe>Speicherpakete</Produktgruppe>
        <Hersteller>Tigo</Hersteller>
        <NutzbareBatteriekapazitt_V>5.58</NutzbareBatteriekapazitt_V>
        <NutzbareBatteriekapazitt_U>kWh</NutzbareBatteriekapazitt_U>
        <NutzbareBatteriekapazitt1_V>5.58</NutzbareBatteriekapazitt1_V>
        <NutzbareBatteriekapazitt1_U>kWh</NutzbareBatteriekapazitt1_U>
        <MPPTracker>2</MPPTracker>
        <Notstromversorgunggeeignet>has_emergency_power</Notstromversorgunggeeignet>
        <WRKategorie>Hybridfähig</WRKategorie>
        <phasig>has_3_phase</phasig>
        <Geruschemission_V>31.0</Geruschemission_V>
        <Geruschemission_U>dba</Geruschemission_U>
        <Zelltechnologie>Lithium-Eisenphosphat (LFP)</Zelltechnologie>
        <TYPAfrSpeicher>false</TYPAfrSpeicher>
        <TYPBfrSpeicher>false</TYPBfrSpeicher>
        <VerfgbarkeitinDeutschlandNie>true</VerfgbarkeitinDeutschlandNie>
        <VerfgbarkeitinPolen>false</VerfgbarkeitinPolen>
        <VerfgbarkeitinNorwegenTNGrid>false</VerfgbarkeitinNorwegenTNGrid>
        <VerfgbarkeitinNorwegenITGrid>false</VerfgbarkeitinNorwegenITGrid>
        <VerfgbarkeitinDnemark>false</VerfgbarkeitinDnemark>
        <VerfgbarkeitinSchweden>false</VerfgbarkeitinSchweden>
        <VerfgbarkeitinFinnland>false</VerfgbarkeitinFinnland>
        <VerfgbarkeitinNiederlande>false</VerfgbarkeitinNiederlande>
        <ItemsproGLSPackage>0</ItemsproGLSPackage>
        <ItemsproVPE>0</ItemsproVPE>
        <VPEFaktor>0</VPEFaktor>
        <SingleFaktor>0</SingleFaktor>
        <GLSVerfgbarkeit>false</GLSVerfgbarkeit>
        <IstLanggut>false</IstLanggut>
        <IstAdr>false</IstAdr>
        <FullPalettefrom>0</FullPalettefrom>
        <PaletteLnge>0</PaletteLnge>
        <PaletteBreite>0</PaletteBreite>
        <PaleteHhe>0</PaleteHhe>
    </YY1_KLASSIFIZIERUNGType>
    <YY1_KLASSIFIZIERUNGType>
        <Produkt1>601-1306K0-0001</Produkt1>
        <Produkt2>661-00003-00</Produkt2>
        <Produkt3>660-00000-00</Produkt3>
        <Produkt4>803-130000-0001</Produkt4>
    </YY1_KLASSIFIZIERUNGType>
</YY1_KLASSIFIZIERUNG>

Btw this is an example xml after the xslt script, so it is the same format as the message from the message mapping?
 
<?xml version="1.0" encoding="UTF-8"?>
<YY1_KLASSIFIZIERUNG>
    <YY1_KLASSIFIZIERUNGType>
        <Produkt1>S6-EH3P6K-H-EU</Produkt1>
        <Produkt2>13035737-00</Produkt2>
        <Produkt3>13035738-00</Produkt3>
    </YY1_KLASSIFIZIERUNGType>
</YY1_KLASSIFIZIERUNG>


Thanks in advance.
 
 
Ryan-Crosby
Active Contributor
0 Kudos
@filipagatic what did you put for your combination algorithm for the XPath?
filipagatic
Explorer
0 Kudos

@Ryan-Crosby i tried it with simple combine without XPath and also with different variations for XPath expressions but i cant get it working. 

I mean there are not many options for XPath, i just have YY1_KLASSIFIZIERUNG or
YY1_KLASSIFIZIERUNGType but maybe my combination is always wrong.. here is one example: 

filipagatic_0-1709046187662.png

 

Ryan-Crosby
Active Contributor

@filipagatic you can use the following XPath, but it will only work if you are combining XML with single entities for YY1_KLASSIFIZIERUNGType. If you were to use a message with repeating entities for YY1_KLASSIFIZIERUNGType then you would need to break up your processing with a splitter. See the image for an example that works for single entity joining.

Screenshot 2024-02-27 at 10.28.17.png

filipagatic
Explorer
0 Kudos

@Ryan-Crosby Thanks for your help. I have done it now a little bit different but it is working like i want it to work.

filipagatic_0-1709114892727.png

Best regards

Answers (2)

Answers (2)

filipagatic
Explorer
0 Kudos

Hello Marty,

i have now made a dynamic mapping with xslt script and one static as i have replied to Ryan. Now i just need to combine the two messages and then i would have the solution.

best regards

filipagatic
Explorer
0 Kudos

Hello, 

the target payload will be posted into a simple custom business object which will contain data about product bundles.

filipagatic_0-1708980416831.png

The names of the products that are in the bundle are stored in root/articles/product_list/name as i have shown in my screenshot. I need every single value of name so that i can post them into Produkt1, 2,3 and 4.

Best regards
Filip