Baanboard.com

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

User login

Frontpage Sponsor

Main

Poll
How big is your Baan-DB (just Data AND Indexes)
0 - 200 GB
19%
200 - 500 GB
28%
500 - 800 GB
2%
800 - 1200 GB
7%
1200 - 1500 GB
7%
1500 - 2000 GB
12%
> 2000 GB
24%
Total votes: 83

Baanboard at LinkedIn


Reference Content

Reply
 
Thread Tools Display Modes
  #1  
Old 19th December 2019, 15:33
zet2003 zet2003 is offline
Junior Member
 
Join Date: Feb 2018
Posts: 5
zet2003 is on a distinguished road
Baan: LN 10.2 - DB: SQL - OS: windows
constrain condition for company_nr
Baan: Infor ERP 10.1 (FP7)
C/S: None/Unknown

Hi dudes

Id like add a break for company_nr, this is
logic

if company is xx then do that
else
do other things

my actual code

Code:
table pur400 | company table

if [HR-Config]="23" or [HR-Config]="24" then
   NTPmeters = 0.5  | .5 meters for these two end configs
else
   if pur400.company_nr IN (702) then | only for 702 company
   NTPmeters = 0.273  | cap + splice allowance
   else | For other companies
   NTPmeters = 0.4 + 0.273  | cap + splice allowance 
endif

endif
NTPmeters = NTPmeters + CLength  | add ordered length of handrail

quantity=NTPmeters
of course no works, its just the logic id like add.

Thanks in advance.
Reply With Quote
  #2  
Old 19th December 2019, 16:12
mark_h's Avatar
mark_h mark_h is offline
Guru
 
Join Date: Sep 2001
Location: Kentucky, USA
Posts: 7,409
mark_h will become famous soon enough
Baan: Baan 4C4 A&D1 - DB: Oracle - OS: Sun Solaris
Well we never seen a table defined like pur400 usually we would have something like table ttdpur400 and then we would have tdpur400._compnr = 702. Maybe I am missing something from your post. Anyway if we were just checking in a script for a table we would use something like current.company = get.compnr(). Then we would check the company the script is running in using if current.company = 702 then.
__________________
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
  #3  
Old 19th December 2019, 16:35
zet2003 zet2003 is offline
Junior Member
 
Join Date: Feb 2018
Posts: 5
zet2003 is on a distinguished road
Baan: LN 10.2 - DB: SQL - OS: windows
sorry , i wrote faster than i know

of course its ttdpur400

the thing is if it would work to split a condition for company 702 and how build this condition

Its correct somethin like this?

Code:
if ttdpur400._compnr = 702 then
Do that
else
do other thing
endif
Thanks in advance for your quick reply.

BR
Reply With Quote
  #4  
Old 19th December 2019, 17:08
mark_h's Avatar
mark_h mark_h is offline
Guru
 
Join Date: Sep 2001
Location: Kentucky, USA
Posts: 7,409
mark_h will become famous soon enough
Baan: Baan 4C4 A&D1 - DB: Oracle - OS: Sun Solaris
Well you would use if tdpur400._compnr = 702. And I am not even sure that would work - I have never selected the field or tested it that way.
__________________
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.

Last edited by mark_h : 19th December 2019 at 17:14. Reason: Add more info
Reply With Quote
  #5  
Old 19th December 2019, 17:40
bdittmar's Avatar
bdittmar bdittmar is offline
Guru
 
Join Date: Apr 2002
Location: Germany, 50.584097,8.544078
Posts: 1,838
bdittmar will become famous soon enough
Baan: 2.2/3.1/4c4/LN6.1 FP6/FP9/HiDox Tools 10.7 - DB: tbase, ms-sql7, oracle10gV1, 11g - OS: HP-UX, W2K3, SLES
Company !

Hello,
Code:
_compnr predicate
The _compnr predicate specifies the actual company number of a table. 

Syntax
<compnr predicate>
    ::= <compnr column reference> = <compnr value>

<compnr column reference>
    ::= !! a Column reference whose column name is _compnr

<compnr value>
    ::= Integer constant
      | Parameter
      Syntactical restrictions
The value of the integer constant must lie between 0 and 999, all inclusive. 

The parameter must be of type integer. 

Semantics
The _compnr predicate always evaluates to True.
Code:
Company operations overview and synopsis
Overview
Use these functions to switch to another company and to retrieve information about the current company. 

Synopsis
boolean compnr.check() ( long new_compnr ) 
string get.company() ( ) 
long get.compnr() ( ) 
long get.financial.compnr() ( ) 
long get.logistic.compnr() ( ) 
long switch.to.company() ( long new_compnr ) 
long get.appl.data.company() ( string package(2), string application.id(30) )
So:

if get.compnr() = 123 then ..........

Regards
__________________
//Bernd
Reply With Quote
Sponsored Links
  #6  
Old 20th December 2019, 13:50
zet2003 zet2003 is offline
Junior Member
 
