cancel
Showing results for 
Search instead for 
Did you mean: 

B1ITEM2B1ITEM update error

Former Member
0 Kudos

Hi everybody,

i need to update an item from B1 to B1 system. When i try i had an exception about the read only property 'QuantityOnStock'. Exist some solution or patch for this problem?

Regards

Accepted Solutions (0)

Answers (1)

Answers (1)

Eneveux
Product and Topic Expert
Product and Topic Expert
0 Kudos

Marco,

This sample code is offered "as is" on the SDN Portal ... so there is not currently any patch and SAP does not support this sample.

The field "QuantityOnStock" per the SDK 2007A documentation is a read-only field meaning that it cannot be updated via the DI API (JCO) via an external application such as B1iSN2007. Did you alter or change this sample BIU?

Eddy

Former Member
0 Kudos

Hi Edward,

i don't change the BIU example.

This means that i cannot update an ITEM via B1i?

Regards

Eneveux
Product and Topic Expert
Product and Topic Expert
0 Kudos

Marco,

It means that you cannot update the QuantityOnStock property in SAP Business One using B1i. I will have to check the BIU, but you can also edit the BIU to take this out so you can use B1i.

Eddy

Former Member
0 Kudos

Hi Edward,

in my BIU i don't consider the field 'QuantityOnStock'.

This is the XSL file:

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

<xsl:stylesheet xmlns:b1im="urn:com.sap.b1i.sim:b1imessage" xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:sim="urn:com.sap.b1i.sim:entity" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">

<xsl:output method="xml" encoding="UTF-8" indent="yes"></xsl:output>

<!From SystemID>

<xsl:template match="/">

<xsl:apply-templates select="b1im:B1IMessage/b1im:Body/b1im:Payload[starts-with(@ObjectTypeId,&apos;B1.200&apos;) and contains(@ObjectTypeId,&apos;_ITM&apos;)]/BOM"></xsl:apply-templates>

</xsl:template>

<xsl:template match="b1im:B1IMessage/b1im:Body/b1im:Payload[starts-with(@ObjectTypeId,&apos;B1.200&apos;) and contains(@ObjectTypeId,&apos;_ITM&apos;)]/BOM">

<BOM xmlns="">

<BO>

<AdmInfo>

<Object>4</Object>

<Version>2</Version>

</AdmInfo>

<QueryParams>

<ItemCode>

<xsl:value-of select="BO/Items/row/ItemCode"></xsl:value-of>

</ItemCode>

</QueryParams>

<Items>

<row>

<ItemCode>

<xsl:value-of select="BO/Items/row/ItemCode"></xsl:value-of>

</ItemCode>

<ItemName>

<xsl:value-of select="BO/Items/row/ItemName"></xsl:value-of>

</ItemName>

<ItemsGroupCode>

<xsl:value-of select="BO/Items/row/ItemsGroupCode"/>

</ItemsGroupCode>

<ItemType>

<xsl:value-of select="BO/Items/row/ItemType"/>

</ItemType>

<InventoryItem>

<xsl:value-of select="BO/Items/row/InventoryItem"/>

</InventoryItem>

<PurchaseItem>

<xsl:value-of select="BO/Items/row/PurchaseItem"/>

</PurchaseItem>

<SalesItem>

<xsl:value-of select="BO/Items/row/SalesItem"/>

</SalesItem>

</row>

</Items>

</BO>

</BOM>

</xsl:template>

<xsl:template name="deleteLeadingZero">

<xsl:param name="strFragment"></xsl:param>

<xsl:variable name="len" select="string-length($strFragment)"></xsl:variable>

<xsl:choose>

<xsl:when test="$strFragment= &apos;0&apos;"></xsl:when>

<xsl:when test="len &lt;= 1 or substring($strFragment,1,1) != &apos;0&apos;">

<xsl:value-of select="$strFragment"></xsl:value-of>

</xsl:when>

