Quantcast
Channel: SCN : All Content - All Communities
Viewing all articles
Browse latest Browse all 3184

For-Each After Call SQL

$
0
0

How do we access the elements for each row after a callSQL in a for-each?

 

2016-05-03 at 9.46 PM.png

 

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 &quot;Code&quot;, &quot;Name&quot;, &quot;U_SeqNo&quot;, &quot;U_WhsCode&quot;, &quot;U_Seg1&quot;, &quot;U_Seg2&quot;, &quot;U_Seg3&quot;, &quot;U_Seg4&quot;, &quot;U_ItemCode&quot;, &quot;U_Quantity&quot;, &quot;U_EaBatSer&quot;, &quot;U_BatchSerl&quot;, &quot;U_Posted&quot;, &quot;U_ErrorMsg&quot;  from &quot;@ECSB1PREINV&quot;  where  &quot;U_EaBatSer&quot; = '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 &quot;Code&quot;, &quot;Name&quot;, &quot;U_SeqNo&quot;, &quot;U_WhsCode&quot;, &quot;U_Seg1&quot;, &quot;U_Seg2&quot;, &quot;U_Seg3&quot;, &quot;U_Seg4&quot;, &quot;U_ItemCode&quot;, &quot;U_Quantity&quot;, &quot;U_EaBatSer&quot;, &quot;U_BatchSerl&quot;, &quot;U_Posted&quot;, &quot;U_ErrorMsg&quot;  from &quot;@ECSB1PREINV&quot;  where  &quot;U_EaBatSer&quot; = '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>



Viewing all articles
Browse latest Browse all 3184

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>