Skip to Content

Add BP (DI Error: (-5002) Code undefined ) -B1if

Dear All,

Task Name : DB to B1 B1if.

I created One Table in my Source SAP. I need to add/Update Record to another B1 System. I read that and follow Db to B1 B1if.pdf .but i am getting below error.

Add BP (DI Error: (-5002) Code undefined ).

atom0 Code

<?xml version="1.0" encoding="UTF-8"?><xsl:stylesheet xmlns:b1e="urn:com.sap.b1i.sim:b1event" xmlns:b1ie="urn:com.sap.b1i.sim:b1ievent" xmlns:b1im="urn:com.sap.b1i.sim:b1imessage" xmlns:bfa="urn:com.sap.b1i.bizprocessor:bizatoms" xmlns:jdbc="urn:com.sap.b1i.adapter:jdbcadapter" xmlns:js="com.sap.b1i.bpc_tools.Javascript" xmlns:rfc="urn:sap-com:document:sap:rfc:functions" xmlns:sim="urn:com.sap.b1i.sim:entity" xmlns:uplt="urn:com.sap.b1i.xcellerator:upltdoc" xmlns:utils2="com.sap.b1i.bpc_tools.Utilities" xmlns:vpf="urn:com.sap.b1i.vplatform:entity" xmlns:xci="urn:com.sap.b1i.xcellerator:intdoc" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" bfa:force="" vpf:force="" jdbc:force="" rfc:force="" b1ie:force="" b1e:force="" xci:force="" sim:force="" utils2:force="" b1im:force="" uplt:force="" js:force=""><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='S']"></xsl:variable><xsl:variable name="vptsDoc" select="document('/com.sap.b1i.internal/xml/timestamp')"></xsl:variable><xsl:variable name="vpts" select="concat($vptsDoc/*/@year,'/',$vptsDoc/*/@month,'/',$vptsDoc/*/@date,' ',$vptsDoc/*/@hour,':',$vptsDoc/*/@minute,':',$vptsDoc/*/@second)"></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='P']/@Id"></xsl:variable><xsl:variable name="vpDBInSysId" select="/vpf:Msg/vpf:Header/vpf:Properties/vpf:prop[./@id='DBInSysId']/@value"></xsl:variable><xsl:template match="/"> <Msg xmlns="urn:com.sap.b1i.vplatform:entity"> <xsl:copy-of select="/vpf:Msg/@*"></xsl:copy-of> <xsl:copy-of select="/vpf:Msg/vpf:Header"></xsl:copy-of> <Body> <xsl:copy-of select="/vpf:Msg/vpf:Body/*"></xsl:copy-of> <Payload Role="R" id="{$atom}" ts="{$vpts}"> <xsl:call-template name="transform"></xsl:call-template> </Payload> </Body> </Msg> </xsl:template><xsl:template name="transform"> <b1im_multimsg> <xsl:for-each select="/vpf:Msg/vpf:Body/vpf:Payload[./@id='atom1']/jdbc:ResultSet/jdbc:Row"> <b1im_msg> <B1out type="object"> <BOM> <BO> <AdmInfo> <Object>2</Object> <Version>1</Version> </AdmInfo> <BusinessPartners> <QueryParam> <CardCode><xsl:value-of select="/vpf:Msg/vpf:Body/vpf:Payload[./@id='atom1']/jdbc:ResultSet/jdbc:Row/jdbc:Code/text()"></xsl:value-of></CardCode> </QueryParam> <row> <CardCode><xsl:value-of select="/vpf:Msg/vpf:Body/vpf:Payload[./@id='atom1']/jdbc:ResultSet/jdbc:Row/jdbc:Code/text()"></xsl:value-of></CardCode> <CardName><xsl:value-of select="/vpf:Msg/vpf:Body/vpf:Payload[./@id='atom1']/jdbc:ResultSet/jdbc:Row/jdbc:Name/text()"></xsl:value-of></CardName> <CardType>S</CardType> <Notes>Created By B1if</Notes> </row> </BusinessPartners> </BO> </BOM> </B1out> </b1im_msg> </xsl:for-each> </b1im_multimsg> </xsl:template></xsl:stylesheet>

How to solve this issue?

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Best Answer
    Apr 12 at 11:32 AM

    Dear Mr.Dennis ,

    Thanks for your reply, i have solved my issue . This is the solution for issue and it's working fine.

    I have another Query , How to stop Package after completion of package ,how to start when inbound trigger.

    Package Scenario step:

    • Call SQL >> Final (atom0)
    • We are passing Select Statement Value into Final atom.

    How to fix or not reason for this?

    <?xml version="1.0" encoding="UTF-8"?>
    <xsl:stylesheet xmlns:b1e="urn:com.sap.b1i.sim:b1event" xmlns:b1ie="urn:com.sap.b1i.sim:b1ievent" xmlns:b1im="urn:com.sap.b1i.sim:b1imessage" xmlns:bfa="urn:com.sap.b1i.bizprocessor:bizatoms" xmlns:jdbc="urn:com.sap.b1i.adapter:jdbcadapter" xmlns:js="com.sap.b1i.bpc_tools.Javascript" xmlns:rfc="urn:sap-com:document:sap:rfc:functions" xmlns:sim="urn:com.sap.b1i.sim:entity" xmlns:uplt="urn:com.sap.b1i.xcellerator:upltdoc" xmlns:utils2="com.sap.b1i.bpc_tools.Utilities" xmlns:vpf="urn:com.sap.b1i.vplatform:entity" xmlns:xci="urn:com.sap.b1i.xcellerator:intdoc" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" bfa:force="" vpf:force="" jdbc:force="" rfc:force="" b1ie:force="" b1e:force="" xci:force="" sim:force="" utils2:force="" b1im:force="" uplt:force="" js:force="">
        <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='S']"></xsl:variable>
        <xsl:variable name="vptsDoc" select="document('/com.sap.b1i.internal/xml/timestamp')"></xsl:variable>
        <xsl:variable name="vpts" select="concat($vptsDoc/*/@year,'/',$vptsDoc/*/@month,'/',$vptsDoc/*/@date,' ',$vptsDoc/*/@hour,':',$vptsDoc/*/@minute,':',$vptsDoc/*/@second)"></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='P']/@Id"></xsl:variable>
        <xsl:variable name="vpDBInSysId" select="/vpf:Msg/vpf:Header/vpf:Properties/vpf:prop[./@id='DBInSysId']/@value"></xsl:variable>
        <xsl:template match="/">
            <Msg xmlns="urn:com.sap.b1i.vplatform:entity">
                <xsl:copy-of select="/vpf:Msg/@*"></xsl:copy-of>
                <xsl:copy-of select="/vpf:Msg/vpf:Header"></xsl:copy-of>
                <Body>
                    <xsl:copy-of select="/vpf:Msg/vpf:Body/*"></xsl:copy-of>
                    <Payload Role="R" id="{$atom}" ts="{$vpts}">
                        <xsl:call-template name="transform"></xsl:call-template>
                    </Payload>
                </Body>
            </Msg>
        </xsl:template>
        <xsl:template name="transform">
            <b1im_multimsg>
                <xsl:for-each select="/vpf:Msg/vpf:Body/vpf:Payload[./@id='atom1']/jdbc:ResultSet/jdbc:Row">
                    <b1im_msg>
                        <B1out type="object">
                            <BusinessPartners>
                                <row>
                                    <CardCode>
                                        <xsl:value-of select="jdbc:Code"></xsl:value-of>
                                    </CardCode>
                                    <CardName>
                                        <xsl:value-of select="jdbc:Name"></xsl:value-of>
                                    </CardName>
                                    <CardType>C</CardType>
                                    <SubjectToWithholdingTax>N</SubjectToWithholdingTax>
                                    <Notes>Created By B1if</Notes>
                                </row>
                            </BusinessPartners>
                        </B1out>
                    </b1im_msg>
                </xsl:for-each>
            </b1im_multimsg>
        </xsl:template>
    </xsl:stylesheet>
    
    Add comment
    10|10000 characters needed characters exceeded

  • Mar 19 at 09:16 AM

    - I think your BusinessPartners Object strukture is incorrect.

    - Why do you use text() when you read the code and name from the sql? check if you get an value first.

    Add comment
    10|10000 characters needed characters exceeded