Convert flat file to IDOC
Hi SAP Gurus,
I got a flat file containing all the info about IDOC, how can I use this file to generate an IDOC.
Is there is any standard prog which takes the flat file & generate the IDOC.
Flat file contains all info i.e control record, data.
Thanks,
Krishna
store the file in application server and use WE16 trasaction, i think it will create IDOc from the file. use existing file port in 'POSRT' on selection screen of SE16.
Reddy
Similar Messages
-
Convert flat file to Idoc format
Due to some security reasons , the ALE scenario for material master is not allowed directly between 2 SAP systems
So the SAP system A is sending a flat file (not in Idoc format)
From SAP system B , we need to do an Inbound process to post the Idocs with following rough steps
1) Flat file upload
2) Flat file -> Idoc format conversion (EDI subsystem is not existing in this scenario and so this step has to be done within SAP)
3) Idoc processing
Even though this scenario can be accomplished without using Idocs ,
for better monitoring and reprocessing options it is required that Idocs need to be used.
Please explain the detailed steps for the above scenarioHi,
This sounds very much lie complicating things unnecessary...Are this 2 SAP systems of the same company ?
Why would using IDOCS be more insecure then using flat files ?
If the purpose is to have a manual check before upload, you can achieve the same with IDOCS.
Please add some background to the process,
regards
Dirk -
URGENT : Program to convert flat file to XML file.
Hello,
Good Morning. I want an urgent program to convert a flat file seperated by '/' to an XML file format and store that in the the application server. If any one has done such a developement, could you please send me the code.
The flat file format is as below :
72/070414/114147/11973//100-//EA/00000000///04198//RRT0/RC23///////353825001511172/72/070414/123620/11973//1000//EA/00000000///04198//RRT0/RC23///////354762008125236/72/070414/125411/13814//1000//EA/00000000///04198//INV/ID06///////90000000002697/72/070414/140820/11973//1000//EA/00000000///04198//RRT0/RC23///////353057002479718/72/070414/145438/13814//1000//EA/00000000///04198//INV/ID06///////90000000002739/72/070414/145438/11973//1000-//EA/00000000///04198//INV/ID06///////353057002479718/72/070414/150008/13814//1000
It needs to be filtered by removing the '/' and also grouped based on two fields namely store number and transaction number. The sample XML output required is as below :
<?xml version="1.0" encoding="ISO-8859-1"?>
<MT_POLL07 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../MT_POLL07.xsd">
<MessageHeader>
<File>
<Name>C:/kai/perl/storemaster_home/stores/09100/inbound/POLL07.DOS</Name>
<CreatedDate>Wed Feb 7 13:09:15 2007</CreatedDate>
<TotalRecordNo>19</TotalRecordNo>
</File>
</MessageHeader>
<Transaction>
<TransactionHeader>
<TRANSACTION>20070414001559</TRANSACTION>
<STORE_NO>09100</STORE_NO>
<BOFTTP>72</BOFTTP>
</TransactionHeader>
<Item>
<BOFTDT>070414</BOFTDT>
<BOFTTM>114147</BOFTTM>
<BOFSKU>11973</BOFSKU>
<BOFUPC></BOFUPC>
<BOFQTY>100</BOFQTY>
<BOFQTN>-</BOFQTN>
<BOFCST>0</BOFCST>
<BOFCSN>+</BOFCSN>
<BOFUM>EA</BOFUM>
<BOFHRF>00000000</BOFHRF>
<BOFSRF></BOFSRF>
<BOFVND></BOFVND>
<BOFLOC>04198</BOFLOC>
<BOFEQT></BOFEQT>
<BOFEQN>+</BOFEQN>
<BOFRTP>RRT0</BOFRTP>
<BOFREA>RC23</BOFREA>
<BOFCID></BOFCID>
<BOFAUT></BOFAUT>
<BOFCUR></BOFCUR>
<BOFPTP></BOFPTP>
<BOFUPT></BOFUPT>
<BOFUMR></BOFUMR>
<BOFSRN>353825001511172</BOFSRN>
<GMNUMBER>1</GMNUMBER>
</Item>
<Item>
<BOFTDT>070414</BOFTDT>
<BOFTTM>123620</BOFTTM>
<BOFSKU>11973</BOFSKU>
<BOFUPC></BOFUPC>
<BOFQTY>1000</BOFQTY>
<BOFQTN>+</BOFQTN>
<BOFCST>0</BOFCST>
<BOFCSN>+</BOFCSN>
<BOFUM>EA</BOFUM>
<BOFHRF>00000000</BOFHRF>
<BOFSRF></BOFSRF>
<BOFVND></BOFVND>
<BOFLOC>04198</BOFLOC>
<BOFEQT></BOFEQT>
<BOFEQN>+</BOFEQN>
<BOFRTP>RRT0</BOFRTP>
<BOFREA>RC23</BOFREA>
<BOFCID></BOFCID>
<BOFAUT></BOFAUT>
<BOFCUR></BOFCUR>
<BOFPTP></BOFPTP>
<BOFUPT></BOFUPT>
<BOFUMR></BOFUMR>
<BOFSRN>354762008125236</BOFSRN>
<GMNUMBER>2</GMNUMBER>
</Item>
</Transaction>
</MT_POLL07>
Please send me the code : It is urgent. Thanks in advace. Points to be rewarded.hi !
Check with this thread discuss the same
http://www.sap-img.com/abap/sample-xml-source-code-for-sap.htm
Flat file to XML
CONVERTION OF FLAT FILE TO XML : NO OUT PUT FOUND
Converting Idoc flat file representation to XML
how to convert flat file into IDOC-XML
Regds
Abhishek -
Converting a flat file to IDOC
Greetings to All,
I have a requirement where i need to convert an IDOC (flat) file to IDOC.
the idoc is SHPMNT04.Presently i am trying to implement it using FCC at the sender side as the flat file is fixed length type.
Can any one suggest me a better method like using XSLT or Java mapping which could make my work smarter as i am Finding it very difficult to count and write the FCC for the IDOC which is have more than 60 segments.
Any help will be greatly admired.
Thnaks,
Anika.Hi
I am still having a doubt if this method will work on real time scenario.I mean i have to pick files
from an 3rd party FTP location (polling and picking as and when i get a file starting with say
ABC*.txt).Added to this there will be issue related to the volume of file(1000 per day),will that create
any performance issues.
It is now that you are sharing the complete scenario/ problem , just have a glance from your first post at the top & the replies, because its the problem statement that steers the discussion.
Making the files available for the Report is a seperate task. You have to develop FTP-to-File XI scenario (or regular ftp process to send files across, which normally will not be allowed in XI server), I dont see any other way, if any, I 'assume' that it might complicate the situation.
Performance - it is not something to do with your scenario alone, but the overall system load, configuration etc. (b.t.w 1000 is normal)
Can we schedule a job for running the report periodically?
Yes, scehdule a batch job calling this Report (with necessary variants) with required frequency or exact time (if there is any agreement with sender)
I have started a POC
I appreciate that, best way at this moment. you can reverse engineer from the errors to configure your scenario. for any reason,if you think it does not work, you can always stop and/or look for different solution.
need your help
- Definitely I will share my thoughts, if time permits
how will i get the flat file xml(IDOC) in the source side
do you mean the source structure, you can use the same structure as your target.
once you are convinced with your solution approach, then it is better to close this thread & start a new one with new issues, for more views & suggestions and better readability.
@Rajesh - I appreciate your efforts to solve the issue , but the below is not correct & possible, w.r.t this issue
Here what you need is to do configure File Sender CC with NFS protocol.
Regards
Vishnu -
How to convert Flat file(.txt) data to an Idoc format(ORDERS05)
Hi,
How to convert Flat file(.txt) data to an Idoc format(ORDERS05). If any FM does the same work please let me know.
thanks in advance,
Chand
Moderator message : Duplicate post locked. Read forum rules before posting.
Edited by: Vinod Kumar on Jul 26, 2011 11:11 AMHi,
For more information, please check this link.
http://sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/46759682-0401-0010-1791-bd1972bc0b8a
Have a look at the FM IDOC_XML_FROM_FILE. May be it helps...
Regards -
Hi,
I have a requirement wherein we have to read the IDOC flat file and post it as IDOC to SAP using XI. I understand we have to use the Flat File Sender adapter and the IDOC Receiver Adapter. On the Sender Side we have to define the Content Conversion to convert the IDOC Flat File to IDOC XML. Writing File Content Conversion for the IDOC Flat File would be very tedious because of the number of fields and fixed structure of the flat file.
I have don through the following guide Section 3.2 where it talks abt converting IDOC to IDOC XML using reportRSEINB00.
https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/xi/xi-how-to-guides/how%20to%20convert%20between%20idoc%20and%20xml%20in%20xi%203.0.pdf
I am not clear how to invoke this report in the Flat File Sender adapter. Also is there any other approach.
Thanks
Rajeev GuptaHi Rajeev
You have a flatfile at the sender side so you dnt have any feasiable option to do other than FCC....FCC is not a tediuos one...if you can provide the strucutrre we will help you out...
Check out you have a fixedlength file or piple separated one....
In the functional design how many fields re present and buil the DT,MT MI accoprdingly.....
you have to just use some conecnt conversion parameters that's it...
item.fieldSeparator
item.endSeparator
item.fieldNames
here item is your recordset name
let us know your strucutre
regards
Nisar -
IDOC to Flat file and Flat file to IDOC
Hello Experts,
I have the following requirement in my current project:
Third Party Sender sends the data in the in the below XML format via HTTP:
<?xml version="1.0"?>
<fxEnvelope>
<header>
<message>
<exchangeID></exchangeID>
<messageID></messageID>
<subject></subject>
<payloadType>IDOC</payloadType>
</message>
<from>
<orgID></orgID>
<locationID></locationID>
<messageID></messageID>
</from>
<to>
<orgID></orgID>
<locationID></locationID>
</to>
</header>
<body>
<Opaque>
<DataType></DataType>
<DataStream></DataStream>
</Opaque>
</body>
</fxEnvelope>
In the above XML, the Tag <DataStream> is a string which contains the IDOC flat file.
Now, the scenario is HTTP to IDOC, where the sender sends the above XML payload and PI needs to convert <DataStream> to IDOC XML and pass it on to the receiver R/3.
But the challange i am facing is converting this <DataStream> tag which contains the IDOC flat file to IDOC XML using a Mapping program.Since both adapters are running on ABAP stack i can not go for Adapter Modules available(We are using PI 7.10).
Looking for some guidance on the same.
Thanks in advance.
Cheers,
Manasa.There are 2 options for you
In either case, you might need a java mapping to convert the DataStream into String. Use a file adpater to write this string to IDOC-File.
1) Option1: Write the content of DataStream into IDOC-Flatfile.(java mapping) Pick it from PI to convert IDOC-flat file inot IDOC-XML (using std features of PI) & send it to ECC.
2) Option2: Write the Content of DataStream to IDOC-Flatfile (accessible to ECC system). Configure WE21 to pick the file from a file port.
If the datastream was IDOC-XML, then it would have been simpler, it will be a direct communcation from PI to ECC (using java mapping & IDOC adapter).
Regards,
Siva Maranani -
I am receiving flat file in SFTP Server which need to be posted into SAP (No mapping involved)
What will be the best approach ?
1. I tried using IDOCFlatToXmlConvertor (The limitation in the format of source file. The parent and child node relationship should be explicitly mentioned in IDoc flat file which legacy system is not able to do) - Any workarounds ?
2. I moved the Idoc flat file into SAP application server. Now need to schedule job using program RSEINB00
3. File Content Conversion
Any other better solution ? Appreciate your help.
Thanks and regards,
Jose AugastineFor converting Idoc Flat file to idoc xml, ABAP mapping is one of the feasible option.
-
Flat File to IDOC Mapping requirement to generate Multiple Segments
Hi Experts,
I got a requirement were i have 2 records in a file and i need to generate 2 IDOCs with multiple segments in it.
FILE :
10/01/2010 101 KRNA ic_quantity 30-0257 3526 1 1 ea 110000 10
10/01/2010 101 KRNA ic_quantity 90-0005 3526 1 2 ea 110000 10
Idoc should generate 2 IDOCs with multiple segments as shown below
I have imported the IDOC and changed the occurrence to " unbounded "
The Basic IDOC Type : WMMBID02
I need to generate Multiple segments of E1MBXY1
i.e.., First IDOC should contain two E1MBXY1 segments
Second IDOC should contain Four E1MBXY1 segments
IDOC1 : WMMBID02
Segment : E1MBXY1( 2 segments)
10/01/2010 101 KRNA ic_quantity 30-0257 3526 1 1 ea 110000 10
10/01/2010 101 KRNA ic_quantity 90-0005 3526 1 2 ea 110000 10
IDOC2 : WMMBID02
Segment : E1MBXY1 ( 4 segments)
10/01/2010 101 KRNA ic_quantity 30-0257 3526 1 1 ea 110000 10
10/01/2010 101 KRNA ic_quantity 30-0257 3521 1 1 ea 110000 10
10/01/2010 101 KRNA ic_quantity 90-0005 3526 1 2 ea 110000 10
10/01/2010 101 KRNA ic_quantity 90-0005 3521 1 2 ea 110000 10
Can anyone suggest me how to generate IDOCs with multiple segments
what are multiple ways of generating it
Whether it can be achieved using Multi-mapping or I need go for UDF
If any one has done has done this type of requirement ,please share the points.
Thanks
SaiBasically you need to generate idoc per record in the flat file. During fcc conversion you convert flat file to xml structure at the sender side. In the mapping use xml file structure source and idoc as receiver structure. You just export idoc and update the idoc segment 1 to unbounded. Please follow the michael blog for file to idoc multimapping without bpm. Yes without bpm it is possible.
see this link... This will answer your requirement.
https://wiki.sdn.sap.com/wiki/display/XI/File%20to%20Multiple%20IDOC%20Splitting%20without%20BPM
>Whether it can be achieved using Multi-mapping or I need go for UDF
you dont need udf for this. -
Hello All,
I have a file in application server, now I need to convert this file into IDOC format and save the records in SAP database. Can any one provide us the steps to do this. I would like to know how to create a port for file type to read the flat file.
Thank you,Hi,
Create a Z program in se38 and in that you will have to make use of OPEN DATASET, READ DATASET and CLOSE DATASET statements to read the fiel from the application server.
IDOC is just an intermediate document with some structure.
It does not have a capability to read a file by itself.
The file had to be explicitely read from the application server making use of the above statements and then pass the data to the idoc structure.
For more help do F1 on these statements.
Regards,
Ankur Parab -
Converting flat file to XML using JMS
Hi,
I want to convert flat file to xml. My sender adapter is JMS,
Can anyone tell me that how to do that conversion ? Conversion is very simple.
Can we use File content conversion in JMS Sender ? any link or blog ? or any other idea to achieve this ?
Regards
KulwinderHi,
The pdf has been removed from that link i suppose.
Anyways, go through the below help, everything that is there in "HowToConveModuleJMS.pdf" has been mentioned in this...
http://help.sap.com/saphelp_nw04/helpdata/en/24/4cad3baabd4737bab64d0201bc0c6c/content.htm
Hope it would surely help you.
You can go through the below link, for better understanding..
https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/a05b2347-01e7-2910-ceac-c45577e574e0
Regards,
Swetha.
Edited by: Swetha Reddy on Feb 26, 2009 5:30 AM -
Flat File to IDOC- didn't get data into IDOC
Hi All,
Our scenario is Flat File to IDOC....
working fine... didn't get any errors... IDOC also generated but didn't get any data in that IDOC....
for details see the attachment...
Thanks In Advance,
vishnu.........Hi Rajesh,
I am getting payload in RWB from sender Cc like below:
<?xml version="1.0" encoding="utf-8" ?>
- <ns:MT_File xmlns:ns="http://mouritech.com/file2idocsender">
- <MT_File>
<Value>1</Value>
<Reason>test</Reason>
</MT_File>
</ns:MT_File>
If i test with this payload in mapping i am getting a pop up with this message and mapping not completed ...
Could you please let me know what i have to do now?
Pop Up:
The processing instruction target matching "[xX][mM][lL]" is not allowed.
See error logs for details -
Converting flat files to csv format
hi,
Iam converting flat files to csv format..the problem is that iam running a script for inserting values.while i run this script it works fine .but while i open this csv file the datas in the excel sheet is not coming in a single line that is for a particular record its moving to second line .there is a break for a single record.so there is a problem in conversion.can anything be done in it this to avoid the breaking of lines
thanks
RatheeshYOGenereally, you shouldn't convert from a lossy format AAC or MP3) to another lossy fomrat.
It's called loss because you lose information when you convert it.
If you only use these files on the computer and the iPod, I'd recommend AAC. Better quality at same bit rate as MP3. -
Flat file with IDOC structure on sender side - how to convert
Hello,
I have a flat file with an IDOC structure in it, like produced from R/3.
Example:
EDI_DC40 4000000000000761577620 3014 ORDERS05 ORDRSP SAPR3P LS LS_R3P_302 DATEIPORT2KMBG0000019887 20061206095508 20061206095508
E2EDK01005 400000000000076157700000100000001004 EUR 1.00000 0039 DFUE0000543012 12Muenster/Weststr.0000019887
E2EDK14 40000000000007615770000020000000200630
E2EDK14 40000000000007615770000030000000200710 ......
I need to send this file via XI to an R/3 system as an ORDERSP IDOC.
My question is:
What is the easiest way to do this?
My intention is to us a self programmed mapping!
Best regards
Dirk
nullHi Shabarish,
I found a sinple solution:
File adapter picks up file from external drive
Receiver adapter saves it on XI server directory
We21 can pick up now from here!
But, next problem:
When trying to save the file port in We21 (like described in the guide) I get a message: Port incomplete, not possible to save! (mess. is green -> information).
But I cannot save the port. What is wrong?
Hm, possibly reason was that inbound and outbound file name was the same! Now its OK! Port is created!
Regards
Dirk
Message was edited by:
Dirk Meinhard -
Suggesstions on flat file to IDOC
Hi,
Help me on following topics,
1) What is the use of port in program RSEINB00. I want this program to read a flat file and convert it into IDOC. How does this program recognize to which IDOC format it has to convert the flat file.
2) what is the use of file port and ABAP port when to use them. My requirement is to download a flat file or CSV flie into the customer system through FTP.Can I specify the path in the directory itself or do i need to write a seperate program for this.
3) what is the use of function module in file port.Is it used to generate file name alone or file itself.Can we write a own function.
Thanks & Regards,
Kaarthik.kKarthik,
You know what you could do.. To get the input file format
First download the MATMAS IDOC or any idoc for that matter to a flat file, using the standard transaction BD10.
Then see the format.
As a third step upload the same file as input file with minimal changes to the data keeping the format same.
This way you can figure out how the system is able to fetch all the configuration details.
Hope this helps.
Rgds,
HR
Maybe you are looking for
-
Cost Component structure field and table names
Hey all, i need to code a BADI to push value of one column in cost component structure to another column in ccs for only order settlements.. any idea how to do this?? i am very new to abap please take it easy on ur answer.. i coulndt even find in whi
-
I have had this system running for over a year now. AMD Opteron 2356 (Barcelona's) x2 PC&PC 860W Single Rail PSU 16 GB RAM (has only been at 16 GB for about 3 months dual ATI 4850 HD 's (run 3 HP LP2465's) It has worked for well over a year like I
-
Tranposrt - Purchase Requisition Release Strategy with Classification
Gurus! Tell me if I want to Transport the Purchase Requisition release strategy with classification. The Data in each charisteristics in each PR Strategy that I have set in Dev is not getting transported to Quality. Do I have to enter the data in cha
-
Imessage wont send face time dosnt work
my imessage wont send and my facetime wont work
-
I currently have iweb 06 and when I published through 06 it gave me the crazy URL. I copied the URL and then went to godaddy and had them forward my URL I had registered with them to the crazy iweb URL. It works like a charm. Here's my problem... I a