cancel
Showing results for 
Search instead for 
Did you mean: 

Create A/R Invoice and Its Incoming Payment using DI Server

Former Member
0 Kudos
473

Hi Everyone,

I need to create an A/R Invoice and its payment in a sigle transaction using DI Server. The problem is that I don't know the DocEntry that will be assigned to the invoice in order to set it in the SOP message for creating the incoming payment.

I guess the SOAP message should look like:

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

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

<env:Header>

<SessionID>F46EDCE6-3F79-1F9F-1D1E-DC6226D04FA7</SessionID>

</env:Header>

<env:Body>

<dis:AddObject xmlns:dis="http://www.sap.com/SBO/DIS" CommandID="Add invoice">

<BOM>

<BO>

<AdmInfo>

<Object>oInvoices</Object>

</AdmInfo>

<Documents>

<row>

<DocDate>20040707</DocDate>

<DocDueDate>20040707</DocDueDate>

<CardCode>BP</CardCode>

</row>

</Documents>

<Document_Lines>

<row>

<ItemCode>Item1</ItemCode>

<Quantity>3</Quantity>

<TaxCode>My Tax</TaxCode>

</row>

</Document_Lines>

</BO>

</BOM>

</dis:AddObject>

<dis:AddObject xmlns:dis="http://www.sap.com/SBO/DIS" CommandID="Add Incoming Payment">

<BOM>

<BO>

<AdmInfo>

<Object>oIncomingPayments</Object>

</AdmInfo>

<Payments>

<row>

<CardCode>BP</CardCode>

<DocTypte>rCustomer</DocTypte>

........

</row>

<Payments>

<Payments_Invoices>

<row>

<DocEntry>???</DocEntry> <----


???

<InvoiceType>it_Invoice</InvoiceType>

<SumApplied>100</SumApplied>

</row>

</Payments_Invoices>

</BO>

</BOM>

</dis:AddObject>

</env:Body>

</env:Envelope>

Any help?

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi Jane,

Then, could you please explain it in detail, and please don't refer me to the documentation because I've read it all and there is nothing about it

Thanks in advanced

Former Member
0 Kudos

Dear Hugo Moreno,

Basically the DI Server has same objects and methods as the DI API.

Best Regards

Jane Jing

SAP Busienss One Forums team

Former Member
0 Kudos

Dear Hugo Moreno,

You could use the GetNewObjectCode Method of the Company Object to retrieves the key of the last added record.

Please refer to SDK DI API help for this method.

Best Regards

Jane Jing

SAP Business One Forums team

Former Member
0 Kudos

I'm using DI Server, not DI API, so the GetNewObjectCode method is not the answer

Thanks