cancel
Showing results for 
Search instead for 
Did you mean: 

Automate flat IDOC to XML IDOC using one interface

Former Member
0 Kudos

Hello all,

We are currently going through a migration process where XI will be replacing a legacy system. As part of our testing procedure, we are using historical data pairings from the legacy system and using an automated tool to compare if the interfaces we develop in XI match. The catch is we need the data that we are comparing in XML format for the automated tool to be able to do the comparison, and unfortunately the legacy data is a flat format. So now I would like to automate a way to convert this data to XML format.

Specifically for IDOCs, I would like to have an interface which picks up the flat files, transforms them to XML, and then drops them back into another file directory in the XML format. It would need to be able to pick up any kind of IDOC (given that XI has the metadata already imported), recognize what message type it is, then do the conversion.

I have been reading on SDN and found that there is a standard tool to do the conversion, but it appears it can only handle one kind of IDOC at a time, and it appears it only picks up one specifically named file at a time.

Has anybody tried to implement a scenario like this? Any help is appreciated (A walkthrough would be the best!).

Thanks in advance,

Mike

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

We decided to upgrade our sandbox to EPH1 and are going to use that for the IDOC conversions. Thanks all for your help.

Former Member
0 Kudos

Mike,

What version of PI will you be using? PI 7.11 can now auto-convert Flat File IDocs to XML IDoc and vice versa.

Here is the documentation:

http://help.sap.com/saphelp_nwpi711/helpdata/en/b5/bd93642dd3410f90ebea702399fac4/frameset.htm (flat to XML)

http://help.sap.com/saphelp_nwpi711/helpdata/en/74/a45bc07e2043fb9b63295229178903/frameset.htm (XML to flat)

I have not tried this personally, but seems like you might be able to use a "File to File" scenario with no mapping, and use the "IDOCFlatToXmlConvertor" Module in your File Adapter Comms Channel and it may just work, giving you files that are the IDoc XML version of the flat file it is reading. It looks like it does an RFC call to the back-end SAP system where the IDocs are originally from (or could be any system as long as you know the IDocs in there are identical), and reads the IDoc metadata (which has always included flat file field offsets for each IDoc Segment Field), and applies that either to convert from flat file IDoc to XML IDoc, or XML IDoc to flat file IDoc.

It does mention that there is a limitation that there can only be one IDoc in the source flat file - could be a problem if you have many in one file, which is pretty typical.

Regards,

Brendan

Former Member
0 Kudos

Thanks Brendan, I'll look into this.

We currently use XI 3.0 in our dev environment, but we do have PI 7.1 installed on a sandbox. Does it have to be 7.11 specifically?

Former Member
0 Kudos

Mike,

I believe it has to be 7.11.

If you have a look below, it's listed as a new feature in the Release Notes of PI 7.1 "Enhancement Pack 1":

http://help.sap.com/saphelp_nwpi711/helpdata/en/3f/04f81145834bada3c53cb1047c6724/frameset.htm (about 5th item from the bottom).

Good luck.

Regards,

Brendan

Former Member
0 Kudos

Mike,

We currently use XI 3.0 in our dev environment, but we do have PI 7.1 installed on a sandbox. Does it have to be 7.11 specifically?

This functionality is available from PI 7.1 ehp1.

Since you are not on 7.11, then you can bring the file in NFS location, and run a report in SE38 (RSEINB00) which will convert into IDoc-XML. Pass the file path and file port as input parameters for the report to execute.

You can schedule the report from a custom report by passing the required variants.

Definitely 7.11 will make life easier

Hope this helps.

Regards,

Neetesh