smusba
13th March 2011, 10:15
Dear Gurus,
I want to put a check on a field(tdpur940.clan)with certain criteria explained below:
the field (tdpur940.clan) is a landed cost code explained in customized master table.
this field should only accept
if item(1;1) = "0","1","3"
and tdpur040.orno(1;1) = "1".
If it fulfills this criteria it should accept (tdpur940.clan = "013").
else it should go to set.input. error
if item(1;1) = "0","1","3"
and tdpur040.orno(1;1) = "2".
If it fulfills this criteria it should accept (tdpur940.clan = "213").
My code is given below:
field.tdpur940.clan:
|after.field:
check.input:
select tcmcs910.*
from tcmcs910
where tcmcs910.clan=:tdpur940.clan
selectdo
select tdpur996.*, tdpur040.*
from tdpur996, tdpur040
where tdpur996._index1 = {:tdpur940.reno, :tdpur940.type}
and tdpur040.orno = tdpur996.orno.c
AS SET WITH 1 ROWS
selectdo
item = shiftl$(tdpur996.item.c)
orno = tdpur040.orno
sorno = shiftl$(str$(orno))
sorno = sorno(1;1)
clan = tdpur940.clan
sclan = shiftl$(str$(clan))
|if sclan = "013" then
if( tdpur996.orno.c = tdpur040.orno and sorno(1;1)="1" and (item(1;1)="0" or item(1;1)="1" or item(1;1)="3"))then
message("Item2 %s Orno %d sclan %s",item,orno,sclan)
else
set.input.error("ERROR 1 Only Dammam Purchase with Fresh Items are allowed")
|endif
endif
endselect
I want to put a check on a field(tdpur940.clan)with certain criteria explained below:
the field (tdpur940.clan) is a landed cost code explained in customized master table.
this field should only accept
if item(1;1) = "0","1","3"
and tdpur040.orno(1;1) = "1".
If it fulfills this criteria it should accept (tdpur940.clan = "013").
else it should go to set.input. error
if item(1;1) = "0","1","3"
and tdpur040.orno(1;1) = "2".
If it fulfills this criteria it should accept (tdpur940.clan = "213").
My code is given below:
field.tdpur940.clan:
|after.field:
check.input:
select tcmcs910.*
from tcmcs910
where tcmcs910.clan=:tdpur940.clan
selectdo
select tdpur996.*, tdpur040.*
from tdpur996, tdpur040
where tdpur996._index1 = {:tdpur940.reno, :tdpur940.type}
and tdpur040.orno = tdpur996.orno.c
AS SET WITH 1 ROWS
selectdo
item = shiftl$(tdpur996.item.c)
orno = tdpur040.orno
sorno = shiftl$(str$(orno))
sorno = sorno(1;1)
clan = tdpur940.clan
sclan = shiftl$(str$(clan))
|if sclan = "013" then
if( tdpur996.orno.c = tdpur040.orno and sorno(1;1)="1" and (item(1;1)="0" or item(1;1)="1" or item(1;1)="3"))then
message("Item2 %s Orno %d sclan %s",item,orno,sclan)
else
set.input.error("ERROR 1 Only Dammam Purchase with Fresh Items are allowed")
|endif
endif
endselect