Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

PO1 & PO2 Purchase Order Files

Status
Not open for further replies.

Blorf

Programmer
Dec 30, 2003
1,608
US
Hi. Using Mas 200 V 3.71.

I have to write a simple app for our receiving folk and I need to be able to sort PO2 Records (Via ODBC) in the same order as they appear on the actual Purchase Order. I can't seem to figure out what fields to sort by.

The Crystal Report tables contain a "SortField" that is populated when the PO is printed, but it is not in the PO2 file.

Can anyone point me in the direction I need to go?

Thanks!

ChaZ

There Are 10 Types Of People In The world:
Those That Understand BINARY And Those That Don’t.
 
Very difficult and really impossible. Each line in PO2 contains the line index along with the previous index and the next index. The starting line is the one where the previous line index is zero (0) and the last line would be the one where the next line index is zero (0).
 
Now at least I understand it. I am confident I can wrote VB code to generate the sort sequence, but I really really don't want to.

I posted the question to a SQL Forum.

Thanks!

There Are 10 Types Of People In The world:
Those That Understand BINARY And Those That Don’t.
 
Hi.

If anyone else needs a possible solution, I posted what I came up with here: thread701-1300536

Thanks,
ChaZ

There Are 10 Types Of People In The world:
Those That Understand BINARY And Those That Don’t.
 
Even if you write the code using the index field, the way mas assigns that number may be greater than or less than the previous line... so it is possible that they are not in a logical order (at least not the logic you expect)

just soemthing to keep in mind if you haven't come across this happening yet.

RK
 
Hi.

I did not do any sorting based on order of index or what not, but linking LinkToNextLine to IndexNumber irritatively, with each itteration incrimenting the "Order" field by 1.

It appears to work, based on testing about 10 PO's, long ones.

The function seems to work, but the solution still seems annoying. I had hoped in the SQL forum, some guru would just know the answer and I would not have to write the function.

Ahh well.

Thanks,
ChaZ

There Are 10 Types Of People In The world:
Those That Understand BINARY And Those That Don’t.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top