Baanboard.com

Go Back   Baanboard.com > Forum > Baan Quick Support: Functional & Technical > Tools Development

Retirement Notice

Baanboard is shutting down on 31-dec-2023. See: http://www.baanboard.com/baanboard/showthread.php?t=76043


User login

Frontpage Sponsor

Main

Poll
What do you expect from your SI Implementation partner for the success of ERP implementation.
Bring best practices - Not to offer more CR's Leveraging standard functions
20%
Need more honesty to work with the Users until their processes are fully mapped & Users are trained
40%
Focus on process automation/ integrations/ Real time data/ BI analytics
13%
Stick to basics
27%
Total votes: 15

Reference Content

Reply
 
Thread Tools Display Modes
  #1  
Old 19th January 2013, 20:50
bhushanchanda's Avatar
bhushanchanda bhushanchanda is offline
Guru
 
Join Date: Sep 2012
Location: India
Posts: 2,503
bhushanchanda is a jewel in the roughbhushanchanda is a jewel in the roughbhushanchanda is a jewel in the rough
Baan: LN FP 1-9, 10.4, a little bit of Baan IV - DB: SQL Server 2008, Oracle - OS: Windows Server 2008 R2, Unix
Error with Sort Field
Baan: ERP LN 6.1 FP7
C/S: Both

Hello Everyone,

I had a problems a few days back and I haved fixed it. I checked about it on board and found that many other people here have faced the same.

It was kind of this

HTML Code:
"Error in reading sort file record; 2 fields scanned;32 expected"
I found the following reasons for the problem.

Quote:
1. It occurs when we try to print a Text Field on report
e.g. tdsls400.txta
2. It doesnt show up until we use some sort in the layout.
3. It disappears when we change the sort field from "Ascending" to "Presorted".
I checked if there was any incorrect data, but did not found any. I was just curious to know, why does the error pops up?
What is the actual reason behind it?

For the ones who face this problem, just change the sort field from ascending to presorted and you are done.

Gurus, please share your views.
Reply With Quote
  #2  
Old 21st January 2013, 15:36
mark_h's Avatar
mark_h mark_h is offline
Guru
 
Join Date: Sep 2001
Location: Kentucky, USA
Posts: 7,819
mark_h will become famous soon enoughmark_h will become famous soon enough
Baan: Baan 4C4 A&D1 - DB: Oracle - OS: Sun Solaris
I believe there is more than one reason for the error. The only case I have run into the data was actually bad. If you run thru a report you will see what it does with the temp files and the sort, in my case the data was corrupted in the report file. Then when it came time to get the fields the separator was not correct causing it to read the wrong number of fields.
__________________
Mark

GO Cards!
My latest mantra - make sure you have latest stpapi patches and the latest session object. If on LN then please explore the option of using DAL2 functionality.

Shared Solutions for Baan systems provided free by Baan Board.
Play the Google game and help Baanboard get better rankings. Do your part. Click here to find how.
Reply With Quote
  #3  
Old 21st January 2013, 16:08
bhushanchanda's Avatar
bhushanchanda bhushanchanda is offline
Guru
 
Join Date: Sep 2012
Location: India
Posts: 2,503
bhushanchanda is a jewel in the roughbhushanchanda is a jewel in the roughbhushanchanda is a jewel in the rough
Baan: LN FP 1-9, 10.4, a little bit of Baan IV - DB: SQL Server 2008, Oracle - OS: Windows Server 2008 R2, Unix
Agreed with you Mark. This problem has many reasons. But what I did not understood is the problem of keeping the field as "Ascending" / "Presorted".

I tried it with one more report today which had this text field and the same problem occured, which I resolved by changing the sort fields to "Presorted".

May be some secrets behind this
Reply With Quote
  #4  
Old 21st January 2013, 18:25
BaanInOhio BaanInOhio is offline
Senior Member
 
