cancel
Showing results for 
Search instead for 
Did you mean: 

Converting Idoc flat file representation to XML

Former Member
0 Kudos

Hi ,

I went through the guide for How To Convert Between IDoc and XML in XI 3.0. I'm concerned with the second part of the guide which says convert from falt file representation of Idoc to XML. Can anyone tell me what are the other design and configuration objects to be created for this scenario ( message types,interfaces, mapping , etc )

Also which step of the pipeline does the converted XML goes to ?

The program also expects a filename, what if I want to pass the file name dynamically ? Any ideas on this one.

Hope someone replies this time.........:)

Thanks for you help and improving my knowledge

Thanks

Advait Gode.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi All,

Can somebody please help me with this scenario, I'm really stuck up in middle of no where.

Thanks In advance.

Advait.

Former Member
0 Kudos

COULD SOMEONE PLEASE REPLY TO MY QUERY

Former Member
0 Kudos

Hi,

firstly .. dont panic. what you are trying to do is standard configuration.

When using ALE programs like RSEINB00 you will be reading in a file which will be on your O/S or a mounted drive.

You will not need to do this using XI. You can use the Idoc adapter in XI which will convert the XML payload into IDOC-XML using meta data imported in transaction IDX2 in XI. Also you will need to configure a port using transaction IDX1.

The IDOC-XML will be passed to the application via this port at runtime where its converted into RFC protocol and the IDOC_INBOUND_ASYNCHRONOUS standard program will be called, which then looks up the partner agreement from WE20 to get the inboound process code to identify the inbound posting program i.e. IDOC_INPUT_<MSGTYP>.

You need to ensure that you are creating the segments and mappping the data correctly in message mapping for example.

mail me on mark.newman@mandant.net

Cheers,

Mark

Former Member
0 Kudos

Hi,

I think his problem is how the EDI will send the data to XI & how XI will red the incoming EDI message(Which is flat file representaion of IDOC).

well Advait I have a document from SDN iteself which wil

solve atleast some of ur issues. https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/xi/xi-how-to-guide... to set up an xi integration directory scenario with party to support edi partner processing.pdf)

what I can think at the moment is read the file using Sender file adapter & post the same using IDOC adpter.

Message was edited by: SACHIN KAGLIWAL

Former Member
0 Kudos

Hi Advait,

Let me give you a small overview on how inbound IDOCs work before answering your question-

The control record is the key in identifying the routing of the IDOC. If you try to think IDOCs as normal mails(post), the control record is the envolope. It contains information like who the sender is and who the receiver should be and what the envelope contains (no different than receiving mails/letters by post).

Then the data records contain the actual data, in our example would be the actual letter. The status records contain the tracking information.

Traditionally SAP's IDOC interface (even before XI comes in picture) has utility programs to post incoming IDOCs in to SAP. One such program is RSEINB00 which basically takes the IDOC file name and the port as input. This program opens the file and posts the contents to the SAP IDOC interface (which is a set of function modules) via the port. The idea is to read the control record and determine the routing and further posting to application. Note that one information in the control record is the message type/idoc type which decides how the data records need to be parsed.

Now in XI scenario, what happens if we receive data as flat file? Normally, we use flat file adapter and in the file adapter we provide information on how to parse the file. But, if the incoming file is flat and in IDOC structure, why do we have to configure the file adapter, when the parsing capability is already available using RSEINB00/Standard IDOC interface.

This the reason, the guide suggests you to use RSEINB00. Now, your concern is what if you need to provide a dynamic filename. My idea is to write a wrapper program. This would be an ABAP program in your integration engine. This program will determine the file name (based on a logic which should be known to you) and then call program RSEINB00 using a SUBMIT/RETURN. You would then schedule this ABAP program in background to run in fixed schedules.

There are other ways of handling your scenario as well but from limited information from your request, I will stop with this now. Post me if you have any more queries.

KK

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi Advaita,

i hope by this time you would have found a working solution for flatfile to IDOC conversion.

I have exactly similar requirement, i have to pick a file from the FTP server.The file being in IDOC(Flat) file format ,i.e, it has no delimiters and it is a fixed length based.

i have to convert this flat file into an IDOC (SHPMNT04,its a standard IDOC).It has a deep nested structure (upto 4 levels of heirarchy).

I am stuck at it ,thinking day and night about how to go about this :).

FCC wil not be able to create more then 2 levels,

I dont have free hands in java, and java mapping seems a bit complex as i dont have a delimiter and the incomming flat file is terribly big and complex.

ANY help will be greatly appreciated .

Regards,

Anika

Former Member
0 Kudos

Hello Ranjan,

Thanks for your reply.

well my scenario is that we have a EDI subsystem that converts a EDIFACT file into IDOC flat file.

We could have used ALE to post the Idocs into R/3 directly, but the Customer has decided to use XI as well.

So the scenario looks like this....

EDI Subsystem---->XI(app server)>IS---->R/3

EDI subsystem is sending us a Flat file representation of IDOC via ftp to the XI's app server, now if i need to process it through XI I will need a IDoc XML.

for this I found out about the how to guide which has 2 steps to be followed.

1. Create an ALE port of type File on the Integration Engine

2. Run the Program RSEINB00 on the Integration Engine.

This program takes parameter of the port name and the complete file name along with the path.

So thus I wanted to know if anyone has done this kind of scenario before and if they could help me with the other steps that need to be done in the IR or ID for the same. Since this is not a normal scenario I'm a bit confused as to what will happen after you run that program.

Unfortunately I dont have a test file to that as well.

Thanks

Advait.

Former Member
0 Kudos

Hi Advait,

Can you let me know what kind of architecture you ended up doing. I also have the same exact issue.

EDI subsystem is sending us a Flat file representation of IDOC via ftp to the XI's app server. and XI needs to send the IDOC to SAP.

appreciate it if you let me know what you did.

Thanks,

Gopi.

Former Member
0 Kudos

Hello,

The conversation of the flat file takes place at the Adapter side when it picks up the flat file and does the conversation as configured on the Sender File Adapter, the converted XML file then will be sent to the Integration engine.

Can you please let me know what do you want to achieve,

is it the flat file to be converted to IDOC, for IDOC you do not need to worry about converting into the XML the XI does it for you automatically. Whats the receiving system..etc

Cheers,

Ranjan