Skip to Content

SAP B1 Integration framework : add sales order (http restful) scenario not returning document number

I'm working on sap b1 integration framework.My objective is to create a http restful api for posting sales order and it should return the created document number as response.I have created the scenario and it is returning the docEntry as response.but instead of this I would like to return the document number as response

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Best Answer
    Mar 11 at 06:43 AM

    Hi,

    You should transform the Final atom with the required output.

    You can use the Call Atom's result at the Final atom.

    For example, try the below transform snippet for Final atom.

    <xsl:template name="transform">
        <io xmlns="urn:com.sap.b1i.bizprocessor:bizatoms" pltype="json">
           <object>
               <xsl:variable name="DImessage" select="/vpf:Msg/vpf:Body/vpf:Payload[./@id='CallB1']/Envelope/Header"/>
               <string name="Result"><xsl:value-of select="$DImessage/ActionResult"/></string>
               <string name="ActionMessage"><xsl:value-of select="$DImessage/ActionMessage"/></string>
           </object>
        </io>
    </xsl:template>

    In order to get the other details related to the created object like DocNum, you should use the response at the "Call SQL" atom and use the output of "Call SQL" atom at the Final atom.

    Regards,

    Bala

    Add comment
    10|10000 characters needed characters exceeded

  • Mar 12 at 09:06 PM

    Hi,

    Following snippet works for me

    <xsl:variable name="DIMessage" select="/vpf:Msg/vpf:Body/vpf:Payload[./@id='atom1']"></xsl:variable>
    Select DocNum from ORDR WHERE DocEntry = <xsl:value-of select="$DIMessage/@DImsg"></xsl:value-of>
    

    Regards,

    Bala

    Add comment
    10|10000 characters needed characters exceeded

    • Payload id="atom3" Role="C" method="Automatic detection by key word(Automatic detection by key word)" system="001sap0005" disable-output-escaping="false" sql="/vpf:Msg/vpf:Body/vpf:Payload[./@id='atom4']/xpath" commitMode="2PC" delimiter=";" compatibilityMode="true" blockExecution="false" dbtype="SQL" plr="4" mode="single">-<SqlExceptions xmlns="urn:com.sap.b1i.adapter:jdbcadapter">-<SqlException><ErrorCode>102</ErrorCode><Message>Incorrect syntax near '/'.</Message><SqlState>S0001</SqlState></SqlException></SqlExceptions></Payload>

      this error is getting in debug final atom