Join Date: Oct 2005
Location: Northeast Ohio
Posts: 199
BaanInOhio is on a distinguished road
Baan: Baan 4c4, 5C, LN - DB: Informix, Oracle, SQL - OS: HP UX, Win2K
Setting one or more fields to sorted in the input field writes all imported fields into a file/array using something similar to 'concat$', sorts them, then reads them back in order based on the sort field definitions using something similar to 'string.scan'. If your data contains one of the characters that the report uses internally to delimit the fields, you will receive the error since it stores the number of fields written to the sort file and posts the error message when the 'scan' call to return the fields does not find the same number of fields.

The condition that I have witnessed more than others that causes this is to pass a date field to the report that shows in the debugger as -1 = the result of an invalid call to "<something>".to.num" or "<something>".to.utc".
Reply With Quote
  #5  
Old 22nd January 2013, 11:08
bhushanchanda's Avatar
bhushanchanda bhushanchanda is offline
Guru
 
Join Date: Sep 2012
Location: India
Posts: 2,503
bhushanchanda is a jewel in the roughbhushanchanda is a jewel in the roughbhushanchanda is a jewel in the rough
Baan: LN FP 1-9, 10.4, a little bit of Baan IV - DB: SQL Server 2008, Oracle - OS: Windows Server 2008 R2, Unix
Interesting

Hi BaanInOhio,

That was interesting!! Never knew that .

So, this means, the only way to print text fields with some sort fields is to make them "Presorted".
Reply With Quote
  #6  
Old 22nd January 2013, 15:09
mark_h's Avatar
mark_h mark_h is offline
Guru
 
Join Date: Sep 2001
Location: Kentucky, USA
Posts: 7,819
mark_h will become famous soon enoughmark_h will become famous soon enough
Baan: Baan 4C4 A&D1 - DB: Oracle - OS: Sun Solaris
Not just text fields, but any fields that contain the separator character. The two cases I can remember was corrupted data in a string field - the session script was not clearing it correctly. The second case was with text, but where the user was cutting and pasting from word documents into BaaN text. The control characters caused errors and some of the text printed weird.

What it sounds like to me is your text has this control character in it - in my 4c4 system it was ctrl-B or STX. Not sure if it is the same for LN on windows.
__________________
Mark

GO Cards!
My latest mantra - make sure you have latest stpapi patches and the latest session object. If on LN then please explore the option of using DAL2 functionality.

Shared Solutions for Baan systems provided free by Baan Board.
Play the Google game and help Baanboard get better rankings. Do your part. Click here to find how.
Reply With Quote
  #7  
Old 22nd January 2013, 18:26
BaanInOhio BaanInOhio is offline
Senior Member
 
Join Date: Oct 2005
Location: Northeast Ohio
Posts: 199
BaanInOhio is on a distinguished road
Baan: Baan 4c4, 5C, LN - DB: Informix, Oracle, SQL - OS: HP UX, Win2K
The easiest way to break it is to send the invalid date (return argument of *.to date or *.to.utc = -1) to the report but text can also do it. I see this most in LN where users can copy and paste text from other sources (like word or a web page) where control characters and nulls are introduced. I have most frequently found that the "string.scan" for sorting in reports uses that backspace = control-B, chr$(8) as the field separator.
Reply With Quote
  #8  
Old 9th March 2023, 05:53
Shilpa.j Shilpa.j is offline
Newbie
 
Join Date: Jan 2016
Posts: 1
Shilpa.j is on a distinguished road
Baan: 10.4 - DB: sql - OS: unix
Error with Sort Field

The issue is identified. There is new line character in one of the text field. But how can it be resolved. Do I need to correct the record in GTM?
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Compilation Error baansavvy Tools Development 4 20th April 2010 17:25
How to sort a field? jaycee99 Tools Development 5 18th September 2009 09:41
Duplicate records after sort on a different field baanjour Tools Development 1 16th April 2007 15:43
Form Field Order Eddie Monster Tools Development 3 23rd August 2006 20:58
New sort field in before.field without main table? brad997 Tools Development 4 7th February 2006 06:16


All times are GMT +2. The time now is 01:13.


©2001-2023 - Baanboard.com - Baanforums.com