cancel
Showing results for 
Search instead for 
Did you mean: 

DIS: problem with templates and actual data

Former Member
0 Kudos

Hi All:

I've been browsing every thread where the DI Server is discussed here, I read all the info in the SDK.

What I want is somehow simple:

1) Retrieve information from some businessobject and display that in a webpage.

2) Modify the data and update it back in SBO.

I created some webservices, login, GetObject, UpdateObject.

In my webpage, I use the login to get my sessionId. Then, Use the GetObject to get some actual data, like, a BusinessPArtner information.

Until here, no problem. I can show the data very well.

The update part is the tricky one: I 've tried sending back the same XML, an alter xml with the update command and the queryparams, I tried getting the ObjectTemplate and the ObjectSchema and nothing.

Does anybody can describeme how they have managed to do this? maybe a working sample(please no the one in the SDK)??

Thanks in advance

Harold Gómez

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hello Harold,

How about this ?

Henry

= = = = =

02/06/2006 10:50:57 Request

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

<env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/">

<env:Header>

<SessionID>783D0E2E-B261-BCA0-F007-4625AB83B6C5</SessionID>

</env:Header>

<env:Body>

<dis:GetByKey xmlns:dis="http://www.sap.com/SBO/DIS">

<Object>oOrders</Object>

<DocEntry>285</DocEntry>

</dis:GetByKey>

</env:Body>

</env:Envelope>

02/06/2006 10:50:59 Response (OK)

<?xml version="1.0"?><env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope">

<env:Body><dis:GetByKeyResponse xmlns:dis="http://www.sap.com/SBO/DIS">

<BOM>

<BO>

<AdmInfo><Object>oOrders</Object>

<Version>2</Version>

</AdmInfo><Documents>

<row>

<DocEntry>285</DocEntry>

<DocNum>285</DocNum>

<DocType>dDocument_Items</DocType>

<HandWritten>tNO</HandWritten>

<Printed>tNO</Printed>

<DocumentStatus>bost_Open</DocumentStatus>

<DocObjectCode>17</DocObjectCode>

<DocDate>20060601</DocDate>

<DocDueDate>20060601</DocDueDate>

<CardCode>02095</CardCode>

<CardName>Red Capital Invest Ltd</CardName>

<Address>FINLAND</Address>

<NumAtCard/>

<VatSum>29.360000</VatSum>

<VatSumFc>0.000000</VatSumFc>

