Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

create purchasedeliverynotes by DI API,DI Error: (-10) This document cannot be added

Former Member
0 Likes
935
  • SAP Managed Tags

when i create purchasedeliverynotes by DI API,i got a error :

Exception : DI Error: (-10) This document cannot be added, because the base document row was updated. Copy the document again from its base document

xml formart as follow:

<Msgxmlns="urn:com.sap.b1i.vplatform:entity">

"); width: 10px; height: 10px; margin-left: -10px; vertical-align: bottom; display: inline-block; cursor: pointer; user-select: none;"><Body> "); width: 10px; height: 10px; margin-left: -10px; vertical-align: bottom; display: inline-block; cursor: pointer; user-select: none;"><PayloadRole="X"id="atom6"> "); width: 10px; height: 10px; margin-left: -10px; vertical-align: bottom; display: inline-block; cursor: pointer; user-select: none;"><BOMxmlns=""MesEntry="1"> "); width: 10px; height: 10px; margin-left: -10px; vertical-align: bottom; display: inline-block; cursor: pointer; user-select: none;"><BO> "); width: 10px; height: 10px; margin-left: -10px; vertical-align: bottom; display: inline-block; cursor: pointer; user-select: none;"><AdmInfo> <Object>20</Object> <Version>2</Version> </AdmInfo> "); width: 10px; height: 10px; margin-left: -10px; vertical-align: bottom; display: inline-block; cursor: pointer; user-select: none;"><Documents> "); width: 10px; height: 10px; margin-left: -10px; vertical-align: bottom; display: inline-block; cursor: pointer; user-select: none;"><row> <DocDate>20170804</DocDate> <DocDueDate>20170804</DocDueDate> <DocType>I</DocType> <CardCode>920046</CardCode> </row>

</Documents>

"); width: 10px; height: 10px; margin-left: -10px; vertical-align: bottom; display: inline-block; cursor: pointer; user-select: none;"><Document_Lines> "); width: 10px; height: 10px; margin-left: -10px; vertical-align: bottom; display: inline-block; cursor: pointer; user-select: none;"><row> <LineNum>0</LineNum> <ItemCode>491600012</ItemCode> <Quantity>1008.000000</Quantity> <WarehouseCode>101</WarehouseCode> <BarCode>1708040001</BarCode> <BaseEntry>395</BaseEntry> <BaseLine>0</BaseLine> <LocationCode/> <ShipDate>20170804</ShipDate> <Price>8.130000</Price> <BaseType>22</BaseType> </row>

</Document_Lines>

"); width: 10px; height: 10px; margin-left: -10px; vertical-align: bottom; display: inline-block; cursor: pointer; user-select: none;"><BatchNumbers> "); width: 10px; height: 10px; margin-left: -10px; vertical-align: bottom; display: inline-block; cursor: pointer; user-select: none;"><row> <BatchNumber>1708040001</BatchNumber> <Quantity>1008.000000</Quantity> <BaseLineNumber>0</BaseLineNumber> </row>

</BatchNumbers>

"); width: 10px; height: 10px; margin-left: -10px; vertical-align: bottom; display: inline-block; cursor: pointer; user-select: none;"><DocumentLinesBinAllocations> "); width: 10px; height: 10px; margin-left: -10px; vertical-align: bottom; display: inline-block; cursor: pointer; user-select: none;"><row> <BinAbsEntry/> <Quantity>1008.000000</Quantity> <BaseLineNumber>0</BaseLineNumber> <SerialAndBatchNumbersBaseLine>0</SerialAndBatchNumbersBaseLine> </row>

</DocumentLinesBinAllocations>

</BO>

</BOM>

please help

when i create purchasedeliverynotes by DI API,i got a error :

Exception : DI Error: (-10) This document cannot be added, because the base document row was updated. Copy the document again from its base document

xml formart as follow:

<Msgxmlns="urn:com.sap.b1i.vplatform:entity">

"); width: 10px; height: 10px; margin-left: -10px; vertical-align: bottom; display: inline-block; cursor: pointer; user-select: none;"><Body> "); width: 10px; height: 10px; margin-left: -10px; vertical-align: bottom; display: inline-block; cursor: pointer; user-select: none;"><PayloadRole="X"id="atom6"> "); width: 10px; height: 10px; margin-left: -10px; vertical-align: bottom; display: inline-block; cursor: pointer; user-select: none;"><BOMxmlns=""MesEntry="1"> "); width: 10px; height: 10px; margin-left: -10px; vertical-align: bottom; display: inline-block; cursor: pointer; user-select: none;"><BO> "); width: 10px; height: 10px; margin-left: -10px; vertical-align: bottom; display: inline-block; cursor: pointer; user-select: none;"><AdmInfo> <Object>20</Object> <Version>2</Version> </AdmInfo> "); width: 10px; height: 10px; margin-left: -10px; vertical-align: bottom; display: inline-block; cursor: pointer; user-select: none;"><Documents> "); width: 10px; height: 10px; margin-left: -10px; vertical-align: bottom; display: inline-block; cursor: pointer; user-select: none;"><row> <DocDate>20170804</DocDate> <DocDueDate>20170804</DocDueDate> <DocType>I</DocType> <CardCode>920046</CardCode> </row>

</Documents>

"); width: 10px; height: 10px; margin-left: -10px; vertical-align: bottom; display: inline-block; cursor: pointer; user-select: none;"><Document_Lines> "); width: 10px; height: 10px; margin-left: -10px; vertical-align: bottom; display: inline-block; cursor: pointer; user-select: none;"><row> <LineNum>0</LineNum> <ItemCode>491600012</ItemCode> <Quantity>1008.000000</Quantity> <WarehouseCode>101</WarehouseCode> <BarCode>1708040001</BarCode> <BaseEntry>395</BaseEntry> <BaseLine>0</BaseLine> <LocationCode/> <ShipDate>20170804</ShipDate> <Price>8.130000</Price> <BaseType>22</BaseType> </row>

