cancel
Showing results for 
Search instead for 
Did you mean: 

How to set dynamic Key Value parameter in Call B1 Object atom

Melvs0104
Discoverer
0 Kudos
213

Hi Expert,

I had a requirement to get the dynamic 'Key Value' of Call B1 Object atom every time the predecessor atom has been initiated by HTTP call. 

I'm using a HTTP Call Inbound Type from Inbound Channel. I need to get the CardCode value generated from atom below. 

<xsl:output method="xml" encoding="UTF-8" indent="yes"></xsl:output>
<xsl:param name="atom"></xsl:param>
<xsl:param name="sessionid"></xsl:param>
<xsl:variable name="msg" select="/vpf:Msg/vpf:Body/vpf:Payload[./@Role=&apos;S&apos;]"></xsl:variable>
<xsl:variable name="vpSender" select="/vpf:Msg/vpf:Header/vpf:Sender/@Id"></xsl:variable>
<xsl:variable name="vpObject" select="/vpf:Msg/vpf:Header/vpf:Sender/@ObjId"></xsl:variable>
<xsl:variable name="vpReceiver" select="/vpf:Msg/vpf:Header/vpf:ReceiverList/vpf:Receiver[./@handover=&apos;P&apos;]/@Id"></xsl:variable>
<xsl:template match="/">
<xsl:variable name="vptsDoc" select="document(&apos;/com.sap.b1i.internal/xml/timestamp&apos;)"></xsl:variable>
<xsl:variable name="vpts" select="concat($vptsDoc/*/@year,&apos;/&apos;,$vptsDoc/*/@month,&apos;/&apos;,$vptsDoc/*/@date,&apos; &apos;,$vptsDoc/*/@hour,&apos;:&apos;,$vptsDoc/*/@minute,&apos;:&apos;,$vptsDoc/*/@second)"></xsl:variable>
<vpf:Msg>
<xsl:copy-of select="/vpf:Msg/@*"></xsl:copy-of>
<xsl:copy-of select="/vpf:Msg/vpf:Header"></xsl:copy-of>
<vpf:Body>
<xsl:copy-of select="/vpf:Msg/vpf:Body/*"></xsl:copy-of>
<vpf:Payload Role="X" id="{$atom}" ts="{$vpts}">
<xsl:call-template name="transform"></xsl:call-template>
</vpf:Payload>
</vpf:Body>
</vpf:Msg>
</xsl:template>
<xsl:template name="transform">
<BusinessPartners>
<row>
<CardCode>
<xsl:value-of select="$msg/bfa:io/bfa:object/bfa:string[./@name=&apos;AccountCode&apos;]"></xsl:value-of>
</CardCode>
<CardName>
<xsl:value-of select="$msg/bfa:io/bfa:object/bfa:string[./@name=&apos;AccountName&apos;]"></xsl:value-of>
</CardName>
<PayTermsGrpCode>
<xsl:value-of select="$msg/bfa:io/bfa:object/bfa:string[./@name=&apos;PaymentTerms&apos;]"></xsl:value-of>
</PayTermsGrpCode>
<FederalTaxID>
<xsl:value-of select="$msg/bfa:io/bfa:object/bfa:string[./@name=&apos;TIN&apos;]"></xsl:value-of>
</FederalTaxID>
</row>
</BusinessPartners>

Call B1 Object.png

 

EunSeok_Bang
Product and Topic Expert
Product and Topic Expert
Hi, would you try #/vpf:Msg/vpf:Body/vpf:Payload[./@id='atom2']/BusinessPartners/row/CardCode?
Melvs0104
Discoverer
0 Kudos

Hi EunSeok,

It perfectly works. Thanks a lot for your help. 

Bear with me as I'm newbie here 🙂

 

Regards

Melvs

Accepted Solutions (0)

Answers (0)