on 02-22-2014 3:06 PM
Hi experts.
I have problems with a file content conversion.
I get the attached file incomingfileorders.txt from an FTP server.
In this file there will be multiple orders and they are to be converted into the XML struucture of the uploaded file TargetOrderXML.xml.
The line starting with F0000 are the startrecord of the file and is to be transferred into the StartRecord segment.
Line will be represented as follow
Fileds: KEY,ID,Date,Time,TransactionCode
Positions: 5,40,8,10,4
The Line starting with H0101 is the orderheader and is to be transferred into the corresponding OrderHeader Segment.
Fields: KEY, OrderType, Company, DistributionChannel, Operational
Positions: 5,4,4,2,2
The Line starting with H0402 is customerdata and is to be transferred into corresponding CustomerData segment.
Fields: KEY,CustomerNumber,Operational,VersionNumber
Positions: 5,10,20,4
The Line starting with H4002 is the invoicefee and is to be transferred into the corresponding segment InvoiceFee.
Fields: KEY,Value
Positions: 5,2
Line starting with R0402 is the lineitems and are to be transferred into the corresponding segment LineItems.
Fields: KEY,Material,Quantity
Positions: 5,18,19
Line starting with R0457 is the profitunit and is to be transferred into the corresponding segment ProfitUnit.
Fields: Key,Value
Positions: 5,10
Lines starting with R0620 is the pricerecords and is to be transferred into corresponding segment PriceRecords.
This line has special rules. If the last 16 digits of the first PriceRecord is 0000000000000,00 then the second PriceRecord line will miss the last 16 digits, conclusion SecondValue will not be populated and I would prefer if the SecondValue field is created as an empty field.
Fields: KEY,PEFirst,FirstValue,PESecond,SecondValue
Positions: 5,4,16,4,16
Lines starting with H0150 is itemtexts and are to be transferred into correcponding segment ItemTexts. I’m not sure if I need the KEY field in the segment or if it could be removed. If the solution is to remove the KEY field then that is totally ok. Each line is to be transferred into a field called Text.
In the example target file I removed the KEY field.
Lines Starting with F9999 is the endrecord of the file and is to be transferred into the corresponding segment EndRecord.
Fields: KEY,Date,Time,NumberOfRecords,NumberOrderHeader,NumberOfItems,OrderValue
Positions: 5,8,10,10,10,10,10
Attached in the post you find the incoming text file named incomingfileorders.txt and you also have an example of the target file created from the txt file. Target file is named TargetOrderXML.xml.
Been trying to get this conversion to work with no luck. Would be appreciated if you experts are able to help me with the conversion.
Best Regards
Andreas
Was an error in the target file. There was an EndRecord to much. Also adding file describing target structure.
Hi Andreas - unable to open the TargetStructure.xml seems to be invalid .
Was an error in the target file. There was an EndRecord to much. Also adding file describing target structure.
>>> What is the error? Can you please provide some additional information on this.
second PriceRecord line will miss the last 16 digits, conclusion SecondValue will not be populated and I would prefer if the SecondValue field is created as an empty field.
>>>You can configure the below parameters.
This parameter is only evaluated if you enter a value for NameA.fieldFixedLengths.
○ If you enter NO and the last field found in the structure is shorter than specified in NameA.fieldFixedLengths, processing is terminated with a corresponding error message.
This is the default.
○ If you enter YES, the last field found in the inbound structure is transferred to the outbound structure, even if it is shorter than specified in NameA.fieldFixedLengths.
If the inbound structure has less fields than specified in the configuration then the XML outbound structure is created as follows:
○ ignore
Outbound structure only contains the fields in the inbound structure
○ add
Outbound structure contains all fields from the configuration; the fields missing in the inbound structure are empty.
○ error
Conversion is terminated due to the incomplete inbound structure. An error message is displayed.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Is it possible to maken an extra segment between RecordSet and the other segments containing data?
Like this.
TicketSalesOrder
RecordSet
NewSegment
OrderHeader
Fields....
CustomerData
Fields...
.
.
.
Hope you understand what I mean.
How do I have to change the content conversion to acomplish this?
//Andreas
Hello Andreas,
Standard FCC at sender side supports 2 level of hierarchy like:
<OrderHeader>
Fields
</OrderHeader>
<Item>
Fields
</Item>
.
.
.
<Item>
Fields
</Item>
<Trailer>
Fields
</Trailer>
In your case, you want to add one more level of hierarchy. In my opinion, it is not possible through standard FCC.
When you already have FCC ready, then create a java mapping and pass this FCC generated XML to add another level of hierarchy. Refer
Regards,
Ankit
Hi,
I think the below structure is not possible using FCC.
</ItemTexts> 1...unbounded
</Text> 1...unbounded
you have to make it Text 1..1 in the sender.
in the receiver you can make it 1.unbounded
then achieve this using message mapping
but if you look at the input structure it has one </ItemTexts> per Recordset. why is it having occurrence unbounded?
what condition are you trying to create separate Recordset?
Regards,
Muni.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
81 | |
24 | |
11 | |
9 | |
7 | |
5 | |
5 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.