Conflict in number of buffers problem

Jatsad

New Member
Hello,

I have a situation where I have 2 tables that define a stock system.
Mov_hdr is the header for a stock movement and Mov_Line describes the stock lines for the movement.

I have a screen which allows the user to search for certain items in the Mov_Hdr table. These include the mov_id field which is a unique number and joins the mov_line records to the header. Users can also search by ord_num which is the order number. This will return the mov_id which then provides the join to the mov_line table to retrieve the appropriate stock lines.

I have a need to now search by the stock number which is the icode field in the mov_line table and return all mov_hdr records for each mov_line record found.

The original define query statement for browse br-table and query was as follows:

DEFINE QUERY br_table FOR
mov_hdr SCROLLING.

/* the query is */

if lc_Mov_Id NE "" then /* this query is used if the user knows the uniqie mov_id */
OPEN QUERY {&SELF-NAME}
FOR EACH mov_hdr
where mov_hdr.mov_id = Mov_id.


else if lc_order_num NE "" then /* this query is used if the user knows the order number */
OPEN QUERY {&SELF-NAME}
FOR EACH mov_hdr
where mov_hdr.ord_num = lc_order_num.

else /* this query returns all mov_hdr records */
OPEN QUERY {&SELF-NAME}
FOR EACH mov_hdr.


If I add in another query (shown below) to access the mov_line first I get the following error.

OPEN QUERY {&SELF-NAME}
FOR EACH mov_line
WHERE mov_line.icode = lc_StockNo,
EACH mov_hdr OF mov_line.

Error is:

Conflict in number of buffers for QUERY br_Table for previous use (3325).
** Could not understand line . (196).
Conflict in number of buffers for QUERY br_Table for previous use (3325).
** Could not understand line 265. (196).
Conflict in number of buffers for QUERY br_Table for previous use (3325).
** Could not understand line 271. (196).
Conflict in number of buffers for QUERY br_Table for previous use (3325).
** Could not understand line 276. (196).


I have tried adding mov_line to the define query statement but then the original queries fail because both tables are not referenced.

How do i get around this problem?

Thanks for your help in advance.
 
With a static query object you can't change the buffers on-the-fly which is exactly what you attempted when you added the last query. In order to achieve this you must work with dynamic buffer and query objects.

Heavy Regards, RealHeavyDude.
 
you can try this as you probably need the header records to only appear once anyway... beware, depending on the indexes and number of records in header table that might or might not work very well :)

Code:
OPEN QUERY {&SELF-NAME}
   FOR EACH mov_hdr 
   WHERE CAN-FIND (FIRST mov_line OF mov_hdr WHERE mov_line.icode = lc_StockNo).
 
Back
Top