<xsl:otherwise>

<xsl:call-template name="deleteLeadingZero">

<xsl:with-param name="strFragment" select="substring($strFragment, 2, $len - 1)"></xsl:with-param>

</xsl:call-template>

</xsl:otherwise>

</xsl:choose>

</xsl:template>

</xsl:stylesheet>

The output message don't contains 'QuantityOnStock', but i've the error.

The same if consider just the fields 'ItemCode' and 'ItemName'.

How can i resolve this big problem?

Thanks!

Eneveux
Product and Topic Expert
Product and Topic Expert
0 Kudos

Marco,

Lets start from the beginning.

B1iSN2007, out-of-the-box does not have predefined content to integrate SAP Business One with another SAP Business One. The out-of-the-box content is designed to integrate R/3 (headquarters) with one or more instances of SAP Business One (subsidiary).

There is a sample Business One to Business One BUI for a Purchase Order in one instance of Business One to integrate with another instance of Business One to create the Sales Order. This sample BIU is located here ...

... at the bottom of the page under "Code Sample". This sample does not integrate Business One Item Master data to Business One Item Master data.

That being said ... where did you get the BIU to integrate Business One Item Master data as I am not aware of this here on SDN.

Eddy

Former Member
0 Kudos

Eddy,

What means that the BIU for items is not in SDN?

I cannot develope my BIU? Moreover the BIU work fine for the insert operation...

I can use only the BIU published from SDN site?

In B1i, no one developer or consultant encounter the problem about the Items update from B1 to B1?

Is possible???

Former Member
0 Kudos

Ok, i solved a problem...

I had modified one bdf of the standard IPO 08, the SYS016_B1outbound.bfd.

Before to call the adapter B1DI, i had insert an xform with an xsl file: in this file i filter the update for the objetc types 4 (Items).

If the object type is an item and i'm in update task, i create the outbound for the B1DI adapter with the values that i need.

This is a SYS016_B1outbound.bfd modified:

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

<bizflow xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:com.sap.b1i.bizprocessor:bfdefinition" xsi:schemaLocation="urn:com.sap.b1i.bizprocessor:bfdefinition ../../com.sap.b1i.system/xsd/bizflow.xsd" name="SYS016_B1Outbound" active="true" schemaversion="1.0">

<interface nslist="xmlns:b1im=&apos;urn:com.sap.b1i.sim:b1imessage&apos;">

<description/>

<inbound>

<propertylist>

<property name="GlobalTask" bfxp_value="/b1im:B1IMessage/b1im:Header/b1im:System/@Task" importable="false"/>

</propertylist>

</inbound>

<outbound>

</outbound>

</interface>

<bizatoms>

<branch name="Branch_Outbound">

<description/>

<inpath id="0"/>

<outpath_xp id="100" xp_expr="/"/>

<otherwise id="200" triggerAlways="true"/>

</branch>

<include name="ProtocolConversion(Outbound)">

<description>Wrap the inbound B1 retrieval statement to generate the standard input message required by B1 Adapter.</description>

<inpath id="100"/>

<outpath id="110"/>

<subflow optional="false">

<intended bfxp_href="#../SYS040_ProtocolConversionOutbound/SYS040_ProtocolConversionOutbound.bfd"/>

<propertylist>

<property bfxp_value="#!GlobalTask_" name="GlobalTask"/>

<property bfxp_value="#B1DI" name="ConnectivityTypeId"/>

</propertylist>

</subflow>

</include>

<xform name="FormatItemsMessage" nslist="xmlns:bfa=&apos;urn:com.sap.b1i.bizprocessor:bizatoms&apos;">

<description>Format items message for update</description>

<inpath id="110"/>

<outpath id="115"/>

<rule optional="false">

<intended bfxp_href="#FormatMessage.xsl"/>

<propertylist/>

</rule>

</xform>

<call name="B1Outbound">

<description>Out put Object</description>

