cancel
Showing results for 
Search instead for 
Did you mean: 

Sender File content conversion

Former Member
0 Kudos

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

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi ,

Below is  structure, File content conversion parameters and sample file.

Please check and correct me..

Please correct me , if wrong anywhere

Thanks

Jeevitha N

Former Member
0 Kudos

Hi Jeevitha,

what is the occurance of control block and control header in the sample file?  is it not one time?

Regards,

Santhi

engswee
Active Contributor
0 Kudos

As I mentioned above, these cannot be handled by standard FCC to produce the XML structure you require.

Possible

H

D

D

Not possible

H

D

D

H

D

D

D

Former Member
0 Kudos

Hi Santhi,

Control header(CH) will occur one time ,but control detail(CB) may occur many times..

Actually CH contains
CH; Total number of header; Total amount of amount

CB has

CB;Number of header;Total amount of specific currency;unique currencyname

Thanks

Jeevitha N

Former Member
0 Kudos

Hi Eng Swee Yeoh,

I don't know about XSLT mapping. Could you please provide your full XSLT mapping part.

Please guide me for my structure also.

Thanks in advance,

Jeevitha N

former_member182412
Active Contributor
0 Kudos

Hi Jeevitha,

  • Change the Recordset Sequence to variable
  • Give correct key Field Name
  • Add keyFieldName for all recordset Structures(Header, Detail etc)

Header.fieldNamesLineIndicator,SupplierCode,InvoiceDate,Currency,Amount
Header.fieldSeparator;
Header.endSeparator'nl'
Header.keyFieldNameLineIndicator
Header.keyFieldValueH
Detail.fieldNamesLineIndicator,LineType,CompanyCode,Costelement
Detail.fieldSeparator;
Detail.endSeparator'nl'
Detail.keyFieldNameLineIndicator
Detail.keyFieldValueD
ControlBlock.fieldNamesControlIndicator,TotalLine,TotalAmount
ControlBlock.fieldSeparator;
ControlBlock.endSeparator'nl'
ControlBlock.keyFieldNameLineIndicator
ControlBlock.keyFieldValueCB
ControlHeader.fieldNamesControlIndicator,TotalLine,TotalAmount
ControlHeader.fieldSeparator;
ControlHeader.endSeparator'nl'
ControlHeader.keyFieldNameLineIndicator
ControlHeader.keyFieldValueCH

Regards,

Praveen.

engswee
Active Contributor
0 Kudos

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

Former Member
0 Kudos

Hi Praveen ,

I tried the same and it worked well.

Thank you

Regards

Jeevitha

Answers (4)

Answers (4)

engswee
Active Contributor
0 Kudos

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

Former Member
0 Kudos

Hi,

I am getting below error.

Below is the file content conversion parameters,. Please correct me if I am wrong anywhere.

Input file :

Former Member
0 Kudos

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

former_member186851
Active Contributor
0 Kudos

Hello Jeevitha,

Keyvalue should with start small k,not capital.its my mistake.

try changing to small

former_member186851
Active Contributor
0 Kudos

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

File Content Conversion - Process Integration - SCN Wiki

iaki_vila
Active Contributor
0 Kudos

Hi Jeevitha,

If understand you right you will have a key field to know in which part the file is. Check this Shabarish blog

Regards.