Baanboard.com

Go Back   Baanboard.com > Forum > Baan Quick Support: Functional & Technical > Tools Development

User login

Frontpage Sponsor

Main

Poll
As a Customer What would do to keep your ERP Implementation intact
Proactively define Business Process-- Take the Project Ownership
50%
Handover everything to System Integrator from drawing BP till implementation of ERP
17%
Hire more inhouse skilled & capable IT Resource to work directly with SI
33%
Rely on SI Architects/Consultants
0%
Total votes: 12

Baanboard at LinkedIn


Reference Content

Reply
 
Thread Tools Display Modes
  #1  
Old 26th February 2021, 16:33
pooja@96 pooja@96 is offline
Junior Member
 
Join Date: Nov 2020
Posts: 8
pooja@96 is on a distinguished road
Baan: Baan4 - DB: informix - OS: windows operation system
Wrong data getting printed.
Baan: Baan IVc
C/S: Both

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.
Attached Images
File Type: png Issue.PNG (18.9 KB, 7 views)

Last edited by mark_h : 1st March 2021 at 21:16. Reason: Turn off smiles
Reply With Quote
  #2  
Old 27th February 2021, 06:01
GeekGirlAkshara's Avatar
GeekGirlAkshara GeekGirlAkshara is offline
Junior Member
 
Join Date: Jul 2020
Location: India
Posts: 25
GeekGirlAkshara is on a distinguished road
Baan: 10.4 / 10.7 (Infor LN) - DB: MySQL, Oracle - OS: Windows
Hi Pooja,

Not sure about these tables cz your profile says u work on Baan4, but the field orno generally is of String type. You are using it as long. Doesn't it throw any error?

if not, try debugging the code, you will know where exactly the condition is not matching. Most probably it is not getting the pur.order in tdpur040 (first select statement)
__________________
Always ready to learn new things!
Reply With Quote
  #3  
Old 1st March 2021, 21:28
mark_h's Avatar
mark_h mark_h is offline
Guru
 
Join Date: Sep 2001
Location: Kentucky, USA
Posts: 7,574
mark_h will become famous soon enough
Baan: Baan 4C4 A&D1 - DB: Oracle - OS: Sun Solaris
I would say debug your code. I would say every time it finds an order it will execute
the if statement every time for every line - and it could be one of the last lines is 0, but I am not sure how your system works.

Code:
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 = {tdpur040.orno}
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
__________________
Mark

GO Cards!
My latest mantra - make sure you have latest stpapi patches and the latest session object. If on LN then please explore the option of using DAL2 functionality.

Shared Solutions for Baan systems provided free by Baan Board.
Play the Google game and help Baanboard get better rankings. Do your part. Click here to find how.
Reply With Quote
Sponsored Links
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Invoices printing issue-display last record with 2 lines tracylee Tools Development 7 20th October 2017 10:51
To replace printed data pegaga1979 Tools Development 6 14th February 2014 10:58
Application data dictionary vs. run-time data dictionary NPRao Tools Development 5 7th July 2009 08:16
ERPJewels Hitesh Shah Third Party Products 10 6th November 2006 05:38
PI Monitoring data wrong in Vc? AWondergem Project & Services 2 21st October 2003 07:00


All times are GMT +2. The time now is 15:40.


©2001-2021 - Baanboard.com - Baanforums.com