Wrong data getting printed.
Hello,
Need the help in given below issue.
I am trying to print two columns based on the given condition-
if we have tdpur040.orno does have the data of pur.order
order.no=tdpur040.orno
and if tdpur040.orno is not 0, then
sales.order.no= tdpur041.sorn
if tdpur040.orno does not have the data of pur.order then
check whether the data is in tdsls040.orno, if present
order.no=tdsls040.orno
if not present then
sales.order.no=0
Here's my code for the same-
pur.order = val(tfgld106.refr(8;6))
order.no = 0
sales.order.no = 0
select tdpur040.orno, tdpur041.sorn
from tdpur040, tdpur041
where tdpur040._index1 = {:pur.order} and
tdpur041._index1 = {:pur.order}
selectdo
order.no = tdpur040.orno
if tdpur040.orno <> 0 then
sales.order.no = tdpur041.sorn
endif
selectempty
order.no = 0
select tdsls040.orno
from tdsls040
where tdsls040._index1 = {:pur.order}
selectdo
order.no = tdsls040.orno
selectempty
sales.order.no = 0
endselect
endselect
In the attached screenshot the hightlighted sales order value is zero.But it should be tdpur041.sorn against the respective purchase order.
In my case, even if the tdpur040.orno has a data, my sales.order.no is coming out as zero.
Last edited by mark_h : 1st March 2021 at 21:16.
Reason: Turn off smiles
|