<DiscountPercent>0.000000</DiscountPercent><TotalDiscount>0.000000</TotalDiscount><DocCurrency>EUR</DocCurrency><DocRate>1.000000</DocRate><DocTotal>162.800000</DocTotal><DocTotalFc>0.000000</DocTotalFc><Reference1>285</Reference1><Reference2/><Comments/><JournalMemo>Sales Orders - 02095</JournalMemo><TransNum>0</TransNum><PaymentGroupCode>11</PaymentGroupCode><DocTime>1910</DocTime><SalesPersonCode>-1</SalesPersonCode><TransportationCode>0</TransportationCode><PartialSupply>tYES</PartialSupply><Confirmed>tYES</Confirmed><ImportFileNum>0</ImportFileNum><SummeryType>dNoSummary</SummeryType><WareHouseUpdateType>dwh_CustomerOrders</WareHouseUpdateType><ContactPersonCode>0</ContactPersonCode><ShowSCN>tNO</ShowSCN><VatSumSys>29.360000</VatSumSys><DocTotalSys>162.800000</DocTotalSys><UpdateDate>20060601</UpdateDate><CreationDate>20060601</CreationDate><Series>2</Series><TaxDate>20060601</TaxDate><FinancialPeriod>18</FinancialPeriod><Address2/><Indicator/><NetProcedure>tNO</NetProcedure><ShipToCode/><FederalTaxID/><PaymentReference>020952853</PaymentReference><WTAmount>0.000000</WTAmount><WTAmountFC>0.000000</WTAmountFC><WTAmountSC>0.000000</WTAmountSC><Form1099>0</Form1099><Box1099/><Submitted>tNO</Submitted><Rounding>tNO</Rounding><RevisionPo>tNO</RevisionPo><Segment>0</Segment><RequriedDate>20060601</RequriedDate><CancelDate>20060701</CancelDate><PickStatus>tNO</PickStatus><Pick>tNO</Pick><BlockDunning>tNO</BlockDunning><PaymentMethod/><PaymentBlock>tNO</PaymentBlock><PaymentBlockEntry>0</PaymentBlockEntry><MaximumCashDiscount>tNO</MaximumCashDiscount><Reserve>tNO</Reserve><CentralBankIndicator/><PickRemark/><Project/><DeferredTax>tNO</DeferredTax><TaxExemptionLetterNum/><ExemptionValidityDateFrom/><ExemptionValidityDateTo/><WTApplied>0.000000</WTApplied><WTAppliedFC>0.000000</WTAppliedFC><BillOfExchangeReserved>tNO</BillOfExchangeReserved><AgentCode/><WTAppliedSC>0.000000</WTAppliedSC><TotalEqualizationTax>0.000000</TotalEqualizationTax><TotalEqualizationTaxFC>0.000000</TotalEqualizationTaxFC><TotalEqualizationTaxSC>0.000000</TotalEqualizationTaxSC><NumberOfInstallments>1</NumberOfInstallments><ApplyTaxOnFirstInstallment>tNO</ApplyTaxOnFirstInstallment><WTNonSubjectAmount>0.000000</WTNonSubjectAmount><WTNonSubjectAmountSC>0.000000</WTNonSubjectAmountSC><WTNonSubjectAmountFC>0.000000</WTNonSubjectAmountFC><WTExemptedAmount>0.000000</WTExemptedAmount><WTExemptedAmountSC>0.000000</WTExemptedAmountSC><WTExemptedAmountFC>0.000000</WTExemptedAmountFC><VatDate/><ExternalCorrectedDocNum/><InternalCorrectedDocNum>0</InternalCorrectedDocNum><NextCorrectingDocument>0</NextCorrectingDocument><BaseAmount>0.000000</BaseAmount><BaseAmountSC>0.000000</BaseAmountSC><BaseAmountFC>0.000000</BaseAmountFC><BPL_IDAssignedToInvoice>0</BPL_IDAssignedToInvoice><PeriodIndicator>Oletusarvo</PeriodIndicator><ManualNumber/><UseShpdGoodsAct>tNO</UseShpdGoodsAct><DocumentSubType>bod_None</DocumentSubType><DownPayment>0.000000</DownPayment><FolioPrefixString/><FolioNumber>0</FolioNumber><DocumentsOwner>9</DocumentsOwner><BPChannelCode/><BPChannelContact>0</BPChannelContact><PayToCode/><IsPayToBank/><PayToBankCountry/><PayToBankCode/><PayToBankAccountNo/><PayToBankBranch/><ReserveInvoice>tNO</ReserveInvoice><TrackingNumber/><LanguageCode>17</LanguageCode></row></Documents>

<Document_Lines>

!!DOCUMENT LINES OMITTED IN ORDER TO SAVE SPACE!!

</Document_Lines>

<SerialNumbers/><BatchNumbers/><Document_LinesAdditionalExpenses/><WithholdingTaxLines/><DocumentsAdditionalExpenses/><WithholdingTaxData/><TaxExtension/></BO></BOM></dis:GetByKeyResponse></env:Body></env:Envelope>

02/06/2006 10:51:15 Request

<?xml version="1.0"?>

<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope">

<env:Header>

<SessionID>783D0E2E-B261-BCA0-F007-4625AB83B6C5</SessionID>

</env:Header>

<env:Body>

<dis:UpdateObject xmlns:dis="http://www.sap.com/SBO/DIS" CommandID="Update Documents">

<BOM>

<BO>

<AdmInfo>

<Object>oOrders</Object>

</AdmInfo>

<QueryParams>

<DocEntry>285</DocEntry>

