freeppy
19th November 2009, 13:33
hi,all
I define a variable for the Customer po on a Normal PO,the field is tdpur400.sorn,when I display or print it in a report,the report will show us the Customer po.But I want the PO report print out like that when the PO's refix is 'PUR' or 'PJW',it prints the field tdsls400.corn which is from the Sales Order which link to the EDI PO from another company.If not the 'PUR' or 'PJW' PO,the report print its Customer po as the field tdpur400.sorn,how can I modify the Script of the PO Report?If any help,Thanks for your appreciation!

DSchneider
19th November 2009, 14:41
In the print expression, where now pr.no is placed, you can give the following short if-the-else statement:

prefix="PUR" or prefix="PJW"?tdsls400.sorn:tdpur400.sorn

If you want to set it in the report script, it shoul look as follows:

If prefix = "PUR" or prefix = "PJW" Then
pr.no = tdsls400.sorn
Else
pr.no = tdpur400.sorn
Endif

Regards

freeppy
19th November 2009, 16:33
hi,DSchneider
Thanks for your attention! I write below in the report script.It can compile,but the tdsls400.corn or the tdpur400.sorn can't be printed out in the report.I forget to tell you that ,it is EDI SO,I get the data like this:I get the po PUR027829 (Prefix is "PUR" or
"PJW") in table tdpur400,and search its data in table tdsls402,get its EDI SO EDI000105
(tdsls402.orno) and PUR027829(tdsls402.apon),then turn to tdsls400,search EDI Sales order EDI000105,and get tdsls400.orno and find the SO Customer po is tdsls400.corn JUR007556,and put the tdsls400.corn in the report as PR NO.If the PO prefix is not "PUR" and "PJW",the report will print tdpur400.sorn as PO NO.IT means that tdpur400.orno
=tdsls402.apon,tdsls402.orno=tdsls400.orno(prefix is "EDI"),then pr.no=tdsls400.corn,
else pr.no=tdpur400.sorn.
Pls give your help,Thanks allways.

If (tdpur400.orno = "PUR" or tdpur400.orno = "PJW")
and (tdsls400.orno= "EDI" )
and tdpur400.orno=tdsls402.apon
and tdsls402.orno=tdsls400.orno)
then pr.no = tdsls400.corn
Else
pr.no = tdpur400.sorn
Endif