cancel
Showing results for 
Search instead for 
Did you mean: 

Sender file adapter content conversion

Former Member
0 Kudos

Hi guys,

I am working on a file to Idoc scenario and I am configuring the file adapter on the sender communication channel side. The outbound file will be a txt flat file that will have one Header and several Line Items. However, the tricky part will be that each field will be in a separate line for both header and item fields and there are no key fields available. I specified Header.fieldNames/Line.fieldNames for the number of fields and Header.fieldSeparator/Line.fieldSeparator='nl' and in the Recordset Structure I am using Header,1,Line 9999 and I have specified Line.missingLastfields=ignore, in order to overcome the missing keyfield issue. However, when I am using a test file I get a Header record with only the first field filled and several Line segments with only the first field filled again. Do you have any ideas?

Thank you.

Accepted Solutions (1)

Accepted Solutions (1)

former_member184681
Active Contributor
0 Kudos

Hi,

Are you also using 'nl' as the endSeparator? I have noticed recently that PI has difficulties with such scenarios, where fieldSeparator and endSeparator are equal for some structure. It simply cannot differentiate whether it is an end separator or field separator.

Can you influence the way your source file is built, to change the field or end separator? If not, then you might have to search for some workaround, like writing your own adapter module, or making each field a separate structure, then mapping accordingly.

Hope this helps,
Greg

Former Member
0 Kudos

Hi Greg,

Thank you for your reply. No, I am not using 'nl' as the endSeparator. I think will try to treat each field as a separate structure.

Best Regards,

Evaggelos

baskar_gopalakrishnan2
Active Contributor
0 Kudos

By not specifying field end separtor you treat both field separtor and end separtor for header and line items same. This is a issue. You can create seperate structure for every field provided only if you know the data pattern that arrives in the flat file is same for header fields and item fields and their occurences. Or Write some Java program or some source to make the data that is feasible for PI content conversion to handle.

former_member184681
Active Contributor
0 Kudos

Dear Evaggelos,

Please provide us the full set of FCC parameters that you are using, maybe we will be able to figure out something for you together, so that you wouldn't have to go for a complex mapping logic. It is always better to stay with standard, whenever possible

Regards,
Greg

Former Member
0 Kudos

Hi Greg,

The structure of the flat txt file is 1 Header and several Item segments. Each field either Header or Item will be in a separate line, and there will be no special character to differentiate berween Header and Item segments. However, the number of Header and Item segments will be fixed, i.e. always the same, even if a field is missing, there will be a blank line. The FCC parameters that I am using are the following:

Recordset Structure = Header,1,Line,9999    I am applying some sort of trick here in order to overcome the missing keyfields.

ignoreRecordsetName  true

Header.fieldNames       PharmacyName,VATNumber,PharmacyCode,OrderNumber,Version

Header.fieldSeparator   'nl'

Line.fieldNames           PharmacyItemCode,AgentItemCode,PapaellinasItemCode,Barcode,ItemDescription,Packing,SalesPrice,DiscountAmount,VATAmount,OrderedQuantity,RetailPrice

Line.fieldSeparator       'nl'

Line.missingLastfields  ignore

However, when I am testing that, it always picks up the first field from Header and creates several Item segments containing only the first field with each value found in the file after the first, i.e. it ignores the rest Header and Item fieldnames.

Best Regards,

Evaggelos Gkatzios

Answers (0)