</QueryParams>

<Documents>

<row>

<DocDate>20060601</DocDate>

<DocDueDate>20060601</DocDueDate>

<CardCode>02095</CardCode>

<NumAtCard></NumAtCard>

<DiscountPercent>0.00</DiscountPercent>

<Comments></Comments>

<SalesPersonCode>-1</SalesPersonCode>

<ShipToCode></ShipToCode>

<DocumentsOwner>9</DocumentsOwner>

</row>

</Documents>

<Document_Lines>

<row>

<ItemCode>02TEST</ItemCode><ItemDescription>Kokeillaan taas (02TEST)</ItemDescription><Quantity>2</Quantity><ShipDate>20060601</ShipDate><Price>13.44</Price><Currency>EUR</Currency><DiscountPercent>4.00</DiscountPercent><WarehouseCode>01</WarehouseCode><SalesPersonCode>-1</SalesPersonCode><CostingCode /><ProjectCode /><VatGroup>V1</VatGroup><FreeText /><ShippingMethod>1</ShippingMethod>

</row>

<row>

<ItemCode>03TEST</ItemCode><ItemDescription /><Quantity>1.000000</Quantity><ShipDate>20060601</ShipDate><Price>120.000000</Price><Currency>EUR</Currency><DiscountPercent>0.000000</DiscountPercent><WarehouseCode>01</WarehouseCode><SalesPersonCode>7</SalesPersonCode><CostingCode /><ProjectCode /><VatGroup>V1</VatGroup><FreeText /><ShippingMethod>1</ShippingMethod>

</row>

</Document_Lines>

</BO>

</BOM>

</dis:UpdateObject>

</env:Body>

</env:Envelope>

02/06/2006 10:51:16 Start DoCommand

02/06/2006 10:51:23 End DoCommand

02/06/2006 10:51:23 Response (OK)

<?xml version="1.0"?><env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope">

<env:Body>

<dis:UpdateObjectResponse xmlns:dis="http://www.sap.com/SBO/DIS" CommandID="Update Documents">

<RetKey>285</RetKey>

</dis:UpdateObjectResponse>

</env:Body>

</env:Envelope>

Former Member
0 Kudos

Henry:

Maybe my question was not very well placed, my english is not the best.

What I need is some hints about the manipulation of the xml to get the data and return the modifications.

When you request a business objects, in the samples, we place the answer in a xmlelement. There we can retrieve every node with all the info.

But If I want to modify the info, should I have to construct the complete update xml?? Or can I modify the original xmlelement??

whats the best way to do it?

Thanks!!

Harold Gómez V.

Former Member
0 Kudos

Hi Harold,

What dev tools are you using ?

If you are working with .NET, you could read the xml document into a DataSet and then use the tools provided in System.Xml for modifying the data and writing it back to XML .

It seems that this is not really a problem related with DI Server but with XML processing in general... ?

Henry

Former Member
0 Kudos

Henry:

Yes, IU'm using .NET to build the website.

the problem is with XML and the structure of the messages.

I tried using a dataset, so I load the XML answer in a xmldatadocument, synchronizing the xmldatadocument with a dataset. Then I can make modifications in the datatables. But, then, the update XML is a little different with the XML that we read.

I tried getting an XML Template, an XML Schema, without success.

How do you do it??

Thanks thanks and more thanks!!

Harold Gómez V.

Former Member
0 Kudos

Hi,

There are a number of alternatives to deal with this problem. I often use a combination of different approaches, depending on the needs of the specific situation.

One approach would be to use XSLT transformation to transform the XML document into the format that DIS is expecting for updates (I haven't used this one myself).

Another approach would be to slice up the received SOAP document into parts that have the same schema for both retrieve and update: Documents and Document_Lines, for instance. You could modify each of these separately, then generate the xml for each of the parts and put the parts together before posting the update message to DIS.

Henry

Former Member
0 Kudos

Thank you very much, henry.

I'll try your second approach, first, mostly because using xslt is very time consuming.

Harold Gómez V.

Answers (0)