<inpath id="115"/>

<outpath id="120"/>

<class bfxp_payload="/" bfxp_classname="#!xcl.port_">

<propertylist>

<property bfxp_value="#CallB1" name="portID" purpose="Specifies the sec. I/O-Port (Xs)"/>

</propertylist>

</class>

</call>

<unbranch name="Unbranch_Outbound">

<description/>

<inpath id="120"/>

<otherwise id="200"/>

<outpath id="10"/>

</unbranch>

<include name="PostProcessing" nslist="xmlns:bfa=&apos;urn:com.sap.b1i.bizprocessor:bizatoms&apos;">

<description/>

<inpath id="10"/>

<outpath id="20"/>

<subflow optional="false">

<intended bfxp_href="#/pattern.com.sap.b1i.internal/SYS015_Outbound/PostProcessing.bfd"/>

<propertylist>

<property name="Result" bfxp_value="/bfa:unbranch/bfa:call/bfa:outbound/bfa:payload/Envelope/Header/ActionResult"/>

<property name="Message" bfxp_value="/bfa:unbranch/bfa:call/bfa:outbound/bfa:payload/Envelope/Header/ActionMessage"/>

</propertylist>

</subflow>

</include>

</bizatoms>

</bizflow>

..be careful at the inpath / outpath values.

The file FormatMessage.xsl:

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

<xsl:stylesheet version="1.0" xmlns:env="http://www.w3.org/2003/05/soap-envelope" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:b1im="urn:com.sap.b1i.sim:b1imessage" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:bfa="urn:com.sap.b1i.bizprocessor:bizatoms" xmlns:fo="http://www.w3.org/1999/XSL/Format" bfa:force="">

<xsl:output method="xml" encoding="UTF-8" indent="yes"/>

<xsl:template match="/">

<xsl:choose>

<xsl:when test="/Envelope/Header/Action = 'update' and (/Envelope/Body/BOM/BO/AdmInfo/Object = 4)">

<Envelope xmlns="">

<xsl:copy-of select="/Envelope/Header"/>

<Body>

<BOM>

<BO>

<AdmInfo>

<Object>

<xsl:value-of select="/Envelope/Body/BOM/BO/AdmInfo/Object"/>

</Object>

<Version>

<xsl:value-of select="/Envelope/Body/BOM/BO/AdmInfo/Version"/>

</Version>

</AdmInfo>

<Items>

<row>

<ItemCode>

<xsl:value-of select="/Envelope/Body/BOM/BO/Items/row/ItemCode"/>

</ItemCode>

<ItemName>

<xsl:value-of select="/Envelope/Body/BOM/BO/Items/row/ItemName"/>

</ItemName>

</row>

</Items>

</BO>

</BOM>

<BOM>

<BO>

<AdmInfo>

<Object>

<xsl:value-of select="/Envelope/Body/BOM/BO/AdmInfo/Object"/>

</Object>

<Version>

<xsl:value-of select="/Envelope/Body/BOM/BO/AdmInfo/Version"/>

</Version>

</AdmInfo>

<QueryParams>

<ItemCode>

<xsl:value-of select="/Envelope/Body/BOM/BO/Items/row/ItemCode"/>

</ItemCode>

</QueryParams>

<Items>

<row>

<ItemCode>

<xsl:value-of select="/Envelope/Body/BOM/BO/Items/row/ItemCode"/>

</ItemCode>

<ItemName>

<xsl:value-of select="/Envelope/Body/BOM/BO/Items/row/ItemName"/>

</ItemName>

</row>

</Items>

</BO>

</BOM>

</Body>

</Envelope>

</xsl:when>

<xsl:otherwise>

<xsl:copy-of select="/"/>

</xsl:otherwise>

</xsl:choose>

</xsl:template>

</xsl:stylesheet>

In this file i filter only the messages of update for items. Into this file i put the fields that i want consider for the update.