cancel
Showing results for 
Search instead for 
Did you mean: 

How to convert iDocs in flat format to Xml

Trinidad
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi,

I'm getting iDocs in my .NET application using the SAP .NET Connector.

But SAP Connector I receive the iDocs in flat format that is very difficult to read, it would be much easier if I had them in xml format. Do you know an easy way for transforming them to Xml or diretly receive them in Xml format?

I'm a C# developer, so the best solution for me would be to have a small sample showing how to do it.

I have seen some documents about the IDoc Adapter, how can it be used? Should it be used together with the SAP .NET Connector or it is a separate way of working?

Maybe my questions are very basic but I come from the SAP Business One word that is completely different from the ERP world.

Thanks in advance

Trinidad.

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

Hi This is vijay

we can convert the iDocs

by that business object getbykey method we can export the data form sap B1 to XML

Dim iDocs As SAPbobsCOM.Documents

oCompany.XmlExportType = SAPbobsCOM.BoXmlExportTypes.xet_ExportImportMode

iDocs = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oInvoices )

iDocs.GetByKey(txtKey.Text)

iDocs.SaveXML(txtFile.Text & ".xml")

bhavesh_kantilal
Active Contributor
0 Kudos

Hello,

SAP Provides a standard report / program that converts the idoc flatfile into Idoc XML.

The report is : rseinb00

Just make sure that the Idoc Flat file is formatted in the right way,

1. Linefeed after every segment,

2. Idoc Control Record matches the logical system name of the business system defined in XI.

3. Port in the idoc control record exists.

If this is going to be a end to end interface flow, using this in a ABAP Mapping and then feeding this as the input to your graphical mapping might be a solution.

Regards,

Bhavesh

prateek
Active Contributor
0 Kudos

The flat format of IDoc are created when u use the File Port at the R3 system to genarate the Idocs. (Tcode we21 at R3) If u r using XI as middleware, then instead of genrating files for Idoc, directly use ALE settings to send data to XI. This will be received automatically in the XML format and from there u may send it to the receiving system.

Regards,

Prateek

Trinidad
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi,

As my knowledge in ERP is very basic I understand the ideas but I don't know how to put it in place.

@Prateek:

When you say "This will be received automatically in the XML format and from there u may send it to the receiving system", how should I do that? Will I receive the Xml IDocs also using .NET Connector SAPIDocReceiver class or how can I do it?

@Seshagiri:

I can develop my application as a WebService if it will be easier for having the iDoc in Xml format. How should I proceed? Do you have a sample or documentation who could guide me?

Thanks a lot

Trinidad.

prateek
Active Contributor
0 Kudos

I am not much familiar to the .Net connctor. Are u using XI? If u r planning to move to XI, then u may use this

https://weblogs.sdn.sap.com/pub/wlg/2131 [original link is broken] [original link is broken] [original link is broken]

With XI, u will have a very simple scenario Idoc -> XI -> .Net Application (Webservice). Then u will have the Idoc coming into XI in xml format directly. U will have to configure the ALE settings in sender SAP system and thats it.

Regards,

Prateek

Former Member
0 Kudos

Hi,

As you said if Your .NET Application can be expose it as Webservice means

In XI Develop Idoc-XI-SOAP Scenario and

Configure Your Receiver SOAP Communication channel by providing the target .NET applications webservice URL and corresponding Action.

Reffere this Sample IDOC--File scenario for Your Development

http://saptechnical.com/Tutorials/XI/IDocToFile/IDocToFile1.htm

REgards

Seshagiri

Trinidad
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi,

Thanks for your answers, I'll read the links you gave me and try to see if I succeed to implement the solutions you proposed.

I'll give you some news soon

Trinidad.

Former Member
0 Kudos

Hi,

If Your .NET Application can be Expose as Webservice means, You can have the following scenario in place

IDOC(SAP)-XI--SOAP(Webservice)

OR

If you just want to receive the idoc data into xml format means , you can have

IDOC--XI--File scenario which will have the xml file at the end of scenario

Regards

Seshagiri