baan999
29th April 2011, 09:02
I AM WRITING SESSION AS BELOW
GROUP.F (FORM LEVEL)
ITEM1 (FORM LEVEL)
ITEM2 (FORM LEVEL)
my item code is 20 digit
SCRIPT:
SELECT tcibd001.itgr,tcibd001.item,tcibd001.desc
from tcibd001
where tcibd001.itgr = {:group.f}
SELECTDO
ITEM1.F = :tcibd001.item(8;3)
ITEM2.F = :tcibd001.item(15;4)
item1 = item1.f
item2 = item2.f
which means i want to extract only selective filed and to be stored to item1.f /item2.f
now from form level , user to enter the details
group ---user to define ex. (001)
item1 --- ex. (tyq)
item2 ---- ex.(78tr)
resul:
the report is not printing as per the given critaria in form level(user)
it is printing all items
what is the problem or do i need to change the script logic...
if yes
please provide me sameple code similar to this. i can try
thanks in advance.....
chaio...
bdittmar
29th April 2011, 19:04
I AM WRITING SESSION AS BELOW
GROUP.F (FORM LEVEL)
ITEM1 (FORM LEVEL)
ITEM2 (FORM LEVEL)
my item code is 20 digit
SCRIPT:
SELECT tcibd001.itgr,tcibd001.item,tcibd001.desc
from tcibd001
where tcibd001.itgr = {:group.f}
SELECTDO
ITEM1.F = :tcibd001.item(8;3)
ITEM2.F = :tcibd001.item(15;4)
item1 = item1.f
item2 = item2.f
which means i want to extract only selective filed and to be stored to item1.f /item2.f
now from form level , user to enter the details
group ---user to define ex. (001)
item1 --- ex. (tyq)
item2 ---- ex.(78tr)
resul:
the report is not printing as per the given critaria in form level(user)
it is printing all items
what is the problem or do i need to change the script logic...
if yes
please provide me sameple code similar to this. i can try
thanks in advance.....
chaio...
Hello,
can't find field tcibd001.itgr in LN item-master.
Is the table you want to use a customized?
Be more specific, please.
Regards
blanchap
29th April 2011, 23:07
Hi,
did you run your script in debug mode just to see if it goes in the selectdo loop?
PB
baan999
30th April 2011, 04:18
IT IS tcibd001.item group field from LN 6.1
bdittmar
30th April 2011, 14:31
IT IS tcibd001.item group field from LN 6.1
Hello,
i'll give you some suggestions.
You'll select all items in a itemgroup which have "tyq" at the 1st three characters of itemcode-segment2?
Define formfields:
extern domain tccitg citg.f
extern domain tcitem item.f
extern domain tcitem item.t
Index4 of item master table tcibd001 is:
Itemgroup, Item (citg. item)
So your select should be:
select tcibd001.*
from tcibd001
where tcibd001._index4 inrange {:citg.f, :item.f}
and {:citg.f, :item.t}
selectdo
<your additional code here>
endselect
The input in form should be:
citg.f = desired item group (eg "001")
item.f = "_________tyq____________"
item.t = "ZZZZZZZZZtyqZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ"
The item code is 47 characters !
1st 9 characters are segment1 and next 38 characters are segment2!
The example selects all items in itemgroup 001 which have the characters tyq from position 10 on.
The undeline represents a <BLANK>
9 blank tyq
9 Z's tyq and Z's
Regards
baan999
1st May 2011, 09:47
hi bdittmar,
thanks for your query..
Let me explain my requirement and assist
I have item code of 20 characters & it is available in segment 2 ( 10- 30)
10 - 13 ( item group)
20- 22 ( standard)
28-30 (type)
i want the system to select only as per the form
on form
item group = 001 ... this should be entered in form level
standard = cfg ....
type = 999 ...
please send me script..
bdittmar
1st May 2011, 14:10
hi bdittmar,
thanks for your query..
Let me explain my requirement and assist
I have item code of 20 characters & it is available in segment 2 ( 10- 30)
10 - 13 ( item group)
20- 22 ( standard)
28-30 (type)
i want the system to select only as per the form
on form
item group = 001 ... this should be entered in form level
standard = cfg ....
type = 999 ...
please send me script..
Hello,
as i probably think, your itemcode is a "self-speaking" code.
The items have the information you want at fixed positions in segment 2?
extern domain tcmcs.str3 item.group |if 4 characters then use a string domain with 4
extern domain tcmcs.str3 item.standard
extern domain tcmcs.str3 item.type
select tcibd001.*
from tcibd001
where tcibd001.item(10;3) = :item.group
|if 4 characters then change ...(10;3) to ...(10;4)
and tcibd001.item(20;3) = :item.standard
and tcibd001.item(28;3) = :item.type
selectdo
endselect
This causes a "full table scan", which can be inperformant for huge tables!
I suggest to attend a development course for 4GL/SQL.
Regards
baan999
2nd May 2011, 11:01
Hi Bernd (bdittmar)
Refer below query (session script) is this ok.
(33-34 is numeric field; 37-39 is numberic field)
SELECT tdpur401.orno,tdpur401.odat,tdpur401.pono,tdpur401.otbp,tccom100.nama,tdpur401.item,
tcibd001.dsca,tdpur401.qoor,tdpur401.pric,tdpur400.ccur,tcmcs052.dsca
FROM tcibd001,tdpur401,tcmcs052,tccom100,tdpur400
WHERE tcibd001.item = tdpur401.item
and tcibd001.item(10;3) = :item.group
and tcibd001.item(33;4) = :item.standard
and tcibd001.item(37;3) = :item.type
and tdpur401.cprj = tcmcs052.cprj
and tdpur401.otbp = tccom100.bpid
and tdpur401.orno = tdpur400.orno
selectdo
amount = tdpur401.qoor * tdpur401.pric
rprt_send()
endselect
baan999
2nd May 2011, 20:48
solved...........