cancel
Showing results for 
Search instead for 
Did you mean: 

How To Convert IDOC to FLAT File ?

Former Member
0 Kudos

Dear Expert,

My requirement is to convert the IDOC to FLAT File using XI. How can i do this. I have gone thru the Guide How to convert IDOC to Flat file using ABAP mapping but it does not talk about what are all the stpes i need to do in IR & ID.

I am ready to use ABAP mapping since i am an ABAPER.

Is it recommended to use ABAP mapping since we expect daily 500 IDOCs to be converted to a flat file & transfer this flat file to some FTP location.

Can anybody tell me the stpes how to do this in XI. The steps i am expecting like how to define the Data Type / Message type / Mapping etc & how to configure the channel ?

The Flat file i want to convert should look like the way IDOC file gets created in FILE FTP port in SAP.

Regards,

Umesh

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Umesh Sonawane ,

The following web-sites give u a step-by-step solution to solve u'r problem:

How to convert an IDoc-XML structure to a flat file and vice-versa in XI 3.0

https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/46759682-0401-0010-1791-bd1...

Introduction to IDoc-XI-File scenario and complete walk through for starters.

/people/prateek.shah/blog/2005/06/08/introduction-to-idoc-xi-file-scenario-and-complete-walk-through-for-starters

IDOCs (Multiple Types) Collection in BPM

/people/pooja.pandey/blog/2005/07/27/idocs-multiple-types-collection-in-bpm

Pls reward points if u find this useful!

cheers!

gyanaraj

Former Member
0 Kudos

Hi gyanaraj ,

Thanx a lot for your help my proble got solved with the Help of the links which you have forwarded. I have used ABPA mapping & the problem got solved.

I have only once Question. How to give a dynamic name in FILE FTP Receiver channel.

my requirement is NT(DDmmyyhhmmss).out.

I have used add timestamp but it gives in SAPFormat as YYYYMMDD how to change this to my customized format.

Pl. reply.

Thanx a lot & yes i have awared a points to you

Regards,

Umesh

Answers (5)

Answers (5)

Former Member
0 Kudos

THANX a lot....

Former Member
0 Kudos

Hi Umesh,

<i>The Flat file i want to convert should look like the way IDOC file gets created in FILE FTP port in SAP</i>

As i guess , u r file structure should be like your Idoc structure, Import u r IDoc and create the data type for file and corresponding message type and Message interface.

Do neccessary message & Interface mappings.Create a configuration scenario and perform Receiver, Interface determination and receiver aggrement.No need of Sender channel where Idoc is u r sender message.

Create communication channel of File Adapter and direction as reciever,<b>Under Processing Parameters Set File Constructuion mode as Append</b>.It will append all the Idocs data into a single file.U need to replace of the file to other directory once the Idocs are processed in the particular interval.

Check it out this option whether it would useful for your requirement.

Cheers

Veera

>>>Reward points,if it is needful

Former Member
0 Kudos

I think there is some confusion... Let me explian my problem once again.

I want to convert the Shipment IDOC as it is the moment the shipment documents gets created in R/3. I dont want to collect many IDOCs & make as single file. For each IDOC it should create a Flat File.

Secondly if i have to MAP the whole IDOC the graphical mapping is too difficult.

So instead of that can i use ABAP/XSLT/JAVA whichever is easy. ?

Since i am ABAPER i can use ABAP mapping.

The Output file should look like as below.

EDI_DC40 9000000000011785526620 3012 OILSHI01 OILSH1 SAPP01 LS SAPCLNT900 A000000018LS WBIMQSI 20071031161506 20071031161506

E2OILSH001 90000000000117855260000010000000250 1011537344 1101 1 300X1 TRKGMKG 0202KG KG X ZTLF X XX 000 BLX X X60002200710310000002007103100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 E2OILSA 9000000000011785526000002000001031011537344000001SP 0000201496000000000000000000 00 00 V E2OILSA 9000000000011785526000003000001031011537344000002SP 0000201496000000000000000000 00 00 S

E2OILSV 900000000001178552600000400000103MH04CG6052 LPBW50D62401033 000020149601KG KGM 35200.00000 17200.00000 18000.00000 0.000 0.000 0.000 DLLPGB220071031000000 00000000000000000000000000000000000 0000XX 6000AAAA0.00000 0.00000 17200.00000 35200.00000 18000.00000 MH04CG6052 new bulk tender approved rs LPG Bulk Lorry - WR Refinery TPP BABA TRANSLINES kg kg 0.000 0.00 0.00 E2OILSC 9000000000011785526000005000004041 001 18000.000000 18000.000000 35200.000000 0.000000 0.000000 KG E2OILSQ001 9000000000011785526000006000005050011 MH04CG6052MH04CG60521J 05041089055000 00000118000.0000000 KG 18000.000000 18000.000000 6000V04 18000.000 KGM18000.000 KGM00000000 V 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0001 E2OILS2 9000000000011785526000007000004040001000001000200020000.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 XX0000000000000000000000000000 XX0504108905J5000 PUNE LPG BOTTLING PLANT START 0001 1END 0001 10.000000 0.000000 0.000000 0.000000 0.000000 0.000000

Pl. Help me its Urgent.

Regards,

Umesh

Former Member
0 Kudos

Hi,

If the requirement is to collect the idocs once into a flat file and then then transfer it to a ftp server then it rather better to follow stefan blog

/people/stefan.grube/blog/2006/09/18/collecting-idocs-without-using-bpm

<b>Cheers,m

*RAJ*</b>

Former Member
0 Kudos

umesh,

Gothrough these blogs,

/people/prateek.shah/blog/2005/06/08/introduction-to-idoc-xi-file-scenario-and-complete-walk-through-for-starters

/people/ravikumar.allampallam/blog/2005/06/24/convert-any-flat-file-to-any-idoc-java-mapping

/people/pooja.pandey/blog/2005/07/27/idocs-multiple-types-collection-in-bpm - Collection of IDoc to Single File

/people/r.eijpe/blog/2005/11/04/using-abap-xslt-extensions-for-xi-mapping - Using ABAP Mapping

Regards,

Yuva

Former Member
0 Kudos

Umesh,

this is what u want!!

https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/e07dcaa0-a92b-2a10-3a96-b3d942bd...

regards

biplab

**reward if it helps you!!!