mostrightfuture
10th February 2005, 16:49
Hi friends,

I have an urgent problem. When we try to print the Invoice using the session "Reprint Invoice (cisli2405m000)", using option "Select by billing request", got an error message as follows:

Error in readig sort file record: 13 fields scanned, 253 expected.

I have debugged and foud that the error comes at the statement

brp.close(invoice.rprt.id)

This same report is working well for all Billing request number but give error with few numbers.

What could be the reason and how should we resolve this problem, its urgent.

Thanks in advance
Mahmood

csecgn
10th February 2005, 18:43
Look at the data you send to the report. I've had this problem with an other report because a customer send special chars in his one-time adress (sorry actually I don't know the correct word...). Look for chars < chr$(32) and > chr$(127). In my situation it has been a LF Char in the the adress. You can put nearly everything with AFS in a field... .
Another hint to find the field: The wrong char is in the 13. or in the 14. input field of the report (13 fields read, 253 expected...). With this you can find the table and look at the record with ttaad4100.

Regards
csecgn

RAMSBaan
10th February 2005, 20:16
Hi ,

When you debug the report script/ Program script just note down which record is hit when you get this error. So you can nail down it to a particular record. Some time user enters these special characters in some field accidentally or if the data from Invoice is loaded into baan then this problem happens.

Some time when you move data accross different Operationg system ..means when you creat your load file in Windows and move it to Unix ^M will be there at end to indicate the Line feed and this might create problem.

:)

Hitesh Shah
13th February 2005, 10:17
Baan report does a string scan of the each line (corresponding to each brp.ready of ur program script ) with a separator ^B ie chr$(2) at the time of brp.close. String.scan returns the number of fields read in the line and expects it to return the number equal to number of input variables .

As cseqn suggested something is wrong on the data sent to the report and that too in the 14th field of the input variable . You can debug the report and check the same while in debug mode and then trace the corrupt data to buggy program or corrup data.