FCC: Substructure inside Substructure
Hi all,
I am working on a POC which uses FCC. The expected XML file Structure at the Receiver side is:
<root>
. <substructureA>
<field1/>
<substructure1>
<field1/>
<field2/>
<\substructure1>
<substructure2>
<field1/>
<field2/>
<\substructure2>
<\substructureA>
<substructureB>
<substructure1>
<field1/>
<field2/>
<\substructure1>
<substructure2>
<field1/>
<field2/>
<\substructure2>
<\substructureB>
<\root>
Is it possible to perform the conversion by FCC? If Yes, how to specify the substructure inside a substructure in configuration?
Thanks
Chilanka
Hi,
Jai Shankar,
I think the above requirement is for Receiver side , am i correct or not? For sender is different , you nend use another...
Now , in receiver side
Record structure :
ROOT,substructure1,sub_substructure,FIELD,*,substructure2,sub_substructure
<b>Here you have to use the above sustructure name,occurrences</b> if any fields are under that structure and the respective parent will more no of occurrences
In processing parameters
Root.endSaparator : 'nl'
substructure1.fieldNames : (give field names if available if not available then you no need to give these type parameters for that specified substructure)
See my above answer...
Regards
Chilla
Similar Messages
-
** How to handle FCC - SubStructures in Sender Side
Hi friends,
We have a source structure (XML) like below.
<Root>
<GMT_1> 0..unbounded
<field1>
<field2>
<GMT_2> 0..unbounded
<field1>
<field2>
<GMT_3>
<GMT_4> 0..unbounded
<field1>
<field2>
We want to convert flat file into above XML format. So, in this how to handle <GMT_4> xml node. For the others, we will specify
GMT_1.fieldSeparator
GMT_1.endSeparator
like this. But, how to specify for the node GMT_4.
Kindly reply, friends.
Kind Regards,
PrakashHi,
For FCC check some links.
/people/venkat.donela/blog/2005/03/02/introduction-to-simplefile-xi-filescenario-and-complete-walk-through-for-starterspart1
/people/venkat.donela/blog/2005/03/03/introduction-to-simple-file-xi-filescenario-and-complete-walk-through-for-starterspart2
/people/arpit.seth/blog/2005/06/02/file-receiver-with-content-conversion
/people/anish.abraham2/blog/2005/06/08/content-conversion-patternrandom-content-in-input-file
/people/shabarish.vijayakumar/blog/2005/08/17/nab-the-tab-file-adapter
/people/venkat.donela/blog/2005/03/02/introduction-to-simplefile-xi-filescenario-and-complete-walk-through-for-starterspart1
/people/venkat.donela/blog/2005/03/03/introduction-to-simple-file-xi-filescenario-and-complete-walk-through-for-starterspart2
/people/venkat.donela/blog/2005/06/08/how-to-send-a-flat-file-with-various-field-lengths-and-variable-substructures-to-xi-30
/people/anish.abraham2/blog/2005/06/08/content-conversion-patternrandom-content-in-input-file
/people/shabarish.vijayakumar/blog/2005/08/17/nab-the-tab-file-adapter
/people/jeyakumar.muthu2/blog/2005/11/29/file-content-conversion-for-unequal-number-of-columns
/people/shabarish.vijayakumar/blog/2006/02/27/content-conversion-the-key-field-problem
/people/michal.krawczyk2/blog/2004/12/15/how-to-send-a-flat-file-with-fixed-lengths-to-xi-30-using-a-central-file-adapter
/people/arpit.seth/blog/2005/06/02/file-receiver-with-content-conversion
http://help.sap.com/saphelp_nw04/helpdata/en/d2/bab440c97f3716e10000000a155106/content.htm
Regards,
Phani -
Creating substructures in message mapping
Hi,
I need to do a message mapping to go from
<message>
<structure>
field1
field2
fieldA
fieldB
</structure>
<structure>
field1
field2
fieldC
fieldD
</structure>
<structure>
field3
field4
fieldE
fieldF
</structure>
<structure>
field3
field4
fieldG
fieldH
</structure>
etc..
to
<message>
<structure>
field1
field2
<substructure>
fieldA
fieldB
</substructure>
<substructure>
fieldC
fieldD
</substructure>
</structure>
<structure>
field3
field4
<substructure>
fieldE
fieldF
</substructure>
<substructure>
fieldG
fieldH
</substructure>
etc..
I've managed to create as many target structures as there are occurences of the first field in the source structure, but i cannot find the solution to create the correct amount of substructures inside the target structures. Can it be done with graphical mapping?
Any help appreciated.
Kr
RobertHi
Already found the solution:
field1(context of highest level) -> Split by value(valuechange) -> collapse context -> targetStructure
field1(context of highest level) -> Split by value(valuechange) -> collapse context -> splitbyValue(eachvalue) -> field1
field 2 same way as field one
field3 -
> }
->->->->->->->->->->->->->->->->->->} formatByExample ---> substructure
field1(context of highest level) -> Split by value(valuechange)----->}
field 3 -> field 3
field 4 -> field 4
KR
Robert
Edited by: R. den Hoedt on Dec 1, 2011 3:54 PM -
Content conversion: Substructures?
Hey experts,
We're currently working with an XML structure that we have to convert in a flat file format, we're familiar with the content conversion feature but we always worked with simple structures at the same level
for example:
header (1.1)
line (1.unbounded)
footer(1.1)
(all at the same level, but line is 0.unbounded)
resulting:
header,12,3
line,12313,12,1
line,12314,13,2
line,12315,14,3
footer,1,39,4
- But this time we need a more complex structure that contains substructures for example:
header (1.1)
header/batchheader (0.unbounded)
header/batchheader/entrydetails (0.unbounded)
header/batchheader/batchcontrol (0.unbounded)
header/filecontrol (1.1)
- How do we create substructures as "batchheader" (or "entrydetails" within the substructure) using content conversion???
Any help would be appreciated,
Thanks in advance!Hi Alexes,
You can find in the below links for complex structures for FCC.
http://www.riyaz.net/blog/xipi-file-content-conversion-for-complex-structures/
http://www.riyaz.net/blog/index.php/2008/05/20/xipi-convert-flat-file-to-deeply-nested-xml-structures-using-only-graphical-mapping/
Regards,
Leela -
Content Conversion with Substructures
I'm very new at all of this, and I have a bit of a complex mapping. In an attempt to make it a little tidier, I made several substructures when I set up the data type.
For example, most of the lines start with a 'record id' made up of 4 fields. So I created a structure with those 4 fields, and then another structure with the rest of those fields, and then put both structures together to define the line.
I thought I was making things cleaner, but when I got to the file content conversion, I realized I'd just made a big mess.
Here is a somewhat simplified example of my structure, after it comes out of the mapping.
<EmployeeData01>
<RecordID>
<RecordType>01</RecordType>
<SSN>1234-56-7890</SSN>
<EmployeeID></EmployeeID>
</RecordID>
<Employee>
<FirstName>Mickey</FirstName>
<MiddleName>M</MiddleName><LastName>Mouse</LastName>
<Prefix>Sir</Prefix>
<Title>Jr</Title>
<Gender>M</Gender>
</Employee>
</EmployeeData01>
Originally I tried just using the employeedata01, and that gets me an error in the adapter monitor about the RecordID structure not being defined.
Then I tried not defining employeedata01 and instead defining RecordID and Employee. That works, sort of. But it puts the RecordID segment and the Employee Segment on seperate lines.
Is there a way to do this with the structure I have? I know I can solve it by going back and completely rewriting my structure, but I'd really rather not have to do that.
Thanks for any help at all.Abhy,
I am using content conversion already. I'm trying to figure out how to configure the content conversion.
Those blogs are not so useful, because they are all about sender adapters, and this is a receiver adapter.
The sender is ABAP Proxy, the receiver is a file adapter.
The mapping works fine, and maps the document in XML exactly how I want it mapped.
My problem is getting the file adapter configured properly to receive XML and write it out the way that I need it written.
Here are the things I've tried:
#1
Recordset Structure: EmployeeData01
Parameters:
EmployeeData01.fieldFixedLengths with all the individual field lengths for the whole record
Result: Error in the adapter monitor
Error: Message processing failed: Exception: Exception in XML Parser (format problem?):'java.lang.Exception: Message processing failed in XML parser: 'Conversion configuration error: Unknown structure 'RecordID' found in document', probably configuration error in file adapter (XML parser error)'
#2
Recordset Structure: Employee,RecordID
Parameters:
RecordID.fieldFixedLengths - with lengths for the record id fields
Employee.fieldFixedLengths - with lengths for the rest of the fields
Result: Mapping works, but prints out the record id section and the employee section on seperate lines, instead of one line
What I need to know is how to set up the file content conversion parameters in order to make the entire employeedata01 (recordid + employee) print out on one line
Does this help clarify my question? -
Hi Gurus,
In a File Content Convertion scenario, I am having an issue as next:
the sender CC will pick the file and put all data between comas in different fields. Example:
file:
data1, data2, data3
File mapped:
<field1>data1<field1>
<field2>data2<field2>
<field3>data3<field3>
But, there are some fields inside the file that are like this:
data1, "data2 (1, 2)", data3
So, what I need to do is remove comma in between double quotes.
Is this possible? How can I handle this?
Thanks!!Hi ,
Unless you are very sure about which field and how many times comma may come,I do not think you can resolve this problem at UDF level, after reading the file using FCC. The FCC you are using is separating the fields using comma. Thus for a data like this
data1, "data2 (1, 2)", data3
you will receive
<field1>data1<field1>
<field2>"data2 (1<field2>
<field3>2)"<field3>
<field4>data3<field4>
Now I would rather suggest you to try to change the FCC parameters in such a way that record separator is 'nl' or newline. Thus if you receive a file like this
data1, "data2 (1, 2)", data3
data1, data2, data3
After FCC you will receive data like this
<mt_record>
<row>data1, "data2 (1, 2)", data3</row>
<row>data1, data2, data3</row>
</mt_record>
Now you need to follow java mapping to get the required target structure. If you are new to java mapping follow these blogs, for PI 7.1
http://wiki.sdn.sap.com/wiki/display/XI/UsingPI7.1APIforJavamapping
If you are working in PI 7.0 you can follow
http://wiki.sdn.sap.com/wiki/display/XI/BeginnersguidetoJavamappingusingDOMparserinSAPXI
After following the FCC specified here, try doing java mapping.
regards
Anupam
Edited by: anupamsap on Jul 8, 2011 6:48 AM -
Need to create Target substructure if invoice number node has a value.
I only want to create Target substructure if Source node <Invoice Number> has a value and is not blank. Can not use Exists function because <Invoice Number> node is 1..1 so it will always be there but it may be empty. Thank you.
Hi Glenn,
If you are getting the source from idoc and if you dont have invoice number from idoc then you will not at all have the field. So it will not be empty until unless somebody manually sends from we19. So you should not run into those kind of issues.
Anyways you can check both blank and length. So check lenght greater than zero and equal to blank which is a space. It should work.
Regards,
---Satish -
File conversion for more than one level of substructure
I have the following file format that needs to be converted into XML, but because it has more than one level of substructure I'm not able to give the correct file conversion parameter
source file sample:
1headeryyyyyyyyyyyyy
2itemsyyyyyyyyyyyyyy
2itemsyyyyyyyyyyyyyy
2itemsyyyyyyyyyyyyyy
3trailer1yyyyyyyyyyyyy
4trailer2yyyyyyyyyyyyy
2itemsyyyyyyyyyyyyyy
2itemsyyyyyyyyyyyyyy
2itemsyyyyyyyyyyyyyy
3trailer1yyyyyyyyyyyyy
4trailer2yyyyyyyyyyyyy
Thus you see above that there is one header followed by a bundle that conrains many items and 2 trailers and this bundle can repeat any number of time.
Could anyone let me know how to parse this type of file to XML?
Thanks,
LakshmiHi Lakshmi,
See this blog:
<a href="/people/michal.krawczyk2/blog/2004/12/15/how-to-send-a-flat-file-with-fixed-lengths-to-xi-30-using-a-central-file-adapter:///people/michal.krawczyk2/blog/2004/12/15/how-to-send-a-flat-file-with-fixed-lengths-to-xi-30-using-a-central-file-adapter
[]´s
Marcelo Macedo -
How to generate a file containing substructure of inboud interface
Hi Experts,
My outbound interface structure is like below:
<?xml version="1.0" encoding="UTF-8"?>
<ns0:File_Input xmlns:ns0="http:/training/POC">
<NUM1>1</NUM1>
<NUM2>2</NUM2>
</ns0:File_Input>
My inbound interface is like below:
<?xml version="1.0" encoding="UTF-8"?>
<ns0:File_Output xmlns:ns0="http:/training/POC">
<Filename></Filename>
<Output>
<TOTAL>3</TOTAL>
</Output>
</ns0:File_Output>
This is FILE to FILE scenario.
The input (sender or outbound) file is XML. Output file is also XML but I want it to be:
<ns0:File_Output xmlns:ns0="http:/training/POC">
<Output>
<TOTAL>3</TOTAL>
</Output>
</ns0:File_Output>
I don't want the node <Filename> in the output XML file even though the inbound interface structure contains the node <Filename>. The output file name is dynamic and hence I am using the node <Filename>. I am populating this node in message mapping.
I tried File content conversion but it is not generating the file. I gave the following conversion values.
What am I doing wrong?
File_Output.fieldSeparator = nl
Output.fieldSeparator = nl
TOTAL.fieldSeparator = nl
Please help!
Thanks
Gopalhi Gopal,
First thing, as Spantaleoni has said, you can not avoid the quotes.
It has been clear in your case itself. That's the reason that you have nl input_20110523T104117Z.xmlnl3 in between your filename "input_20110523T104117Z.xml" and total value "3". Had you put quotes, 3 would have come in the next line itself and there would not be nl explicitly.
As for your actual issue, if it is an xml that you want at the receiver end, why are you using content conversion? As Shabarish has mentioned in his blog, dynamic configuration is always better than variable substition.
You can set the filename dynamically in a udf which is mapped to a mandatory field at the target side.
Write the below code in a udf and map it to a mandatory node at the target end , like "Output" node in your case.
DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
DynamicConfigurationKey key = DynamicConfigurationKey.create(u201Chttp://sap.com/xi/XI/System/Fileu201D,u201CFileNameu201D);
String MyFileName = a + "_" + b +".xml";
conf.put(key, myFileName);
return "";
Regards,
Ninu -
Abap mapping: copy substructures
Hi all,
I try to find a simple and quick way to fill some fields of a destination message getting values from an input message by tag name.
More exactly:
Input message.
S1.
f1
f2
f3
S2
f4
f5
f5
Output message,
D1.
d1
d2
d3
D3
d4
I need to copy S1 to D1 to have all field dx... filled and to fill d4 with f5, for exaple.
I can use idocument->get_elements_by_tag_name( 'BookingCode' ). to get a value of 'BookingCode' from
the input message. Is it the possibility to modify a specific field in a "odocument" after a copy of a structure from the idocument?
Is it possible?
Thanks in advance.
Regards,
Giovanniset_value
This method sets a node's value. This operation is not supported or defined on all node types.
interface
if_ixml_pi
parameters
value
The value to set for this node.
return value
Returns one of the following return codes:
ixml_mr_dom_ok = 0
The value has been set successfully.
ixml_mr_dom_invalid_arg = 0x00020003L
The given argument is invalid.
ixml_mr_dom_not_allowed = 0x00020008L
This node doesn't allow to set its value.
abap signature
method set_value
importing
value type string
returning
value(rval) type I. -
Create substructures via file adapter - file content conversion
I have a need to create a structure as follows using file content conversion from a flat file
source:
H1~00
S1~1A
L1~1B
S1~2A
L1~2B
S1~3A
L1~3B
<?xml version="1.0" encoding="UTF-8"?>
<ns:x_MT xmlns:ns68="urn:abt.com/IAM">
<DocHeader>
<Label />
<type />
</DocHeader>
<DocItem>
<Ship>
<Label />
<type />
</Ship>
<Lines>
<Label />
<type />
</Lines>
</DocItem>
</ns:x_MT>
I can successfully create a x_MT but I do not get the heirarchy (DocItem node) and therefore I'm having trouble on the mapping side.
My file content conversion is as follows:
Document Name: x_MT
Document Namespace: urn:abt.com/IAM
Recordset Name: x_DT
Recordset structure: DocHeader,1,Ship,,Lines,
Recordsets per message: *
Key Field Name: label
DocHeader.fieldSeparator '0x7E'
DocHeader.endSeparator 'nl'
DocHeader.fieldNames label,type
DocHeader.keyFieldValue H1
Ship.fieldSeparator '0x7E'
Ship.endSeparator 'nl'
Ship.fieldNames label,type
Ship.keyFieldValue S1
Lines.fieldSeparator '0x7E'
Lines.endSeparator 'nl'
Lines.fieldNames label,type
Lines.keyFieldValue L1
What I get is a structure without the node DocItem and therefore appears like a flat structure and mapping fails since I have multiple 'Lines' and only the last one gets mapped.
I've read all the weblogs around this topic and none seemed to address more than one node. Please help.
Thank you,
ParimalaHi Parimala,
As per SAP help document the structure created by content conversion would look like this..
http://help.sap.com/saphelp_nw04/helpdata/en/2c/181077dd7d6b4ea6a8029b20bf7e55/content.htm
<documentName>...
<recordset>
<NameA>
<field-nameA1>field-value</field-nameA1>
<field-nameA2>field-value</field-nameA2>
<field-nameA3>field-value</field-nameA3>
</NameA>
<NameB>
<field-nameB1>column-value</field-nameB1>
<field-nameB2>column-value</field-nameB2>
<field-nameB3>column-value</field-nameB3>
</NameB>
</recordset>
<recordset>
</recordset>
</documentName>...
If you require a <DocItem> node then you have to handle this in mapping.
Regards
Anand -
XML conversion - Substructure needed?
Hi,
My scenario is flatfile to IDoc.
Flatfile looks like this
PH337731 ITH1
PU337731 100106724 9900000000218314239,370 314261,370 KG 0,080 0,120 0,100 M
PD337731 100106724 610090 60 PC 52156660 10
PD337731 100106724 187000 50 PC 52156660 110
PD337731 100106724 666212 48 PC 52156660 220
PD337731 100106724 674621 30 PC 52156660 270
PD337731 100106724 606226 3 PC 52156661 30
..EOF..
Above structure is fixed length structure for which I had created an XML structure like this:
<Header> 1 to 1
<PH/>
<ShipmentNu/>
<TrPlP/>
</Header>
<Units> 1 to n
<PU/>
<ShipmentNu/>
<ShippingUnit/>
<ShippingMaterial/>
<Netweight/>
<Brutweight/>
<UOMweight/>
<Length/>
<Height/>
<Width/>
<UOM/>
<Details> 0 to n
<PD/>
<ShipmentNu/>
<ShippingUnit/>
<Material/>
<Quantity/>
<UOM/>
<Picking/>
<PickingLine/>
</Details>
</Units>
For every occurrence of Units, Details should also occur.
Is this the right structure or is it unnecessary to create details under units?
thanks in advance,
ShanthiHi Radek,
The number of units and details are not equal. I used the following content conversion parameters for the above mentioned nested structure
Recordset Name: recordset
Recordset Structure: Header,1,Units,*,Details,1
Parameters for Recordset Structures
Header.fieldFixedLengths: 1,2,10,3
Header.endSeparator: <...ES of Header.>
Header.fieldNames: <..field names of Header..>
Header.keyFieldValue:1
Header.keyFieldInStructure:ignore
Units.fieldFixedLengths: 1,2,10,20,18,15,15,3,13,13,13,3
Units.endSeparator: <...ES of Units...>
Units.fieldNames: <..field names of Units..>
Units.keyFieldValue: 2
Units.keyFieldInStructure:ignore
Details.keyFieldValue: 3
Details.keyFieldInStructure:ignore
but with this content conversion i'm not able to produce xml in which details come under units.
Can you please help me with content conversion.
Thanks -
Can I make a substructure to organize my photos?
I have about 400 maps with pictures, well organised in sub directories, that I want to import from FInder. I do not want to see them in iPhoto in one list of seperate events. Any suggestions?
By "maps" do you mean 'Folders'?
If you want to duplicate your Folder Tree in iPhoto:
Start at the bottom of the hierarchy and drag a folder of images to the Album Heading in iPhoto. The pics will be imported and an Album of the same name created.
You can then create the Enclosing Folders in the iPhoto Window (File -> New Folder) and drag the Album to it. Folders can contain other Folders (Nested Folders) and Albums.
However, is your folder system date based? Then this form of organisation is a bit pointless in iPhoto when Smart Albums or the Calendar tool (Click on the wee magnifying glass in the Search Box) mean you can find the photos taken on any day, month or year at a click. With Smart Albums it's easy to find photos from specific range - say, June 3 to August 25, 2009 etc.
If your folder system is theme based - Xmas pics, Birthday pics etc, then you'll find Keywords are much more flexible, and can be used in conjunction with other criteria for making Smart Albums and searches. -
PI 7.11 - FCC Receiver Adapter
Hi
I've got a simple xml which i have to convert in a fixed length text file. Is it possible to convert it using FCC with following structure:
<root>
<data>
<record>
<name>john</name>
<surname>doe</surname>
<zip>12345</zip>
<city>abcd</city>
</record>
<record>
<name>bart</name>
<surname>simpson</surname>
<zip>131313</zip>
<city>springfield</city>
</record>
</data>
</root>
I did this conversion already with PI 7.0, but i removed the <data> element to get a simpler substructure. Is it also possible without removing this?
I found following entry [Re: File Adapter Reciver Side: FCC Convetion Problum in PI 7.1], but it didn't works for me. Any suggestions?
Thanks in advance
MichaelHi,
Are you looking for a content conversion at teh Receiver adapter or the sender adapter?
If you have defined teh structure in ur Data type as u have mentioned then don't remove anything because ur source file would be containing the following structure itself.
If you are getting the XML structure at source
<root>
<data>
<record>
<item1>
<item2>
</record>
</data>
</root>
the follow the same structure at the receiver side as well. If u want to delete the data node at teh receiver side then delete at teh source side FCC as well.
Just try and let me know. I will help you out.
Thanks
Veeru -
Error in FCC in sender JMS adapter
Dear all,
We have IDoc flat file which is fixed field length but it has no field separators. It also doesnt have a carriage return(enter) after every segment ( say edi_dc40).
In this case ,the FCC is giving error " Missing Structure in Last recordset ".
But if we try adding a CARRIAGE RETURN ( ENTER ) after every segment
the fcc is working.
Regards,
MadhuHi ! Madhu
take some idea from this
http://help.sap.com/saphelp_nw70/helpdata/en/0d/00453c91f37151e10000000a11402f/frameset.htm
<b>Converting File Content in a Sender Adapter</b>
http://help.sap.com/saphelp_nw70/helpdata/en/2c/181077dd7d6b4ea6a8029b20bf7e55/frameset.htm
/people/venkat.donela/blog/2005/06/08/how-to-send-a-flat-file-with-various-field-lengths-and-variable-substructures-to-xi-30
Thanks !!
Regards
Abhishek Agrahari
Maybe you are looking for
-
How to use the game centre for apple iPad mini
How to use the game centre for apple iPad mini
-
Safari crashes on load every time. Will not start.
Process: Safari [3622] Path: /Applications/Safari.app/Contents/MacOS/Safari Identifier: com.apple.Safari Version: 6.1.5 (7537.77.4) Build Info: WebBrowser-7537077004000000~1 Code Type: X86-64 (Native) Parent Process: launchd [191]
-
Can I backup FRA to tape (Networker) without NMO?
Can I just use MML that Networker provides and not use their Networker Module for Oracle? So I will backup up my databases to FRA and then Networker will back up FRA via SBT_TAPE? If so, how do I unlink NMO and just leave MML? Or is the only way to u
-
Hot Sync not working from Desktop to handheld
My Palm Zire m150 broke. So I bought a 'slightly used' one from EBay. BIG mistake. I have been using the Palm for the past 5 years without any issues, hence, my reasoning for purchasing another one. At any rate, I cannot get the information on my des
-
Iphoto '9 version 8.1.2
I have duplicate photos showing up. I tried to delete them and they keep reappearing. How do I permanantly delete them?