cancel
Showing results for 
Search instead for 
Did you mean: 

while trying to invoke the method, of a null object loaded from local variable 'inMsg' B1if 2.0

0 Kudos
4,659

Hi, I am getting following messages on creating sale order using B1IF 2.0
while trying to invoke the method com.sap.b1i.bizprocessor.BizProcMessage.setProperty(java.lang.String, java.lang.String) of a null object loaded from local variable 'inMsg'

Below are the configuration of scenario
I/O



B1 Object template:

  <?xml version="1.0" encoding="UTF-8"?>
<?bpc.pltype.out bpm.pltype=xml?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 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:exslt="http://exslt.org/common" xmlns:jdbc="urn:com.sap.b1i.adapter:jdbcadapter" xmlns:js="com.sap.b1i.bpc_tools.Javascript" xmlns:rev="urn:com.sap.b1i.adapter:revaadapter" xmlns:rfc="urn:sap-com:document:sap:rfc:functions" xmlns:sim="urn:com.sap.b1i.sim:entity" xmlns:utils="com.sap.b1i.bpc_tools.Utilities" xmlns:vpf="urn:com.sap.b1i.vplatform:entity" xmlns:xca="urn:com.sap.b1i.xcellerator:appconfig" xmlns:xci="urn:com.sap.b1i.xcellerator:intdoc" version="1.0" exclude-result-prefixes="b1e b1ie b1im bfa jdbc js rfc utils xci xca vpf exslt sim rev" b1e:force="" b1ie:force="" b1im:force="" bfa:force="" jdbc:force="" js:force="" rfc:force="" utils:force="" xci:force="" xca:force="" vpf:force="" exslt:force="" sim:force="" rev:force="">
   <?prodver 1.0.0?>
   <xsl:include href="../../com.sap.b1i.dev.repository/IDE/init.xsl" />
   <xsl:variable name="msg" select="/vpf:Msg/vpf:Body/vpf:Payload[./@Role='S']" />
   <xsl:template match="/">
      <vpf:Msg>
         <xsl:copy-of select="/vpf:Msg/@*" />
         <xsl:copy-of select="/vpf:Msg/vpf:Header" />
         <vpf:Body>
            <xsl:copy-of select="/vpf:Msg/vpf:Body/*" />
            <vpf:Payload Role="X" id="{$atom}">
               <xsl:call-template name="transform" />
            </vpf:Payload>
         </vpf:Body>
      </vpf:Msg>
   </xsl:template>
   <xsl:template name="transform">
      <Envelope>
         <Header>
            <Action throwException="false" autoCommit="false">add</Action>
            <WritePolicy insert_on_exists="fallback2u" update_policy="regular" update_on_miss="fallback2I" />
         </Header>
         <Body>
            <BOM>
               <!-- DB Table Name:  -->
               <BO>
                  <!-- multiple such elements are allowed -->
                  <AdmInfo>
                     <Object>17</Object>
                     <Version>2</Version>
                  </AdmInfo>
                  <QueryParams>
                     <DocEntry />
                  </QueryParams>
                  <Documents>
                     <row>
                        <!-- multiple such elements are allowed -->
                        <CardCode>
                           <xsl:value-of select="bfa:io/bfa:Object/bfa:string[./@Name='BPCode']" />
                        </CardCode>
                        <CardName>
                           <xsl:value-of select="bfa:io/bfa:Object/bfa:string[./@Name='Name']" />
                        </CardName>
                        <DocDueDate>
                           <xsl:value-of select="bfa:io/bfa:Object/bfa:string[./@Name='DeliveryDate']" />
                        </DocDueDate>
                        <NumAtCard>
                           <xsl:value-of select="bfa:io/bfa:Object/bfa:string[./@Name='OrderReference']" />
                        </NumAtCard>
                        <!--<ContactPersonCode>
                                             <xsl:value-of select="bfa:io/bfa:Object/bfa:string[./@Name='ContactPersonCode']"/>
                                        </ContactPersonCode>
                                        <DocDate>
                                             <xsl:value-of select="bfa:io/bfa:Object/bfa:string[./@Name='DocDate']"/>
                                        </DocDate>-->
                     </row>
                  </Documents>
                  <Document_Lines>
                     <xsl:for-each select="bfa:io/bfa:Object/bfa:array[./@Name='OrderItems']/bfa:Object">
                        <row>
                           <ItemCode>
                              <xsl:value-of select="bfa:string[./@Name='Code']" />
                           </ItemCode>
                           <Quantity>
                              <xsl:value-of select="bfa:string[./@Name='Quantity']" />
                           </Quantity>
                           <Price>
                              <xsl:value-of select="bfa:string[./@Name='Price']" />
                           </Price>
                        </row>
                     </xsl:for-each>
                  </Document_Lines>
               </BO>
            </BOM>
         </Body>
      </Envelope>
   </xsl:template>
