cancel
Showing results for 
Search instead for 
Did you mean: 

How to write XML tags of GRPO which has more than one document rows, SAP B1?.

former_member183402
Participant
0 Kudos

Hi all,

I have a question related to XML.

I'm not good in XML, but according to my example of tags and screenshots I can write XML tags which have CardCode and Dates of GRPO.

The problem I have now is I do know how I can include document rows in my tags

Example of tags

<?xml version="1.0" encoding="utf-8"?>

<GRPO>

<Goods>

<CardCode>V10000</CardCode>

<DocDate>07/11/2016</DocDate>

<DocDueDate>07/11/2016</DocDueDate>

<TaxDate>07/11/2016</TaxDate>

</Goods>

<Goods>

<CardCode>V1010</CardCode>

<DocDate>07/11/2016</DocDate>

<DocDueDate>07/11/2016</DocDueDate>

<TaxDate>07/11/2016</TaxDate>

</Goods>

</GRPO>

Screenshots

I want to have the above data in XML,

How can I include document rows in my XML tags?

Please anyone can help me.

Accepted Solutions (1)

Accepted Solutions (1)

Johan_H
Active Contributor
0 Kudos

Hi,

With all B1 related xml documents it is easiest is to first see what format the system outputs. You could adapt this code to get the xml representation of a multi-row GRPO:

Dim YourMultiRowGRPOnumber As Integer

Dim doc As SAPbobsCOM.Documents

        doc = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oPurchaseDeliveryNotes)

        If doc.GetByKey(YourMultiRowGRPOnumber) Then

            doc.GetAsXML()

        End If

Regards,

Johan

former_member183402
Participant
0 Kudos

Hi Johan,

I want to do a third party in php which will help me to import data in SAP B1 from XML file, so what I want to know is how the document headers and rows of GRPO can be written in XML tags in order to know how I will access data from XML file. From now I can access data from XML file but which has one row, I do know how to write XML tags which has more than one rows.

edy_simon
Active Contributor
0 Kudos

Hi,

Are you writing the 3rd party and in control of the format ?

If yes, I suggest you to follow what Johan pointed.

Following SAP's format of XML will help you greatly.

Example, with it's format you can just load the document and add it straight away without having to fill up each properties.

Note please set

oCompany.XmlExportType= BoXmlExportTypes.xet_ExportImportMode

Before exporting the document.

Regards

Edy

Johan_H
Active Contributor
0 Kudos

Hi,

Please use the code I gave you to get an example XML file, that will show you how B1 writes the tags for the rows.

How did you write the XML code that you have now ?

Regards,

Johan

former_member183402
Participant
0 Kudos

Hi Edy,

Yes I write the 3rd party in php by using DI API.

Let me try to use the above codes of Johan.

Answers (0)