cancel
Showing results for 
Search instead for 
Did you mean: 

unable to import BP via b1if web service call

Former Member

Hello Experts,

I have created a B1if scenario package which receives as Inbound a Web Service Call(an XML file) and according to the XML data, adds or updates a Business Partner in SAP B1. Here are my Inbound and Outbound set ups:

Inbound set up:

Outbound set up:

and

My atom0 transformation is:

<xsl:template name="transform">

<xsl:attribute name="pltype">xml</xsl:attribute>

<B1out xmlns="" type="object">

<BusinessPartners>

<row>

<CardCode><xsl:value-of select="//CardCode[text()]"/></CardCode>

<CardName><xsl:value-of select="//CardName[text()]"/></CardName>

<Notes/>

</row>

</BusinessPartners>

</B1out>

</xsl:template>

and the XML file I send through SOAP Request is:

<?xml version=""1.0"" encoding=""UTF-8""?>

<SOAP-ENV:Envelope xmlns:SOAP-ENV=""http://schemas.xmlsoap.org/soap/envelope/"" >

<SOAP-ENV:Body>

<Data>

<CardCode>C.99985</CardCode>

<CardName>Dummy Test</CardName>

</Data>

</SOAP-ENV:Body>

</SOAP-ENV:Envelope>

So far I have run my package, tested it successfully, created the XSD and WSDL files and made the SOAP Request with no errors. In the Monitoring > Message Log window of the b1if application I get this report:

meaning everything went smooth.

The problem is when I open SAP B1 and look for the new Business Partner b1if “successfully” added there is nowhere and I have no idea why.

Please advice.

Best regards,

Vasilis

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hello,

Everything is looking good. can you please try with the following atom2 , atom0 transformation, and SOAP Request?

atom2 (xform)


<xsl:template name="transform">
        <BusinessPartners xmlns="">
            <row>
                <CardCode>
                    <xsl:value-of select="//CardCode[text()]"></xsl:value-of>
                </CardCode>
                <CardName>
                    <xsl:value-of select="//CardName[text()]"></xsl:value-of>
                </CardName>
                <CardType>
                    <xsl:value-of select="//CardType[text()]"></xsl:value-of>
                </CardType>
                <Notes>
                    <xsl:value-of select="//Notes[text()]"></xsl:value-of>
                </Notes>
                <FederalTaxID>
                    <xsl:value-of select="//FederalTaxID[text()]"></xsl:value-of>
                </FederalTaxID>
                <Currency>
                    <xsl:value-of select="//Currency[text()]"></xsl:value-of>
                </Currency>
                <FreeText>
                    <xsl:value-of select="//FreeText[text()]"></xsl:value-of>
                </FreeText>
            </row>
        </BusinessPartners>
        <BPAddresses xmlns="">
            <row>
                <!-- multiple such elements are allowed -->
                <AddressName>
                    <xsl:value-of  select="//AddressName[text()]"></xsl:value-of>
                </AddressName>
                <Street>
                    <xsl:value-of select="//Street[text()]"></xsl:value-of>
                </Street>
                <ZipCode>
                    <xsl:value-of select="//ZipCode[text()]"></xsl:value-of>
                </ZipCode>
                <City>
                    <xsl:value-of select="//City[text()]"></xsl:value-of>
                </City>
                <Country>
                    <xsl:value-of select="//Country[text()]"></xsl:value-of>
                </Country>
                <AddressType>
                    <xsl:value-of select="//AddressType[text()]"></xsl:value-of>
                </AddressType>
                <AddressName2>
                    <xsl:value-of select="//AddressName2[text()]"></xsl:value-of>
                </AddressName2>
                <AddressName3>
                    <xsl:value-of select="//AddressName3[text()]"></xsl:value-of>
                </AddressName3>
                <TypeOfAddress>
                    <xsl:value-of select="//TypeOfAddress[text()]"></xsl:value-of>
                </TypeOfAddress>
             </row>
        </BPAddresses>
    </xsl:template>

SOAP Request

<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
	<SOAP-ENV:Body>
		<Data>
	
			<BusinessPartners>
<row>
	<CardCode>C10021</CardCode>
	<CardName>ABC AG</CardName>
	<CardType>C</CardType>
	<Notes>Inserted using B1if</Notes>
	<FederalTaxID>111111</FederalTaxID>
	<Currency>CHF</Currency>
	<FreeText>Processing testing</FreeText>
</row>
</BusinessPartners>
<BPAddresses>
<row>
<!-- multiple such elements are allowed -->
<AddressName>Shipping</AddressName>
<Street>Street 555</Street>
<ZipCode>12345</ZipCode>
<City>XXXX</City>
<Country>XX</Country>
<AddressType>bo_ShipTo</AddressType>
<AddressName2>ABC AG Main</AddressName2>
<AddressName3>Nr. XYZ</AddressName3>
<TypeOfAddress>bo_ShipTo</TypeOfAddress>
</row>


<row>


<AddressName>Billing</AddressName>
<Street>Street 555</Street>
<ZipCode>12345</ZipCode>
<City>XXXX</City>
<Country>XX</Country>
<AddressType>bo_BillTo</AddressType>
<AddressName2>ABC AG Main</AddressName2>
<AddressName3>Nr. XYZ</AddressName3>
<TypeOfAddress>bo_BillTo</TypeOfAddress>
</row>
</BPAddresses>


		</Data>
	</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

atom0 transformation(Final Step)

<xsl:template name="transform">
        <xsl:attribute name="pltype">xml</xsl:attribute>
        <B1out xmlns="" type="object">
            <BusinessPartners>
                <row>
                    <CardCode>
                        <xsl:value-of select="//CardCode[text()]"></xsl:value-of>
                    </CardCode>
                    <CardName>
                        <xsl:value-of select="//CardName[text()]"></xsl:value-of>
                    </CardName>
                    <CardType>
                        <xsl:value-of select="//CardType[text()]"></xsl:value-of>
                    </CardType>
                    <Notes>
                        <xsl:value-of select="//Notes[text()]"></xsl:value-of>
                    </Notes>
                </row>
            </BusinessPartners>
        </B1out>
    </xsl:template>