cancel
Showing results for 
Search instead for 
Did you mean: 

File Sender adapter - processing lines without end separator and a fixed width layout

Former Member
0 Kudos

Hi

  I have a scenario in PI 7.1 where in the incoming text file ( needs to be handled using a file sender adapter ) has a fixed width layout and DOES NOT have a end of line character ( like a line feed/ carriage return ) . In other words, after a set of field in fixed length ( say 50 chars in total for a record ) , the next record starts with the 51st character being the first character of the next record.

How do we handle this in content conversion ? Is it just enough if I have the following set in content conversion parameters  ( apart from other settings in content conversion like document name, document namespace etc )

n.fieldNames = field1,field2,field3,field4

n.fieldFixedLengths = 10,12,7,21

Based on the above , can we expect PI to consider the 51st character as the first one of the next record ? ( without explicitly specifying the end of line character in content conversion ) and so on and so forth until end of the file is reached ?

Accepted Solutions (0)

Answers (4)

Answers (4)

JaySchwendemann
Active Contributor
0 Kudos

Hi all,

I had a similar problem lately. Unfortunatelly as per my knowledge it is not supported to have multiple records in one row. See here http://scn.sap.com/thread/3569323

However, YMMV as you only have one structure to deal with.

Cheers

Jens

Former Member
0 Kudos

Hello All,

You can split the file into individual records in the FCC and then use message mapping to break every record into respective fields.

Rgds,

Diptee

jonvaughan
Explorer
0 Kudos

Actually that is the problem - it doesn't work.

If you have an example where you have it working please share with us.

Former Member
0 Kudos

Hello Jon,

You can configure your channel liek the one below

This will be able to read to read the entire file into one record, which you can later split using a UDF in MM. I tested this on PI 7.1 and found that the FCC cannot read beyond 7000 characters from one file; you may check this limit on your PI server and accordingly create the input files.

Rgds,

Diptee

Former Member
0 Kudos

Jon,

As the source file was coming from SAP so we found the option in SAP before generating file to ass end separator.

I believe the other option will be to have a Java code if file is coming from outside system.

Regards,

Sudeep Singh

jonvaughan
Explorer
0 Kudos

Did you find a solution to this ?

I think it is common when trying to process mainframe files .

former_member184681
Active Contributor
0 Kudos

Hi,

The description in SAP Help (http://help.sap.com/saphelp_nwpi71/helpdata/en/44/6713ec3f914ddee10000000a1553f7/content.htm) says clearly:

○       NameA.endSeparator

If you want to define an additional string as a separator after the last column in a row, specify it here.

The system skips this separator when it processes the last column (otherwise the system would treat it as part of the last column).

Based on that, I believe that the endSeparator attribute is only optional and you do not need to use it if you do not want to /  have to. The system's behavior should be as you expect. Please share the results with us once you give it a try

Hope this helps,
Greg

Former Member
0 Kudos

Hi

I tried removing the explicit mention of endSeparator in the Content conversion leaving the other parameters intact - the other params were

n.fieldNames, n.processConfiguration,n.fieldFixedLengths

With a test file containing two records and no EOL inbetween then ( one string basically ), PI picks up only the first line and converts it to xml. It ingores anything beyond first line with the above setup.

former_member184681
Active Contributor
0 Kudos

Hi,

How about the Recordset Structure? Did you define it as: n,*? Otherwise, you won't be able to process multiple node occurrences. Please provide us with your full FCC configuration, so that we could help you figure out potential problems.

By the way - what is this "processConfiguration" attribute? I don't remember that one showing up in the SAP Help.

Hope this helps,
Greg

Former Member
0 Kudos

Scrshot of content conversion above, I have put down the setup also as below

Content conversion ( will check what processConfiguration param was set for )

Recordset Name - RECORD_GR

Recordset Structure - ROW_GR,*

Recordset Sequence - Ascending

Key Field Type - String (Case-sensitive )

ROW_GR.fieldNames - PO_DOC, Product,Quantity, Pallet

ROW_GR.processConfiguration - FromConfiguration

ROW_GR.fieldFixedLengths - 10,12,7,15

Sample file that was set for processing

0000012345000000000010000001500000000000012 0000012345000000000010000001500000000000012

JaySchwendemann
Active Contributor
0 Kudos

I know it is a long time but did you get this to work? If so, would you mind sharing your solution? I am facing a similar problem currently.

Thanks and kind regards

Jens

Former Member
0 Kudos

Could you please share the solution?

Regards,

Sudeep

baskar_gopalakrishnan2
Active Contributor
0 Kudos

>Based on the above , can we expect PI to consider the 51st character as the first one of the next record ? ( without explicitly specifying the end of line character in content conversion ) and so on and so forth until end of the file is reached ?

If you specify fieldFixedLength then fieldSeparator is not required or vice versa. This way content conversion handles your every record. IMO, still endSeparator is required . you might try appending the end Separtor length in fixedFixedLength itself.