</xsl:stylesheet>

B1 Call Atom:

Response.xsl

<?bpc.pltype.out bpm.pltype=xml?><xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 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:exslt="http://exslt.org/common" xmlns:jdbc="urn:com.sap.b1i.adapter:jdbcadapter" xmlns:js="com.sap.b1i.bpc_tools.Javascript" xmlns:rev="urn:com.sap.b1i.adapter:revaadapter" xmlns:rfc="urn:sap-com:document:sap:rfc:functions" xmlns:sim="urn:com.sap.b1i.sim:entity" xmlns:utils="com.sap.b1i.bpc_tools.Utilities" xmlns:vpf="urn:com.sap.b1i.vplatform:entity" xmlns:xca="urn:com.sap.b1i.xcellerator:appconfig" xmlns:xci="urn:com.sap.b1i.xcellerator:intdoc" version="1.0" exclude-result-prefixes="b1e b1ie b1im bfa jdbc js rfc utils xci xca vpf exslt sim rev" b1e:force="" b1ie:force="" b1im:force="" bfa:force="" jdbc:force="" js:force="" rfc:force="" utils:force="" xci:force="" xca:force="" vpf:force="" exslt:force="" sim:force="" rev:force="">
        <?prodver 1.0.0?>
            <xsl:include href="../../com.sap.b1i.dev.repository/IDE/init.xsl"/>
            <xsl:variable name="msg" select="/vpf:Msg/vpf:Body/vpf:Payload[./@Role='S']"/>
            <xsl:template match="/">
                <vpf:Msg>
                    <xsl:copy-of select="/vpf:Msg/@*"/>
                    <xsl:copy-of select="/vpf:Msg/vpf:Header"/>
                    <vpf:Body>
                        <xsl:copy-of select="/vpf:Msg/vpf:Body/*"/>
                        <vpf:Payload Role="X" id="{$atom}">
                            <xsl:call-template name="transform"/>
                        </vpf:Payload>
                    </vpf:Body>
                </vpf:Msg>
            </xsl:template>
            <xsl:template name="transform">
                <Response>
                    <Result>
                        <xsl:value-of select="/vpf:Msg/vpf:Body/vpf:Payload[./@id='B1Call']/Envelope/Header/ActionResult"/>
                    </Result>
                    <ActionMessage>
                        <xsl:value-of select="/vpf:Msg/vpf:Body/vpf:Payload[./@id='B1Call']/Envelope/Header/ActionMessage"/>
                    </ActionMessage>
                </Response>
            </xsl:template>
    </xsl:stylesheet>

There is no msg defined i.e "inMsg" in my scenario. is it due to variable/sbo mapping xsl?

View Entire Topic
former_member230765
Participant
0 Kudos

I also got the same issue and finally fixed it, Please refer to, https://answers.sap.com/answers/13456337/view.html

TusharNathvani
Participant
0 Kudos
Hi, Not able to open above link. Can you please provide the solution as we are facing the same issue.