How do we access the elements for each row after a callSQL in a for-each?
The result from the sqlCall (atom1) is as follows:
<Msg xmlns="urn:com.sap.b1i.vplatform:entity" MessageId="16050320483617163896AC140A05E55F" BeginTimeStamp="20160503204836" logmsg="0000" SubMessageId="" status="success" owntst="true" test="true">
<Header>
<IPO Id="vPlatform_Test"/>
<Sender Id="" ObjId="ECSB1.Conv.Bin.GR"/>
<Receiver Id=""/>
<ReceiverList>
<Receiver Id="" handover="P"/>
</ReceiverList>
<Identification Ident="Void" IdPar="n.a."/>
<nsList/>
<vBIU Id="ECSB1.Conv.Bin.GR" ver="1.0.0" SId="ECSB1.Conv.Bin.GR" filter="" phase=""/>
<Variables>
<var id="userid" value=""/>
<var id="username" value=""/>
</Variables>
<Properties/>
<SysTypeProperties type="B1if" offline="" snd="senderdummy" rcv="receiverdummy" ssystype="" rsystype=""/>
<LocalProperties type="B1if" biu="ECSB1.Conv.Bin.GR" snd="senderdummy" rcv="receiverdummy" sid="ECSB1.Conv.Bin.GR" offline=""/>
<VarProperties/>
</Header>
<Body>
<Payload Role="T" Type="Call"/>
<Payload Role="S">*** no test message specified ***</Payload>
<Payload Role="C" id="atom1" system="0010000104" mode="single" method="Automatic detection by key word(Automatic detection by key word)" plr="4" dbtype="HANA" blockExecution="false" compatibilityMode="true" delimiter=";" sql="select top 2 "Code", "Name", "U_SeqNo", "U_WhsCode", "U_Seg1", "U_Seg2", "U_Seg3", "U_Seg4", "U_ItemCode", "U_Quantity", "U_EaBatSer", "U_BatchSerl", "U_Posted", "U_ErrorMsg" from "@ECSB1PREINV" where "U_EaBatSer" = 'EACH'" disable-output-escaping="false">
<ResultSet xmlns="urn:com.sap.b1i.adapter:jdbcadapter" rowCount="2">
<Row>
<Code>3</Code>
<Name>3</Name>
<U_SeqNo>3</U_SeqNo>
<U_WhsCode>01</U_WhsCode>
<U_Seg1>000</U_Seg1>
<U_Seg2>000</U_Seg2>
<U_Seg3>000</U_Seg3>
<U_Seg4>002</U_Seg4>
<U_ItemCode>03172</U_ItemCode>
<U_Quantity>1</U_Quantity>
<U_EaBatSer>EACH</U_EaBatSer>
<U_BatchSerl>N/A</U_BatchSerl>
<U_Posted>N</U_Posted>
<U_ErrorMsg/>
</Row>
<Row>
<Code>4</Code>
<Name>4</Name>
<U_SeqNo>4</U_SeqNo>
<U_WhsCode>01</U_WhsCode>
<U_Seg1>000</U_Seg1>
<U_Seg2>000</U_Seg2>
<U_Seg3>000</U_Seg3>
<U_Seg4>002</U_Seg4>
<U_ItemCode>03408</U_ItemCode>
<U_Quantity>1</U_Quantity>
<U_EaBatSer>EACH</U_EaBatSer>
<U_BatchSerl>N/A</U_BatchSerl>
<U_Posted>N</U_Posted>
<U_ErrorMsg/>
</Row>
</ResultSet>
</Payload>
</Body>
</Msg>
The xpath expression for the for-each (atom2) is as follows:
/*[/vpf:Msg/vpf:Body/vpf:Payload[./@id='atom1']/jdbc:ResultSet/jdbc:Row]
The result of the for-each (atom2) is pretty much the same as follows:
<Msg xmlns="urn:com.sap.b1i.vplatform:entity" MessageId="16050321004717164837AC140A05A4D3" BeginTimeStamp="20160503210047" logmsg="0000" SubMessageId="" status="success" owntst="true" test="true">
<Header>
<IPO Id="vPlatform_Test"/>
<Sender Id="" ObjId="ECSB1.Conv.Bin.GR"/>
<Receiver Id=""/>
<ReceiverList>
<Receiver Id="" handover="P"/>
</ReceiverList>
<Identification Ident="Void" IdPar="n.a."/>
<nsList/>
<vBIU Id="ECSB1.Conv.Bin.GR" ver="1.0.0" SId="ECSB1.Conv.Bin.GR" filter="" phase=""/>
<Variables>
<var id="userid" value=""/>
<var id="username" value=""/>
</Variables>
<Properties/>
<SysTypeProperties type="B1if" offline="" snd="senderdummy" rcv="receiverdummy" ssystype="" rsystype=""/>
<LocalProperties type="B1if" biu="ECSB1.Conv.Bin.GR" snd="senderdummy" rcv="receiverdummy" sid="ECSB1.Conv.Bin.GR" offline=""/>
<VarProperties/>
</Header>
<Body>
<Payload Role="T" Type="Call"/>
<Payload Role="S">*** no test message specified ***</Payload>
<Payload Role="C" id="atom1" system="0010000104" mode="single" method="Automatic detection by key word(Automatic detection by key word)" plr="4" dbtype="HANA" blockExecution="false" compatibilityMode="true" delimiter=";" sql="select top 2 "Code", "Name", "U_SeqNo", "U_WhsCode", "U_Seg1", "U_Seg2", "U_Seg3", "U_Seg4", "U_ItemCode", "U_Quantity", "U_EaBatSer", "U_BatchSerl", "U_Posted", "U_ErrorMsg" from "@ECSB1PREINV" where "U_EaBatSer" = 'EACH'" disable-output-escaping="false">
<ResultSet xmlns="urn:com.sap.b1i.adapter:jdbcadapter" rowCount="2">
<Row>
<Code>3</Code>
<Name>3</Name>
<U_SeqNo>3</U_SeqNo>
<U_WhsCode>01</U_WhsCode>
<U_Seg1>000</U_Seg1>
<U_Seg2>000</U_Seg2>
<U_Seg3>000</U_Seg3>
<U_Seg4>002</U_Seg4>
<U_ItemCode>03172</U_ItemCode>
<U_Quantity>1</U_Quantity>
<U_EaBatSer>EACH</U_EaBatSer>
<U_BatchSerl>N/A</U_BatchSerl>
<U_Posted>N</U_Posted>
<U_ErrorMsg/>
</Row>
<Row>
<Code>4</Code>
<Name>4</Name>
<U_SeqNo>4</U_SeqNo>
<U_WhsCode>01</U_WhsCode>
<U_Seg1>000</U_Seg1>
<U_Seg2>000</U_Seg2>
<U_Seg3>000</U_Seg3>
<U_Seg4>002</U_Seg4>
<U_ItemCode>03408</U_ItemCode>
<U_Quantity>1</U_Quantity>
<U_EaBatSer>EACH</U_EaBatSer>
<U_BatchSerl>N/A</U_BatchSerl>
<U_Posted>N</U_Posted>
<U_ErrorMsg/>
</Row>
</ResultSet>
</Payload>
</Body>
</Msg>