shajipthomas
22nd October 2002, 01:48
The length of field "ITEM" in table tisfc001 is 47 and
the length of field "Order ITEM" in table cprrp100 is 50.

Now when I write the following code...

select cprrp100.*
from cprrp100
where cprrp100.item = :tisfc001.mitm
selectdo
select sum(cprrp110.oqan):line.oqan
from cprrp110
where cprrp110._index1=
{:cprrp100.plnc,:cprrp100.type,:cprrp100.orno}
selectempty
line.oqan = 0
endselect
endselect

Though tisfc001.mitm is present in cprrp100 , it does not get selected,becoz the values of item are


tisfc001.mitm = " XXXXXXXXXXX" | 9 blanks
before the item starts.

cprrp100.item = " XXXXXXXXXX" | 11
blanks before he item starts....

if I add the following thing before the select command.

tisfc001.mitm =" " & tisfc001.mitm | making 11 spaces/blanks.

then it picks up the data.

I tried tt.align.domain as well.

Any suggestions....

Thanks.

NPRao
22nd October 2002, 02:09
You can use the http://www.baanboard.com/programmers_manual_baanerp_help_functions_string_operations_strip which is more performance intensive.

-OR-

You can change the code as -


select cprrp100.*
from cprrp100
where cprrp100.item(12) = :1
wherebind(1, tisfc001.mitm(10))
selectdo
select sum(cprrp110.oqan):line.oqan
from cprrp110
where cprrp110._index1=
{:cprrp100.plnc,:cprrp100.type,:cprrp100.orno}
selectempty
line.oqan = 0
endselect
endselect

~Vamsi
22nd October 2002, 02:24
line.oqan = 0
select sum(cprrp110.oqan):line.oqan
from cprrp110, cprrp100, cprpd100
where cprpd100._index9 = {:tisfc001.mitm}
and cprrp110.cmba refers to cprrp100
and cprrp100.cmba refers to cprpd100
selectdo
endselect

FransG
22nd October 2002, 09:29
cpcomdll0001 contains functions to 'convert' items from tcitem to cpitem and vice versa. These functions will take care of the segments.
So another solution (next to the solutions already offered) might be to have a variable of domain cpitem. Convert the tisfc001.mitm into that variable; and then use the variable in the query.

patvdv
22nd October 2002, 10:54
shajipthomas, please your post questions in the right forum. The 'Board Questions' forum is NOT the correct forum to get answers for Baan problems. Please read the forum descriptions!

shajipthomas
22nd October 2002, 18:32
Thank you all for your responses. I will try that.

Got you Patrick !!!!!:D