Join Date: Feb 2018
Posts: 5
zet2003 is on a distinguished road
Baan: LN 10.2 - DB: SQL - OS: windows
Hi dudes i built my constraint using different way

Code:
double NTPmeters
double CLength
long Comp

! Comp = get.compnr()   

if [HR-Resplice]="y" then
   CLength = [HR-CalcAddM]
else 
   CLength = [HR-CalcLenM]
endif

!  ON CASE Comp
!   CASE 701 or 702
!      if [HR-Config]="23" or [HR-Config]="24" then
!      NTPmeters = 0.5  | .5 meters for these two end configs
!      else
!      NTPmeters = 0.273  | splice allowance
!      endif
!   BREAK
!   DEFAULT:
!      if [HR-Config]="23" or [HR-Config]="24" then
!      NTPmeters = 0.5  | .5 meters for these two end configs
!      else
!      NTPmeters = 0.4 + 0.273  | cap + splice allowance
!      endif
!   BREAK
!   ENDCASE

NTPmeters = NTPmeters + CLength  | add ordered length of handrail

quantity=NTPmeters
no error found when check it, but its not doing my will.

Do you find logic issues in my code? is ON CASE statement the best way to built it?

Thanks in advance.
Reply With Quote
  #7  
Old 20th December 2019, 14:03
bdittmar's Avatar
bdittmar bdittmar is offline
Guru
 
Join Date: Apr 2002
Location: Germany, 50.584097,8.544078
Posts: 1,838
bdittmar will become famous soon enough
Baan: 2.2/3.1/4c4/LN6.1 FP6/FP9/HiDox Tools 10.7 - DB: tbase, ms-sql7, oracle10gV1, 11g - OS: HP-UX, W2K3, SLES
Case

Quote:
Originally Posted by zet2003 View Post
Hi dudes i built my constraint using different way

Code:
double NTPmeters
double CLength
long Comp

! Comp = get.compnr()   

if [HR-Resplice]="y" then
   CLength = [HR-CalcAddM]
else 
   CLength = [HR-CalcLenM]
endif

!  ON CASE Comp
!   CASE 701 or 702
!      if [HR-Config]="23" or [HR-Config]="24" then
!      NTPmeters = 0.5  | .5 meters for these two end configs
!      else
!      NTPmeters = 0.273  | splice allowance
!      endif
!   BREAK
!   DEFAULT:
!      if [HR-Config]="23" or [HR-Config]="24" then
!      NTPmeters = 0.5  | .5 meters for these two end configs
!      else
!      NTPmeters = 0.4 + 0.273  | cap + splice allowance
!      endif
!   BREAK
!   ENDCASE

NTPmeters = NTPmeters + CLength  | add ordered length of handrail

quantity=NTPmeters
no error found when check it, but its not doing my will.

Do you find logic issues in my code? is ON CASE statement the best way to built it?

Thanks in advance.
Code:
The ON CASE statement
This statement has the following syntax:

ON CASE expression
CASE expr_1:
        statements_1
        break
CASE expr_2:
        statements_2
        break
CASE expr_3:
        statements_3
        break
DEFAULT:                    | optional
        statements
ENDCASE
__________________
//Bernd
Reply With Quote
  #8  
Old 20th December 2019, 14:58
mark_h's Avatar
mark_h mark_h is offline
Guru
 
Join Date: Sep 2001
Location: Kentucky, USA
Posts: 7,409
mark_h will become famous soon enough
Baan: Baan 4C4 A&D1 - DB: Oracle - OS: Sun Solaris
My case statement would look like:
Code:
  ON CASE Comp
   CASE 701:
   CASE 702:
      if [HR-Config]="23" or [HR-Config]="24" then
	NTPmeters = 0.5  | .5 meters for these two end configs
      else
	NTPmeters = 0.273  | splice allowance
      endif
   BREAK
   DEFAULT:
      if [HR-Config]="23" or [HR-Config]="24" then
	NTPmeters = 0.5  | .5 meters for these two end configs
      else
	NTPmeters = 0.4 + 0.273  | cap + splice allowance
      endif
   ENDCASE
__________________
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
  #9  
Old 13th January 2020, 18:39
avpatil avpatil is offline
Guru
 
Join Date: Feb 2002
Posts: 746
avpatil is on a distinguished road
Baan: IVc3 - DB: SQL2000 - OS: Win 2003
Looks like you are working in PCF constraints. SO do you run PCF from more than one company, then all you need to do is check current company and build logic from that, right?
Reply With Quote
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
Exchange Export Condition problem satish_174 Tools Administration & Installation 3 25th November 2010 13:51
report print condition Elrodyn Tools Development 3 18th March 2009 11:13
Exchange condition issue Neal Matthews Tools Development 7 14th October 2008 17:43
Limit on number of exchange parameters by condition? BaanInOhio Tools Administration & Installation 1 3rd July 2008 16:08
Setting an Input condition on a Form field Baanboozeled Tools Development 12 30th March 2006 11:12


All times are GMT +2. The time now is 22:11.


©2001-2018 - Baanboard.com - Baanforums.com