Skip to Content
0
Former Member
Jan 13, 2011 at 07:06 AM

SAP B1PO2B1SO Integration Error

44 Views

When we create the sample scenario given in forum u2018B1PO2B1SOu2019 using B18.8 and try to send a Purchase Order to Headquarters it gives the following error

com.sap.b1i.xcellerator.XcelleratorException: XCE001 Nested exception: com.sap.b1i.bizprocessor.BizProcException: BPE001 Nested exception: com.sap.b1i.xcellerator.XcelleratorException: XCE001 Nested exception: com.sap.b1i.xcellerator.XcelleratorException: XCE001 Nested exception: java.lang.RuntimeException: Invoke of: GetBusinessObjectFromXML Source: SAPbobsCOM.Company.88.0 Description: Invalid XML file

I am pasting the XSL file below. It would be really nice if someone could help me out on this one.


<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet 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:rfc="urn:sap-com:document:sap:rfc:functions" xmlns:sim="urn:com.sap.b1i.sim:entity" xmlns:targetxsl="http://TargetXSLPrefixAlias" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" bfa:force="" sim:force="" b1im:force="" jdbc:force="" rfc:force="" b1ie:force="">
    <xsl:output method="xml" encoding="UTF-8" indent="yes"/>
    <xsl:param name="b1i.s.stp.Country" select="/b1im:B1IMessage/b1im:Header/b1im:System/sim:PropertyList/sim:Property[@Key=&apos;Country&apos;][1]/@Value"/>
    <xsl:param name="b1i.s.stp.CompanyLanguage" select="/b1im:B1IMessage/b1im:Header/b1im:System/sim:PropertyList/sim:Property[@Key=&apos;Company Language&apos;][1]/@Value"/>
    <xsl:param name="b1i.s.stp.ForeignLanguage" select="/b1im:B1IMessage/b1im:Header/b1im:System/sim:PropertyList/sim:Property[@Key=&apos;Foreign Language&apos;][1]/@Value"/>
    <xsl:param name="b1i.s.stp.CompanyCode" select="/b1im:B1IMessage/b1im:Header/b1im:System/sim:PropertyList/sim:Property[@Key=&apos;Company Code&apos;][1]/@Value"/>
    <xsl:param name="b1i.s.stp.CreditControlArea" select="/b1im:B1IMessage/b1im:Header/b1im:System/sim:PropertyList/sim:Property[@Key=&apos;Credit Control Area&apos;][1]/@Value"/>
    <xsl:param name="b1i.s.stp.SalesOrganization" select="/b1im:B1IMessage/b1im:Header/b1im:System/sim:PropertyList/sim:Property[@Key=&apos;Sales Organization&apos;][1]/@Value"/>
    <xsl:param name="b1i.s.stp.DistributionChannel" select="/b1im:B1IMessage/b1im:Header/b1im:System/sim:PropertyList/sim:Property[@Key=&apos;Distribution Channel&apos;][1]/@Value"/>
    <xsl:param name="b1i.s.stp.Division" select="/b1im:B1IMessage/b1im:Header/b1im:System/sim:PropertyList/sim:Property[@Key=&apos;Division&apos;][1]/@Value"/>
    <xsl:param name="b1i.s.stp.Plant" select="/b1im:B1IMessage/b1im:Header/b1im:System/sim:PropertyList/sim:Property[@Key=&apos;Plant&apos;][1]/@Value"/>
    <xsl:param name="b1i.s.stp.SubsidiariesCustomerNumber" select="/b1im:B1IMessage/b1im:Header/b1im:System/sim:PropertyList/sim:Property[@Key=&apos;Subsidiaries Customer Number&apos;][1]/@Value"/>
    <xsl:param name="b1i.s.stp.SubCustomerNumberInHQ" select="/b1im:B1IMessage/b1im:Header/b1im:System/sim:PropertyList/sim:Property[@Key=&apos;Sub Customer Number In HQ&apos;][1]/@Value"/>
    <xsl:param name="b1i.s.stp.HQVenderNumberInSub" select="/b1im:B1IMessage/b1im:Header/b1im:System/sim:PropertyList/sim:Property[@Key=&apos;HQ Vender Number In Sub&apos;][1]/@Value"/>
    <xsl:param name="b1i.s.stp.SubsidiaryIdentifier" select="/b1im:B1IMessage/b1im:Header/b1im:System/sim:PropertyList/sim:Property[@Key=&apos;Subsidiary Identifier&apos;][1]/@Value"/>
    <xsl:param name="b1i.s.stp.ManagementReportStartTime" select="/b1im:B1IMessage/b1im:Header/b1im:System/sim:PropertyList/sim:Property[@Key=&apos;Management Report Start Time&apos;][1]/@Value"/>
    <xsl:param name="b1i.r.stp.Country" select="/b1im:B1IMessage/b1im:Header/b1im:System/sim:PropertyList/sim:Property[@Key=&apos;Country&apos;][2]/@Value"/>
    <xsl:param name="b1i.r.stp.CompanyLanguage" select="/b1im:B1IMessage/b1im:Header/b1im:System/sim:PropertyList/sim:Property[@Key=&apos;Company Language&apos;][2]/@Value"/>
    <xsl:param name="b1i.r.stp.ForeignLanguage" select="/b1im:B1IMessage/b1im:Header/b1im:System/sim:PropertyList/sim:Property[@Key=&apos;Foreign Language&apos;][2]/@Value"/>
    <xsl:param name="b1i.r.stp.CompanyCode" select="/b1im:B1IMessage/b1im:Header/b1im:System/sim:PropertyList/sim:Property[@Key=&apos;Company Code&apos;][2]/@Value"/>
    <xsl:param name="b1i.r.stp.CreditControlArea" select="/b1im:B1IMessage/b1im:Header/b1im:System/sim:PropertyList/sim:Property[@Key=&apos;Credit Control Area&apos;][2]/@Value"/>
    <xsl:param name="b1i.r.stp.SalesOrganization" select="/b1im:B1IMessage/b1im:Header/b1im:System/sim:PropertyList/sim:Property[@Key=&apos;Sales Organization&apos;][2]/@Value"/>
    <xsl:param name="b1i.r.stp.DistributionChannel" select="/b1im:B1IMessage/b1im:Header/b1im:System/sim:PropertyList/sim:Property[@Key=&apos;Distribution Channel&apos;][2]/@Value"/>
    <xsl:param name="b1i.r.stp.Division" select="/b1im:B1IMessage/b1im:Header/b1im:System/sim:PropertyList/sim:Property[@Key=&apos;Division&apos;][2]/@Value"/>
    <xsl:param name="b1i.r.stp.Plant" select="/b1im:B1IMessage/b1im:Header/b1im:System/sim:PropertyList/sim:Property[@Key=&apos;Plant&apos;][2]/@Value"/>
    <xsl:param name="b1i.r.stp.SubsidiariesCustomerNumber" select="/b1im:B1IMessage/b1im:Header/b1im:System/sim:PropertyList/sim:Property[@Key=&apos;Subsidiaries Customer Number&apos;][2]/@Value"/>
    <xsl:param name="b1i.r.stp.SubCustomerNumberInHQ" select="/b1im:B1IMessage/b1im:Header/b1im:System/sim:PropertyList/sim:Property[@Key=&apos;Sub Customer Number In HQ&apos;][2]/@Value"/>
    <xsl:param name="b1i.r.stp.HQVenderNumberInSub" select="/b1im:B1IMessage/b1im:Header/b1im:System/sim:PropertyList/sim:Property[@Key=&apos;HQ Vender Number In Sub&apos;][2]/@Value"/>
    <xsl:param name="b1i.r.stp.SubsidiaryIdentifier" select="/b1im:B1IMessage/b1im:Header/b1im:System/sim:PropertyList/sim:Property[@Key=&apos;Subsidiary Identifier&apos;][2]/@Value"/>
    <xsl:param name="b1i.r.stp.ManagementReportStartTime" select="/b1im:B1IMessage/b1im:Header/b1im:System/sim:PropertyList/sim:Property[@Key=&apos;Management Report Start Time&apos;][2]/@Value"/>
    
    
    <xsl:param name="TargetDocType" select="/b1im:B1IMessage/b1im:Header/b1im:System/*[local-name()='PropertyList']/*[local-name()='Property'and @Key='TargetDocType']/@Value"/>
    <xsl:param name="BillTo" select="/b1im:B1IMessage/b1im:Header/b1im:System/*[local-name()='PropertyList']/*[local-name()='Property'and @Key='BillTo']/@Value"/>
    
    
    <xsl:variable name="b1i.msg.SndSysId" select="/b1im:B1IMessage/b1im:Header/b1im:Sender/sim:SysId/@Id"/>
    <xsl:variable name="b1i.msg.SndSysType" select="/b1im:B1IMessage/b1im:Header/b1im:Sender/sim:SysId/@SysTypeId"/>
    <xsl:variable name="b1i.msg.SndObjectId" select="/b1im:B1IMessage/b1im:Header/b1im:Sender/sim:ObjectType/@Id"/>
    <xsl:variable name="b1i.msg.RcvSysId" select="/b1im:B1IMessage/b1im:Header/b1im:Receiver/sim:SysId/@Id"/>
    <xsl:variable name="b1i.msg.RcvSysType" select="/b1im:B1IMessage/b1im:Header/b1im:Receiver/sim:SysId/@SysTypeId"/>
    <xsl:variable name="b1i.msg.RcvObjectId" select="/b1im:B1IMessage/b1im:Header/b1im:Receiver/sim:ObjectType/@Id"/>
    <xsl:variable name="b1i.msg.Task" select="/b1im:B1IMessage/b1im:Header/b1im:System/@Task"/>
    <xsl:variable name="b1.task" select="/b1im:B1IMessage/b1im:Body/b1im:Payload[@ObjectRole=&apos;A&apos;]/b1ie:B1IEvent/@Task"/>
    
    <xsl:template match="/">
        <xsl:apply-templates select="b1im:B1IMessage/b1im:Body/b1im:Payload[./@ObjectTypeId=&apos;Z.B1.8.8_MyPO&apos;]"/>
    </xsl:template>
    
    
    <xsl:template match="b1im:B1IMessage/b1im:Body/b1im:Payload[./@ObjectTypeId=&apos;Z.B1.8.8_MyPO&apos;]">
        <xsl:variable name="RefNo" select="BOM/BO/Documents/row/NumAtCard"/>
        <BOM>
            <BO>
                <Adminfo>
                    <Object>
                        <xsl:choose>
                            <xsl:when test="$TargetDocType='Draft'">112</xsl:when>
                            <xsl:otherwise>17</xsl:otherwise>
                        </xsl:choose>
                    </Object>
                    <xsl:if test="$b1.task='U'">
                        <QueryParams>
                            <DocEntry>
                                <xsl:value-of select="$RefNo"/>
                            </DocEntry>
                        </QueryParams>
                    </xsl:if>
                    <Version>2</Version>
                </Adminfo>
                <Documents>
                    <xsl:for-each select="BOM/BO/Documents/row">
                        <row>
                            <xsl:if test="$b1.task='I'">
                                <DocObjectCode>17</DocObjectCode>
                                <CardCode>
                                <xsl:value-of select="$b1i.s.stp.SubCustomerNumberInHQ"/>
                                </CardCode>
                            </xsl:if>
                            <DocDueDate>
                                <xsl:value-of select="DocDueDate"/>
                            </DocDueDate>
                            <NumAtCard>
                                <xsl:value-of select="DocEntry"/>
                            </NumAtCard>
                            <Comments>Based on Subsidiary PO#<xsl.value-of select="DocNum"/>.</Comments>
                            <Address>
                                <xsl:choose>
                                    <xsl:when test="$BillTo='Customer'">
                                    <xsl:value-of select="//b1im:Payload[@ObjectTypeId='B1.8.8_SO' and@ObjectRole='SA']/BOM/BO/Documents/row/Address"/>
                                    </xsl:when>
                                    <xsl:otherwise>
                                        <xsl:value-of select="Address"/>
                                    </xsl:otherwise>
                                </xsl:choose>
                            </Address>
                        </row>
                    </xsl:for-each>
                </Documents>
                <Document_Lines>
                    <xsl:for-each select="BOM/BO/Document_Lines/row">
                        <row>
                            <ItemCode>
                                <xsl:value-of select="ItemCode"/>
                            </ItemCode>
                            <Quantity>
                                <xsl:value-of select="Quantity"/>
                            </Quantity>
                        </row>
                    </xsl:for-each>
                </Document_Lines>
            </BO>
        </BOM>
    </xsl:template>
</xsl:stylesheet>

Edited by: Ajialukkal on Jan 13, 2011 1:14 PM