Flat file to idoc MATMAS05 - mapping
Hi,
I want to create 2 Idocs from one recordset.
Can any one tell me how do I map this Recordset to an Idoc?
Example source and target IDOC structures:
Source:-
<Recordset>
<SA010>
<IDENTS>1234</IDENTS>
<BEZ>Dummytxt</BEZ>
</SA010>
<SA088>
<IDENTS>1234</IDENTS>
<MARC1>010</ MARC1>
<MARC2>020</MARC2>
</SA088>
</Recordset>
Target:-
<MATMAS05>
<IDOC BEGIN="1">
<E1MARAM SEGMENT="1">
<MATNR>1234</MATNR>
<E1MARCM SEGMENT="2">
<WERKS>010</WERKS>
</E1MARCM>
</E1MARAM>
</IDOC>
</MATMAS05>
<MATMAS05>
<IDOC BEGIN="1">
<E1MARAM SEGMENT="1">
<MATNR>1234</MATNR>
<E1MARCM SEGMENT="2">
<WERKS>020</WERKS>
</E1MARCM>
</E1MARAM>
</IDOC>
</MATMAS05>
Thanks and Regards,
Eren
Hello Varun,
My flat structure:
<Recordset>
<b><SA010></b>
<i><IDENTS>1234</IDENTS>
<BEZ>Dummytxt</BEZ></i>
<b></SA010></b>
<b><SA088></b>
<IDENTS>1234</IDENTS>
<i><MARC1>010<>
<MARC2>020</MARC2></i>
<b></SA088></b>
</Recordset>
The MATNR field is <IDENTS>. I can pick the value from node <SA010> or <SA088>.
Thanks
Similar Messages
-
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 -
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- 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 -
Reg: File to Idoc Hierarchial mapping
Hi Experts,
We have a scenario of flat file to idoc where in we have 4 segments(01 to 04)(with hierarchies) in source file to be mapped to idoc. We have followed Riaz blog http://www.riyaz.net/blog/xipi-convert-flat-file-to-deeply-nested-xml-structures-using-only-graphical-mapping/.on mapping flat file to deeply nested structures .
We have encountered one unique issue in the intermediate level mapping where, when assigning hte id numbers, the instances of one segment are grouped together. This is creating a problem.
Ex: in source str we have nodes in the order
01
02
03
04
02
03
04 and so on..
After the test of intermediate mapping, it shows teh follw sequence:
01
02
02
03
03
04..
The node seq in the target str should have been similar to that of the source.. but here its not so..
if i am using just one instance of 01 till 04 nodes.. the final xml str is created perfect.. Can any please let me know what could be the possible error??
Or please let me know if there is any other simple procedure to finish this.
Thanks in advance, awaiting your reply..
Best Regards,
GiriHi,
Please go through the following links..
http://wiki.sdn.sap.com/wiki/display/XI/SampleJAVAMappingcodeusingPI7.1+API
http://wiki.sdn.sap.com/wiki/display/XI/UsingPI7.1APIforJavamapping
and also,
http://help.sap.com/saphelp_nwpi71/helpdata/en/bd/c91241c738f423e10000000a155106/content.htm
If u get any doubt u can post the problem....
Babu -
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 -
Flat file to idoc mapping issue
Hi Gurus,
i had a flat file format in sender side as below:
H_ID TYP_CODE line_elemet Quantity
5896 STANDARD 1.transmitter 1
5896 STANDARD 2.xxxxxxxxx 1
5896 STANDARD 3.yyyyyyyyy 2
6895 STANDARD 1.aaaaaaaaa 1
9436 STANDARD 1.bbbbbbbbb 4
9436 STANDARD 2.ggggggggg 3
The above file need to be send to an Idoc.
for which same header_ID values should create only one header segment, under that many a line segments should create as many line items appear on that header_id value.
Here my query is how to suppress the repetetive header values to create onlyone header segment. And how to create as many line_item segments as the number of line items appear.
points obvoius for the response
Thanks in advance,
Sekhar.About map problem I suggest youn to see the following link that are really helpful to improve knowledge about mapping:
/people/sravya.talanki2/blog/2005/08/16/message-mapping-simplified--part-i
/people/sravya.talanki2/blog/2005/12/08/message-mapping-simplified-150-part-ii
I suggest you to see the following link to learn more about mapping:
Mapping functionality in XI
https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/9202d890-0201-0010-1588-adb5e89a6638
SAP Exchange Infrastructure - Graphical_Mapping
https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/6658bd90-0201-0010-fbb6-afe25fb398d3
SAP Exchange Infrastructure - Graphical Mapping Exercise
https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/fd5ebd90-0201-0010-d697-91374d5b5190
SAP Exchange Infrastructure - Graphical Mapping - Advanced
https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/be05e290-0201-0010-e997-b6e55f9548dd
SAP Exchange Infrastructure: Mapping Patterns - Understand Context Handling in Message Mapping - Webinar Powerpoint
https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/f59730fa-0901-0010-df97-c12f071f7d3b
SAP NetWeaver Exchange Infrastructure Mapping Troubleshooting - Webinar Powerpoint
https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/e01e9400-9e81-2910-20a5-a862945a5e98
Mapping Lookups a RFC API
Mapping lookups - RFC API
XI 3.0 New Mapping Features
https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/8a57d190-0201-0010-9e87-d8f327e1dba7
I hope these links will be usefull.
Regards,
Salvatore -
Hi,
I have to implement a flatfile --> XI ---> IDOC scenario and I have a question about the mapping.
Suppose I have a Flat Fiel as following with the first 2columns as key:
100991;001;text1;posting date
100991;002;text2;posting date
100992;001;text4;posting date
100992;002;text6;posting date
I have to pass this items to a IDOC strucutured with header and positions.
By mapping how can I group key data to pass to single Idoc?
Thanks
marcoHi ,
I have done it with ORDERS IDOC Structure .
Since the source is a flat file you could take a simple structure with row and all the fields following it ( say filed1 , field2, field3).
Take a bottom up approach for the child :
Change the context of all the individual fields to the root then apply split by value on field3 ( this introduces context changes )
Then format its parents Queue (Field2) based on Field3 Queue for this use the function Format By Example .
Use the resulting queue as one of the argument and Field1 to generate the link .
Using Graphical this requirement is achievable . How ever it is upto your ease to choose which way you want to do it .
Thanks & Regards
Kavitha -
Idoc to flat file conversion: problem with mapping
Dear experts,
I have the following scenario: SAP (idoc) -> XI -> 3rd party
The idoc has s structure like this:
. ZSCX001 (idoc name)
... IDOC
..... ORDERHEADER
....... ORDERLINE
......... DELIVERY LINE
......... DELIVERY LINE
..... ORDERHEADER
....... ORDERLINE
......... DELIVERY LINE
......... DELIVERY LINE
etc
The flat file has this structure:
. FILENAME
... RECORD
..... FIELD1
..... FIELD2
... RECORD
..... FIELD1
..... FIELD2
etc
Now, per IDOC I need to create 1 file. For each delivery-line in the IDOC I need to create 1 record in the outputfile (flat file).
In message mappings, I did the following:
- messages-tab: Occurrence of the Idoc and inbound message type for flatfile: both 1
- design-tab: I linked IDOC to the FILENAME (so for each Idoc I create 1 flat file)
- design-tab: I linked the tag "Delivery line" to "RECORD" (I expected 1 record per delivery line)
When I test it, I only get 1 resulting record in the flat file, even if I test with 3 ORDERHEADER->ORDERLINE->DELIVERY LINE segments.
Can anybody tell me what I am doing wrong?
Thanks in advance,
WilliamHi,
First make sure occurence of Record is 0..unbounded.
Second use the blow mapping rule..
Delivery line --->RemoveContext ---> RECORD
Regards,
Sarvesh -
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. -
File content conversion - flat file to Idoc error
Dear Experts,
I have a situation where im using FCC in the sender adapter The data is in flat file with multiple fields separated by space .
(*header444456 line4445758 header343434 line445687*) sample falt file data . should be divided as below
header - 44456 , 343434
*line - 44457578 , 445687
So i want to read the header items and pass it into header data of the IDoc and line items into line item data of the Idoc . And the header items and fields items are mixed up in the flat file . How do i read from the position 20 to 26 , 37 to 56 intermittently .And im not using any key field name . as the whole data is in one line . Any solution would be of great help .
Thanks in advance
Ganga
Edited by: N.Ganga on Jan 28, 2012 3:30 PM
Edited by: N.Ganga on Jan 28, 2012 3:30 PMDear Grzegorz ,
Yes i totally agree with you it can be separated by comma . But it is as below
Header - (once ).............................................. Flat file example :
Field 1 -
>order line no 1 plant material 1 code 1 quantity 1
.......................................................................order line no 2 plant material 2 code 2 quantity 2
Field 2 (plant vlaue shuld come........................................................|
Line - repeats (0-unbounded) | | |
field 1 (line no 1)----
| | |
field 2(material1)----
| |
field 3 (quant 1)----
|
field 1 (line no 2)----
| | |
field 2(material2)----
| |
field 3 (quant 2)----
|
So i need to read the data intermittently and map them in the line items ignoring the order and plant data in every line apart from the first line. The order and plant remains the same in the flat file only line items keep changing .
Hope my question is clear .
Regards
Ganga -
Unsorted Flat File into IDoc with multiple use of nodes
Hi Experts!
I am facing a little problem. I have a source flat file for a classification where some fields appear several times.
My source flat file looks like this:
item1; field1a
item2; fieldA
item3; fieldxa
item1; field1b
as you can see the item1 exists twice (further appearances are also possible).
Now i have to map the flat file into an IDoc structure
My target IDoc looks like this
Header
-- node1
attribute1
-- node2
the "field1a" and "field1b" has to be mapped into the "attribute1" in "node1". "node1" has to be duplicated for each time an "item1" appears (.. and if item2, item3 etc. appears twice, three ... four times...).
So how can i reach it that the node1 will be duplicated automatically when an item appears twice or more times? I know that it could be possible to work with "SplitByValue"... but for this i need all item1 in an straight order.... but i dont have them in a correct order.
I am looking forward to your suggestions.
Thank you in advance.
UdoComplex sorting is not or not easy possible with the grafical mapping tool.
Use a sequence mapping. The first mapping is a simple XSLT which does the sort. The second mapping works as usual.
I have an example XSLT which I used for a different purpose:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<ORDERLIST>
<xsl:for-each select="ORDERLIST/ITEM">
<xsl:sort select="ID"/>
<xsl:copy-of select="."/>
</xsl:for-each>
</ORDERLIST>
</xsl:template>
</xsl:stylesheet>
Regards
Stefan -
Flat file to Idoc : Last line empty in payload
Hello everyone,
I'm trying to import Flat File from an external partner, and insert it in our SAP System as Idoc.
It works fine, after a small change in the flat file.
In the normal version, I have a last record with value 'OK'.
I have add the close record.lastFielsOptional in the FCC.
But after checking the payload, I have seen that I have at the end the following thing :
<ns:File xlmns:ns="http://world.com/file">
<record>
</record>
<record>
</record>
<record />
</ns:File>
Can someone explain me how to avoid to have this last <record/>, or checking it in mapping ?
Thanks a lotHello Greg,
The problem is that the key in the flat file is 3 digit numeric field, and OK is 2 char.
If I try to use the key, I have an error on the last record because we have only 2 char for the key, and when I put the parameter record.lastFiledsOptional : yes, i have no more error on the FCC, but the last record of the payload is empty.
Have you a possibility to avoid this error.
Thanks and regards
JC -
File to IDOC aggsales mapping doubt Urgnt
Hello,
Im working for a retail client and the requirement is the File to IDOC scenario where Im stuck up in the mapping.
The inbound is a flat file of structure
EDI_DC40
E1WPU01
E1WPU02
E1WPU03
E1WPU04
The target IDOC structure is as follows
WPUUMS01
--IDOC
EDIDC40
E1WPU01
E1WPU02
E1WPU03
E1WPU04
The problem is with the target segment E1WPU03. This E1WPU03 is actually an optional one in the source inbound flatfile.
So the source will be like this
EDI_DC40
E1WPU01
E1WPU02
E1WPU03
E1WPU04
E1WPU02
E1WPU04
E1WPU02
E1WPU03
E1WPU04
So in the target I need to create the 03 segment if and only if it occurs in the source.
I tired these following but didnt work for me.. what happens is The 03 segment which should come in the third 02 segment actually comes int he second one.
any suggestions if this is possible in message mapping or should I go for an xslt
I tried this one.
SourceE1WPU03 >exists> if withoutelse>then "constant'> targetE1WPU03
Thanks
Prasanna> any suggestions if this is possible in message mapping or should I go for an xslt
No, this is not possible with graphical mapping tool.
You need to have a pre-mapping for this.
I recommend Java mapping with SAX parser.
you can easily change the input structure to:
EDI_DC40
-E1WPU01
--E1WPU02
---E1WPU03
E1WPU04
--E1WPU02
E1WPU04
--E1WPU02
---E1WPU03
E1WPU04
Maybe you are looking for
-
I have backed my iphone4 upto ICloud but i don't know to restore music onto my new itunes? ive only retrieved music that ive bought through itunes back. but thats not even 10% of what i had how do i restore my other music? without losing the music al
-
Issue with Exporting Pdf as HTML
Hi all, I am trying to Convert a PDF to HTML using the "Save as Other -> HTML(Web Page) in the File menu, After Conversion I see some of the characters that are present in Symbol Font are not converted properly(Eg a text 8.7 appears as ""). instea
-
Hello! I wonder if someone could help me with the following. I am developing a form , and all the data entered in that form will be sent to different people , depending on the information of the form. The way that I have done it is with an html form
-
What are these lines around a table?
Probably a basic question, but I've run across something in Dreamweaver that is a little maddening... When I create tables with 0 cellpadding or cell spacing, I'm still getting hairline "borders" around my table cells - if anyone can see the problem
-
Custom Attributes In Additional Details
I created a couple of custom attributes for services supplied by two of our service organizations. One attribute is associated with our custom ticket entry form our IT department and the other is on a different custom entry form for our Property Mana