cancel
Showing results for 
Search instead for 
Did you mean: 

Problem with Service - Layer while submitting concurrent transactions.

divyanshuvyas
Explorer
0 Kudos

Hi,

I have one web-application prepared in ASP.NET framework, which submit various SAP B1 Transaction (Inventory Transfers, Goods Receipt, Goods Issue, Goods receipt based on PO, Sales Picking etc. ...) via DI SERVER.

DI SERVER Contains two methods to submit transactions.

1. Interact(<XML String>).

2. BatchInteract (<XML Strings>).

My application uses first method - "Interact (<XML String>)" for every SAB B1 Transaction.

My Business Scenario (Goods Issue & Add UDO)

While Performing Goods issue from my application. We first select lot for goods issue, then we add that lot one of our UDO via DI-SERVER.

To achieve above scenario, we are adding two XML envelops in single String and pass it to DI Server via Interact (<XML String>) method.

This is what we want and is running successfully in single atomic transaction.

<?xml version="1.0" ?>
<env:Envelope
	xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xmlns:xsd="http://www.w3.org/2001/XMLSchema">
	<env:Header>
		<MsgHeader
			xmlns="http://www.sap.com/SBO/DIS">
			<SessionID>$$SESSIONID$$</SessionID>
		</MsgHeader>
	</env:Header>
	<env:Body>
		<dis:AddObject
			xmlns:dis="http://www.sap.com/SBO/DIS">
			<BOM>
				<BO>
					<AdmInfo>
						<Object>oInventoryGenExit</Object>
					</AdmInfo>
					<QueryParams>
						<DocEntry />
					</QueryParams>
					<Documents>
						<row>
							<DocNum />
							<DocType />
							<HandWritten />
							<Printed />
							<ReopenManuallyClosedOrCanceledDocument />
							<CreateOnlineQuotation />
							<POSEquipmentNumber />
							<POSManufacturerSerialNumber />
							<POSCashierNumber />
							<U_BMMRefType />
							<Comments>Draw QC : From BatchMaster WMS By : manager For QC Order Number PUR000062 </Comments>
							<U_BMM_GUID>SDCfbca9d0e-d0a7-4509-87f9-50d1431876eb</U_BMM_GUID >
							<U_BMMfgReturn />
							<U_WMS_USERCODE>manager</U_WMS_USERCODE>
							<U_WMS_USERNAME>manager</U_WMS_USERNAME>
						</row>
					</Documents>
					<Document_Lines>
						<row>
							<LineNum>0</LineNum>
							<ItemCode>Apple LT</ItemCode>
							<WarehouseCode >01</WarehouseCode >
							<Quantity>1.000000</Quantity>
							<ShipDate>20190306</ShipDate>
							<AccountCode></AccountCode>
							<UnitPrice>0.090000</UnitPrice>
							<Currency/>
							<CSTforCOFINS />
							<CreditOriginCode />
							<U_BMEBaseLineID />
						</row>
					</Document_Lines>
					<BatchNumbers>
						<row>
							<BatchNumber>Apple LTPRAV</BatchNumber >
							<ManufacturerSerialNumber>Apple LTPRAV</ManufacturerSerialNumber>
							<InternalSerialNumber />
							<Location />
							<Notes />
							<Notes />
							<Quantity>1.000000</Quantity>
							<BaseLineNumber>0</BaseLineNumber>
						</row>
					</BatchNumbers>
					<SerialNumbers></SerialNumbers>
					<DocumentLinesBinAllocations>
						<row>
							<BinAbsEntry>5</BinAbsEntry>
							<Quantity>1</Quantity>
							<AllowNegativeQuantity />
							<SerialAndBatchNumbersBaseLine>0</SerialAndBatchNumbersBaseLine>
							<BaseLineNumber>0 </BaseLineNumber>
						</row>
					</DocumentLinesBinAllocations>
				</BO>
			</BOM>
		</dis:AddObject>
		<dis:Add
			xmlns:dis="http://www.sap.com/SBO/DIS">
			<Service>BMM_5151</Service>
			<Draw_QC_sample>
				<U_DESC>Apple LT</U_DESC>
				<U_LOTSTATUS></U_LOTSTATUS>
				<U_HMIS>Safety Glasses</U_HMIS>
				<U_UOM>KG</U_UOM>
				<U_SAMINSTRUCTION>Test </U_SAMINSTRUCTION>
				<U_SAMPDESC></U_SAMPDESC>
				<U_RECORDID></U_RECORDID>
				<U_REF_RECORDID></U_REF_RECORDID>
				<U_QCORDERNO>PUR000062</U_QCORDERNO>
				<U_REF_LOTRECORDID></U_REF_LOTRECORDID>
				<U_ITEMCODE>Apple LT</U_ITEMCODE>
				<U_WHSCODE>01</U_WHSCODE>
				<U_QCINVTYPE></U_QCINVTYPE>
				<U_VENDORLOT>Apple LTPRAV</U_VENDORLOT>
				<U_EXPIRYDATE>99991231</U_EXPIRYDATE>
				<U_LOTQTY>425</U_LOTQTY>
				<U_LOTQTYUOM>KG</U_LOTQTYUOM>
				<U_SAMQTYWDRWN>1</U_SAMQTYWDRWN>
				<U_SAMQTWDWNUNT>KG</U_SAMQTWDWNUNT>
				<U_NOOFCONTAINERS>0</U_NOOFCONTAINERS>
				<U_NOOFSAMPLES>1</U_NOOFSAMPLES>
				<U_SAMPLEQTY>1.000000</U_SAMPLEQTY>
				<U_TOTSAMPLEQTY>1.000000</U_TOTSAMPLEQTY>
				<U_SELFORPROCESS></U_SELFORPROCESS>
				<U_GROUPID>0</U_GROUPID>
				<U_BODOCNUM>407</U_BODOCNUM>
				<U_BODOCENTRY>407</U_BODOCENTRY>
				<U_BODOCGUID>SDCd845b222-c170-4d82-8aa5-10049f95b44e</U_BODOCGUID>
				<U_LOTNO>Apple LTPRAV</U_LOTNO>
				<U_POSTINGDATE>20190306</U_POSTINGDATE>
				<U_ISSAMPLERETAINED>0</U_ISSAMPLERETAINED>
				<U_QCPROCESSTYPE>1</U_QCPROCESSTYPE>
				<U_INVTRANSNO></U_INVTRANSNO>
				<U_GOODSISSNO>407</U_GOODSISSNO>
				<BMM_QCDRAWSAMPLEDTCollection>
					<BMM_QCDRAWSAMPLEDT>
						<U_FROMWHSE>01</U_FROMWHSE>
						<U_SAMPINSTRUCTION> Test</U_SAMPINSTRUCTION>
						<U_SELECT>1</U_SELECT>
						<U_CONTAINERNO>0</U_CONTAINERNO>
						<U_SCCNO></U_SCCNO>
						<U_BINNO>01-STAGEBIN</U_BINNO>
						<U_INVTYPE>ALL</U_INVTYPE>
						<U_TOBINNO></U_TOBINNO>
						<U_TOINVTYPE>ALL</U_TOINVTYPE>
						<U_BINQTY></U_BINQTY>
						<U_SELQTY>1.000000</U_SELQTY>
						<U_ABSENTRY>5</U_ABSENTRY>
						<U_BINABS></U_BINABS>
						<U_TOWHSE></U_TOWHSE>
						<U_HASHCODE></U_HASHCODE>
					</BMM_QCDRAWSAMPLEDT>
				</BMM_QCDRAWSAMPLEDTCollection>
			</Draw_QC_sample>
		</dis:Add>
	</env:Body>
</env:Envelope>
<br>

Now for HANA, we are adopting Service Layer & want to have single URL for posting multiple transactions as mentioned in above example.

We tried “Batch Operations” mentioned in Service Layer document for above example, but as per document if one of the transaction fails then other transaction gets roll-back. but in our case we are not being able to achieve this by HANA Service Layer.

“Please suggest how to achieve multiple transaction with HANA Service Layer considering above example in single atomic transaction.”

Looking forward for your reply

Regards

Divyanshu Vyas

ANKIT_CHAUHAN
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Divyanshu Vyas,

Could you please help to provide the screenshot where it is mentioned that if one of the transaction fails then other transaction gets roll-back ?

This will enable us to have a look into the documentation and make it correct if the statement is wrong.

Kind regards,

ANKIT CHAUHAN

SAP Business One Support

Accepted Solutions (0)

Answers (1)

Answers (1)

former_member197733
Contributor
0 Kudos

You can use a global transaction in the Script Engine. And call it once with all the required data.