</Document_Lines>

"); width: 10px; height: 10px; margin-left: -10px; vertical-align: bottom; display: inline-block; cursor: pointer; user-select: none;"><BatchNumbers> "); width: 10px; height: 10px; margin-left: -10px; vertical-align: bottom; display: inline-block; cursor: pointer; user-select: none;"><row> <BatchNumber>1708040001</BatchNumber> <Quantity>1008.000000</Quantity> <BaseLineNumber>0</BaseLineNumber> </row>

</BatchNumbers>

"); width: 10px; height: 10px; margin-left: -10px; vertical-align: bottom; display: inline-block; cursor: pointer; user-select: none;"><DocumentLinesBinAllocations> "); width: 10px; height: 10px; margin-left: -10px; vertical-align: bottom; display: inline-block; cursor: pointer; user-select: none;"><row> <BinAbsEntry/> <Quantity>1008.000000</Quantity> <BaseLineNumber>0</BaseLineNumber> <SerialAndBatchNumbersBaseLine>0</SerialAndBatchNumbersBaseLine> </row>

</DocumentLinesBinAllocations>

</BO>

</BOM>

please help

1 REPLY 1
Read only

Former Member
0 Likes
710
  • SAP Managed Tags

I used the object of 20, the xml is as follow:

<BOM>
<xsl:attribute name="MesEntry"><xsl:value-of select="$msg/jdbc:SqlResult/jdbc:ResultSet/jdbc:Row[./jdbc:ID=$count]/jdbc:MesEntry"></xsl:value-of></xsl:attribute>
<BO>
<AdmInfo>
<Object>20</Object>
<Version>2</Version>
</AdmInfo>
<Documents>
<row>
<DocDate>
<xsl:value-of select="$msg/jdbc:SqlResult/jdbc:ResultSet/jdbc:Row[./jdbc:ID=$count]/jdbc:DocDate"></xsl:value-of>
</DocDate>
<DocDueDate>
<xsl:value-of select="$msg/jdbc:SqlResult/jdbc:ResultSet/jdbc:Row[./jdbc:ID=$count]/jdbc:DocDate"></xsl:value-of>
</DocDueDate>

<CardCode>
<xsl:value-of select="$msg/jdbc:SqlResult/jdbc:ResultSet/jdbc:Row[./jdbc:ID=$count]/jdbc:venderCode"></xsl:value-of>
</CardCode>

</row>
</Documents>
<Document_Lines>
<xsl:for-each select="$msg/jdbc:SqlResult/jdbc:ResultSet/jdbc:Row[./jdbc:ID=$count]">
<row>
<!-- multiple such elements are allowed -->
<LineNum>
<xsl:value-of select="jdbc:LineNum"></xsl:value-of>
</LineNum>
<ItemCode>
<xsl:value-of select="jdbc:ItemCode"></xsl:value-of>
</ItemCode>
<Quantity>
<xsl:value-of select="jdbc:Quantity"></xsl:value-of>
</Quantity>
<WarehouseCode>
<xsl:value-of select="jdbc:WhsCode"></xsl:value-of>
</WarehouseCode>
<BarCode>
<xsl:value-of select="jdbc:DistNumber"></xsl:value-of>
</BarCode>
<BaseEntry>
<xsl:value-of select="jdbc:BaseEntry"></xsl:value-of>
</BaseEntry>
<BaseLine>
<xsl:value-of select="jdbc:BaseLine"></xsl:value-of>
</BaseLine>
<LocationCode>
<xsl:value-of select="jdbc:BinAbsEntry"></xsl:value-of>
</LocationCode>
<ShipDate><xsl:value-of select="jdbc:DocDate"></xsl:value-of></ShipDate>
<Price>
<xsl:value-of select="jdbc:Price"></xsl:value-of>
</Price>
<BaseType>22</BaseType>
<LineStatus>O</LineStatus>
<VatGroup>J1</VatGroup>
<TaxCode></TaxCode>
<DiscountPercent>0</DiscountPercent>
<Currency>RMB</Currency>
</row>
</xsl:for-each>
</Document_Lines>
<BatchNumbers>
<xsl:for-each select="$msg/jdbc:SqlResult/jdbc:ResultSet/jdbc:Row[./jdbc:ID=$count]">
<row>
<BatchNumber>
<xsl:value-of select="jdbc:DistNumber"></xsl:value-of>
</BatchNumber>
<Quantity>
<xsl:value-of select="jdbc:Quantity"></xsl:value-of>
</Quantity>
<BaseLineNumber>
<xsl:value-of select="jdbc:BaseLine"></xsl:value-of>
</BaseLineNumber>
</row>
</xsl:for-each>
</BatchNumbers>
<DocumentLinesBinAllocations>
<xsl:for-each select="$msg/jdbc:SqlResult/jdbc:ResultSet/jdbc:Row[./jdbc:ID=$count]">
<row>
<BinAbsEntry>
<xsl:value-of select="jdbc:BinAbsEntry"></xsl:value-of>
</BinAbsEntry>
<Quantity>
<xsl:value-of select="jdbc:Quantity"></xsl:value-of>
</Quantity>
<BaseLineNumber>
<xsl:value-of select="jdbc:BaseLine"></xsl:value-of>
</BaseLineNumber>
<SerialAndBatchNumbersBaseLine>0</SerialAndBatchNumbersBaseLine>
</row>
</xsl:for-each>
</DocumentLinesBinAllocations>
</BO>
</BOM>