rahul ingale
12th September 2018, 16:10
Hello,

i need description based on deparetment.
i had one cdf field as type of demand type(cprrp100)
which has service ,sales and all other constant(.
also there is demand order as cdf field.
i want to get description of based on demand type.
like if demand type is sales then get sales order and sales office
if service then get service order and service department and goto
tcmcs065 and get description.

Can we achieve this using nested query in extension?

JaapJD
13th September 2018, 13:39
You don't need a Nested Select for this, but just with a Simple Expression. Actually not quite simple, but doable:


case cprrp100.<cdf_????>
when <sales> then
(select tdsls012.dsca from tdsls012, tdsls400
where tdsls400.orno = cprrp100.cdf_<????> and tdsls400.cofc refers to tdsls012)
when <service> then
(select tcmcs065.dsca from tcmcs065, tssoc200
where tssoc200.orno = cprrp100.cdf_<????> and tssoc200.cwoc refers to tcmcs065)
else ""
end

Of course you need to replace the strings between < and >.