cancel
Showing results for 
Search instead for 
Did you mean: 

xml structure for credit card payments

former_member468525
Participant
0 Kudos

Hello Experts,

I am creating an invoice bill project, I am using the sdk of SAP business one 9.1, in C # with visual studio which I care for xml the invoices to sap,

structure for a normal invoice.

<?xml version="1.0" encoding="UTF-8"?>
<BOM xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <BO>
    <AdmInfo>
      <Object>13</Object>
      <Version>2</Version>
    </AdmInfo>
    <QueryParams/>
    <Documents>
      <row>
        <DocDate>20171005</DocDate>
        <CardCode>C60000</CardCode>
        <Comments> factura 36457</Comments>           
      </row>
    </Documents>
    <Document_ApprovalRequests/>
    <Document_Lines>
      <row>
        <ItemCode>A00006</ItemCode>
        <Quantity>2.000</Quantity>
        <DiscountPercent>0</DiscountPercent>
      </row>
      <row>
        <ItemCode>S10000</ItemCode>
        <Quantity>1.000</Quantity>
        <DiscountPercent>0</DiscountPercent>
      </row>
    </Document_Lines>    
    <SerialNumbers>
      <row>
        <BaseLineNumber>0</BaseLineNumber>
        <InternalSerialNumber>A6-000301</InternalSerialNumber>
      </row>
      <row>
        <BaseLineNumber>0</BaseLineNumber>
        <InternalSerialNumber>A6-000302</InternalSerialNumber>
      </row>
      <row>
        <BaseLineNumber>1</BaseLineNumber>       
        <InternalSerialNumber>S1-000189</InternalSerialNumber>
      </row>
    </SerialNumbers>
    <Document_LinesAdditionalExpenses/>
    <LineTaxJurisdictions/>
    <WithholdingTaxLines/>
    <SerialNumbers/>
    <BatchNumbers/>
    <DocumentsAdditionalExpenses/>
    <DocExpenseTaxJurisdictions/>
    <WithholdingTaxData/>
    <Document_SpecialLines/>
    <TaxExtension/>
    <AddressExtension/>
  </BO>
</BOM>

I need to import invoices with credit card payments, what would be the way?

Accepted Solutions (1)

Accepted Solutions (1)

former_member233854
Active Contributor

You could try to create one document manually and use the method GetByKey then GetAsXML from Documents object to get the XML file you are looking for

former_member468525
Participant
0 Kudos

Hello, thank you very much for your answer, but how do I use the function GetAsXML?

former_member233854
Active Contributor
0 Kudos

See below, I got most of the code from SDK Help files

Dim vInvoice As SAPbobsCOM.Documents
Set vInvoice = vCmp.GetBusinessObject(oInvoices)


'Retrieve an invoice document from the database
RetVal = vInvoice.GetByKey("1023")
If RetVal <> 0 Then
     vCmp.GetLastError ErrCode, ErrMsg
     MsgBox "Failed to Retrieve the record " & ErrCode & " " & ErrMsg
     Exit Sub
End If

Dim xml As String
xml = vInvoice.GetAsXML()

Answers (1)

Answers (1)

ANKIT_CHAUHAN
Product and Topic Expert
Product and Topic Expert

Hi,

Adding to dkasparian 's suggestion:

You can use the DITool to detect the correctness of the XML payload. Refer to SAP Note 2057143 which mentions the details about DI Tool.

Hope it helps!

Kind regards,

ANKIT CHAUHAN

SAP SME Support

former_member468525
Participant
0 Kudos

Where can I find that note?