on 10-26-2015 11:59 AM
Hi Experts,
My scenario is file to proxy. I need help in file content conversion.attached sample input file and message type . My requirement is need to read all lines and send to proxy.
Header starts with H H;fieldname1;fieldname2;;;fieldnamen;
Details starts with D D;fieldname1;fieldname2;;;fieldnamen;
Control block starts with CH CH;Number of header;Total amount of currency;
CH; Unique currency name;total amount of that currency
Pls guide me for content conversion parameters
Thanks in advance
Jeevitha N
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Jeevitha,
Header.fieldNames | LineIndicator,SupplierCode,InvoiceDate,Currency,Amount |
Header.fieldSeparator | ; |
Header.endSeparator | 'nl' |
Header.keyFieldName | LineIndicator |
Header.keyFieldValue | H |
Detail.fieldNames | LineIndicator,LineType,CompanyCode,Costelement |
Detail.fieldSeparator | ; |
Detail.endSeparator | 'nl' |
Detail.keyFieldName | LineIndicator |
Detail.keyFieldValue | D |
ControlBlock.fieldNames | ControlIndicator,TotalLine,TotalAmount |
ControlBlock.fieldSeparator | ; |
ControlBlock.endSeparator | 'nl' |
ControlBlock.keyFieldName | LineIndicator |
ControlBlock.keyFieldValue | CB |
ControlHeader.fieldNames | ControlIndicator,TotalLine,TotalAmount |
ControlHeader.fieldSeparator | ; |
ControlHeader.endSeparator | 'nl' |
ControlHeader.keyFieldName | LineIndicator |
ControlHeader.keyFieldValue | CH |
Regards,
Praveen.
Praveen,
I believe this is still just half of the solution. The generated XML is not a valid XML as the H, D, H, D, D sequence does not match the XSD. I remember you had some fancy Java mapping/UDF to handle this further.
Jeevitha,
I had a look further and don't think the XSLT approach would work because there is no field with identical value between the H and D segments to identify a parent-child relationship. The other approach would be the custom module that I've also listed, but you might want to wait and see if Praveen provides the remaining half of the solution - I remember it's quite innovative.
Rgds
Eng Swee
Hi Jeevitha
If you require the lines with X, CH and CD, then standard FCC conversion will not work because it is a deeply nested structure (due to repeating H followed by D).
There are various alternatives to handle this, below are two solutions that I have come up with to handle deep structures.
Rgds
Eng Swee
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.
Hi Jeevitha,
You should create the Data type some thing like below to achieve this requirement. Create the DT, MT and then configure accordingly.
I have tried on my side and it worked.
Sorry Jeevitha, we can not achieve with normal FCC paramets for this type of structures. it is 2 level structure. you can do it via an adapter module or xslt or java mapping. eng is already referred them.
Thanks !!
Regards,
Santhi
Hello Jeevitha,
Try this
Header.fieldSeparator - ;
Header.fieldNames - LineIndicator,Suppliercode,InvoiceDate,Curreny,Amount
Header.keyFieldValue - H
Detail.fieldSeparator - ;
Body.fieldNames - LineIndicator,Linetype,Companycode,Costelement
Body.keyFieldValue - D
Controlblock.fieldSeparator - ;
Trailer.fieldNames - controlIndicator,Totalline,Total,Currency
Trailer.keyFieldValue - CH
ignoreRecordsetName - true
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.
User | Count |
---|---|
87 | |
10 | |
10 | |
9 | |
6 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.