Hello Bastian,
you are partially right. I have not exactly followed the structure. Since my structure worked for a single item (including batch and bin locations) i didnt think about rechecking the structure. Anyway, i changed the structure so i could erase this source of errors.
This is my atom2 which prepares the statement:
<?xml version="1.0" encoding="UTF-8"?><xsl:stylesheet 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: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:utils2="com.sap.b1i.bpc_tools.Utilities" xmlns:vpf="urn:com.sap.b1i.vplatform:entity" xmlns:xci="urn:com.sap.b1i.xcellerator:intdoc" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" bfa:force="" vpf:force="" jdbc:force="" rfc:force="" b1ie:force="" b1e:force="" xci:force="" sim:force="" utils2:force="" b1im:force=""> <xsl:output method="xml" encoding="UTF-8" indent="yes"/> <xsl:param name="atom"/> <xsl:param name="sessionid"/> <xsl:variable name="msg" select="/vpf:Msg/vpf:Body/vpf:Payload[./@Role='S']"/> <xsl:variable name="vpSender" select="/vpf:Msg/vpf:Header/vpf:Sender/@Id"/> <xsl:variable name="vpObject" select="/vpf:Msg/vpf:Header/vpf:Sender/@ObjId"/> <xsl:variable name="vpReceiver" select="/vpf:Msg/vpf:Header/vpf:ReceiverList/vpf:Receiver[./@handover='P']/@Id"/> <xsl:template match="/"> <Msg xmlns="urn:com.sap.b1i.vplatform:entity"> <xsl:copy-of select="/vpf:Msg/@*"/> <xsl:copy-of select="/vpf:Msg/vpf:Header"/> <Body> <xsl:copy-of select="/vpf:Msg/vpf:Body/*"/> <Payload Role="X" id="{$atom}"> <xsl:call-template name="transform"/> </Payload> </Body> </Msg> </xsl:template> <xsl:template name="transform"> <BOM xmlns=""> <BO> <AdmInfo> <Object>15</Object> <Version>2</Version> </AdmInfo> <QueryParams> <DocEntry>0</DocEntry> </QueryParams> <Documents> <xsl:for-each select="$msg/CreateDelivery/Documents/row"> <row> <!--multiple such elements are allowed--> <DocNum> <xsl:value-of select="DocNum"/> </DocNum> <DocType>I</DocType> <DocDate> <xsl:value-of select="DocDate"/> </DocDate> <DocDueDate> <xsl:value-of select="DocDueDate"/> </DocDueDate> <CardCode> <xsl:value-of select="CardCode"/> </CardCode> </row> </xsl:for-each> </Documents> <Document_Lines> <xsl:for-each select="$msg/CreateDelivery/DocumentLines/row"> <row> <!--multiple such elements are allowed--> <LineNum> <xsl:value-of select="LineNum"/> </LineNum> <ItemCode> <xsl:value-of select="ItemCode"/> </ItemCode> <Quantity> <xsl:value-of select="Quantity"/> </Quantity> <WarehouseCode> <xsl:value-of select="WarehouseCode"/> </WarehouseCode> <BaseEntry> <xsl:value-of select="DocEntry"/> </BaseEntry> <BaseType>17</BaseType> <TreeType>N</TreeType> </row> </xsl:for-each> </Document_Lines> <BatchNumbers> <xsl:for-each select="$msg/CreateDelivery/BatchNumbers/row"> <row> <BatchNumber> <xsl:value-of select="BatchNumber"/> </BatchNumber> <ExpiryDate> <xsl:value-of select="ExpiryDate"/> </ExpiryDate> <Quantity> <xsl:value-of select="Quantity"/> </Quantity> <BaseLineNumber> <xsl:value-of select="BaseLineNumber"/> </BaseLineNumber> </row> </xsl:for-each> </BatchNumbers> <DocumentLinesBinAllocations> <xsl:for-each select="$msg/CreateDelivery/DocumentLinesBinAllocations/row"> <row> <BinAbsEntry> <xsl:value-of select="BinAbsEntry"/> </BinAbsEntry> <AllowNegativeQuantity>Y</AllowNegativeQuantity> <Quantity> <xsl:value-of select="Quantity"/> </Quantity> <SerialAndBatchNumbersBaseLine> <xsl:value-of select="SerialAndBatchNumbersBaseLine"/> </SerialAndBatchNumbersBaseLine> <BaseLineNumber> <xsl:value-of select="BaseLineNumber"/> </BaseLineNumber> </row> </xsl:for-each> </DocumentLinesBinAllocations> </BO> </BOM> </xsl:template></xsl:stylesheet>
This is my inbound message when using the TEST functionality in the processing
<?xml version='1.0' encoding="UTF-8"?><CreateDelivery> <Documents> <row> <CardCode>K100002</CardCode> <DocDate>2014-01-09</DocDate> <DocDueDate>2014-01-09</DocDueDate> <DocNum>200030</DocNum> </row> </Documents> <DocumentLines> <row> <DocEntry>44</DocEntry> <LineNum>0</LineNum> <ItemCode>8705</ItemCode> <Quantity>10</Quantity> <WarehouseCode>LH</WarehouseCode> </row> <row> <DocEntry>44</DocEntry> <LineNum>1</LineNum> <ItemCode>1010</ItemCode> <Quantity>10</Quantity> <WarehouseCode>LH</WarehouseCode> </row> </DocumentLines> <BatchNumbers> <row> <BatchNumber>20150701</BatchNumber> <ExpiryDate>07.07.2015</ExpiryDate> <Quantity>10</Quantity> <BaseLineNumber>0</BaseLineNumber> </row> <row> <BatchNumber>20141229</BatchNumber> <ExpiryDate>29.10.2015</ExpiryDate> <Quantity>10</Quantity> <BaseLineNumber>1</BaseLineNumber> </row> </BatchNumbers> <!-- <DocumentLinesBinAllocations> <row> <BinAbsEntry>4</BinAbsEntry> <Quantity>5</Quantity> <BaseLineNumber>0</BaseLineNumber> <SerialAndBatchNumbersBaseLine>0</SerialAndBatchNumbersBaseLine> </row> <row> <BinAbsEntry>5</BinAbsEntry> <Quantity>5</Quantity> <BaseLineNumber>0</BaseLineNumber> <SerialAndBatchNumbersBaseLine>0</SerialAndBatchNumbersBaseLine> </row> </DocumentLinesBinAllocations> --></CreateDelivery>
and this is the result:
<Msg xmlns="urn:com.sap.b1i.vplatform:entity" MessageId="15011015241755705762C0A80209124C" BeginTimeStamp="20150110152417" logmsg="0000" SubMessageId="" status="success" owntst="true" test="true"> <Header> <IPO Id="vPlatform_Test" /> <Sender Id="" ObjId="CreateDelivery" /> <Receiver Id="" /> <ReceiverList> <Receiver Id="" handover="P" /> </ReceiverList> <Identification Ident="Root Tag" IdPar="n.a." /> <nsList /> <vBIU Id="Z.CreateDelivery" ver="1.0.0" SId="Z.MobileLager" filter="" phase="" /> <Variables> <var id="userid" value="" /> <var id="username" value="" /> </Variables> <Properties /> <SysTypeProperties type="B1if" offline="" snd="senderdummy" rcv="receiverdummy" ssystype="" rsystype="" /> <LocalProperties type="B1if" biu="Z.CreateDelivery" snd="senderdummy" rcv="receiverdummy" sid="Z.MobileLager" offline="" /> <VarProperties /> </Header> <Body> <Payload Role="T" Type="Call" /> <Payload Role="S"> <CreateDelivery xmlns=""> <Documents> <row> <CardCode>K100002</CardCode> <DocDate>2014-01-09</DocDate> <DocDueDate>2014-01-09</DocDueDate> <DocNum>200030</DocNum> </row> </Documents> <DocumentLines> <row> <DocEntry>44</DocEntry> <LineNum>0</LineNum> <ItemCode>8705</ItemCode> <Quantity>10</Quantity> <WarehouseCode>LH</WarehouseCode> </row> <row> <DocEntry>44</DocEntry> <LineNum>1</LineNum> <ItemCode>1010</ItemCode> <Quantity>10</Quantity> <WarehouseCode>LH</WarehouseCode> </row> </DocumentLines> <BatchNumbers> <row> <BatchNumber>20150701</BatchNumber> <ExpiryDate>07.07.2015</ExpiryDate> <Quantity>10</Quantity> <BaseLineNumber>0</BaseLineNumber> </row> <row> <BatchNumber>20141229</BatchNumber> <ExpiryDate>29.10.2015</ExpiryDate> <Quantity>10</Quantity> <BaseLineNumber>1</BaseLineNumber> </row> </BatchNumbers> <!-- <DocumentLinesBinAllocations> <row> <BinAbsEntry>4</BinAbsEntry> <Quantity>5</Quantity> <BaseLineNumber>0</BaseLineNumber> <SerialAndBatchNumbersBaseLine>0</SerialAndBatchNumbersBaseLine> </row> <row> <BinAbsEntry>5</BinAbsEntry> <Quantity>5</Quantity> <BaseLineNumber>0</BaseLineNumber> <SerialAndBatchNumbersBaseLine>0</SerialAndBatchNumbersBaseLine> </row> </DocumentLinesBinAllocations> --> </CreateDelivery> </Payload> <Payload Role="X" id="atom2"> <BOM xmlns=""> <BO> <AdmInfo> <Object>15</Object> <Version>2</Version> </AdmInfo> <QueryParams> <DocEntry>0</DocEntry> </QueryParams> <Documents> <row> <DocNum>200030</DocNum> <DocType>I</DocType> <DocDate>2014-01-09</DocDate> <DocDueDate>2014-01-09</DocDueDate> <CardCode>K100002</CardCode> </row> </Documents> <Document_Lines> <row> <LineNum>0</LineNum> <ItemCode>8705</ItemCode> <Quantity>10</Quantity> <WarehouseCode>LH</WarehouseCode> <BaseEntry>44</BaseEntry> <BaseType>17</BaseType> <TreeType>N</TreeType> </row> <row> <LineNum>1</LineNum> <ItemCode>1010</ItemCode> <Quantity>10</Quantity> <WarehouseCode>LH</WarehouseCode> <BaseEntry>44</BaseEntry> <BaseType>17</BaseType> <TreeType>N</TreeType> </row> </Document_Lines> <BatchNumbers> <row> <BatchNumber>20150701</BatchNumber> <ExpiryDate>07.07.2015</ExpiryDate> <Quantity>10</Quantity> <BaseLineNumber>0</BaseLineNumber> </row> <row> <BatchNumber>20141229</BatchNumber> <ExpiryDate>29.10.2015</ExpiryDate> <Quantity>10</Quantity> <BaseLineNumber>1</BaseLineNumber> </row> </BatchNumbers> <DocumentLinesBinAllocations /> </BO> </BOM> </Payload> <Payload Role="C" id="atom1" system="0010000119" status="success" b1login="Technical User" method="Synchronous Insert" objectid="15" payload="atom2" keyname="DocEntry" keyvalue="0" DIresult="failure" DImsg="Exception : DI Error: (-5002) Invalid value [DLN1.BaseLine][line: 1]" /> </Body></Msg>