Calculation of interdependent virtual attributes
Kjetil Kilhavn
kjetilk at statoil.com
Sat Apr 10 04:11:24 EDT 2004
Use a common subroutine to set both of them and call it when necessary,=
otherwise just reading the private variables.
Following your example, use object-privat-hq_set to indicate whether th=
ey
have been set or not.
--
Kjetil Kilhavn
=
=
=20
Patrice Nolin =
=
=20
<Nolin.Patrice at hydro To: SAP-WUG at MITVMA.=
MIT.EDU =
=20
.qc.ca> cc: (bcc: Kjetil Ki=
lhavn) =
=20
Sent by: SAP Subject: Calculatio=
n of interdependent virtual attributes =
=20
Workflow =
=
=20
<Owner-SAP-WUG at MITVM =
=
=20
A.MIT.EDU> =
=
=20
=
=
=20
=
=
=20
07.04.2004 22:00 =
=
=20
Please respond to =
=
=20
"SAP Workflow Users' =
=
=20
Group" =
=
=20
=
=
=20
=
=
=20
Hi,
I have an object with 2 virtual attributes : hq_A and hq_B
The formula for hq_A is select table TABLE_X and count every row
The formula for hq_B is select table TABLE_X and count rows meeting a
condition
For performance reason, since for hq_A and hq_B I need to access the sa=
me
data, I was thinking to put the code for calculation of hq_A and hq_B i=
n
HQ_A attribute, setting a private variable hq_C and initiating hq_B wit=
h
the
private variable hq_C (see example below):
My problem occurs when I use HQ_B before HQ_A because the content of th=
e
private variable is calculated when HQ_A is referenced.
Is there another way to calculate my variables, without causing perform=
ance
problems?
Can we trigger the calculation of variables at the instantiation of the=
object ?
Or what are you suggestion on the matter ?
Thanks
Pat
---------------------
Example :
OBJECT ?
(See attached file: private,)?.
GET_PROPERTY HQ_B CHANGING CONTAINER.
SWC_SET_ELEMENT CONTAINER 'hq_b' object-private-hq_c.
END_PROPERTY.
GET_PROPERTY HQ_A CHANGING CONTAINER.
SWC_SET_ELEMENT CONTAINER 'hq_a' 2.
object-private-hq_c =3D 1.
END_PROPERTY.
Work well if I refer to HQ_A first. Then HQ_A =3D 2 and HQ_B =3D 1
Don't work well if I refer to HQ_B first. Then HQ_B =3D 0
-----------------------------------------------------------------------=
-----
Patrice Nolin, M.Sc.A. (courriel : nolin.patrice at hydro.qc.ca
<mailto:nolin.patrice at hydro.qc.ca> )
Concepteur d=E9veloppement informatique, Projet SIC
T=E9l=E9phone : 0-879-6129
-------------------------------------------------------------------
The information contained in this message may be CONFIDENTIAL and is
intended for the addressee only. Any unauthorised use, dissemination of=
the
information or copying of this message is prohibited. If you are not th=
e
addressee, please notify the sender immediately by return e-mail and de=
lete
this message.
Thank you.=
More information about the SAP-WUG
mailing list