<?xml version="1.0" encoding="utf-8"?>
<ManualTopic ID="/baanerp/tg/onlinemanual/000024" xml:lang="en">
   <Header>
      <Title>To define a processing sequence for performance indicator script</Title>
      <Keyword type="header" order="d1e1964725">
         <Level1>Performance indicator script</Level1>
         <Level2>defining a processing sequence</Level2>
      </Keyword>
   </Header>
   <GeneralSection>
      <Paragraph>For complex <Link href="/baanerp/tg/glossary/glossary#000090" role="glossary">performance indicator</Link> computations
ERP sometimes requires certain base data from which the
resultant performance indicator value can be derived. So for every
performance indicator script, a unique Processing Sequence number
performance indicator is specified.</Paragraph>
      <Paragraph>When a performance indicator is processed by using the
Calculate Performance Indicators (tgeis0214m000) session based on the processing sequence number, all
performance indicators with a processing number less than the current
performance indicator are computed. The computation of the higher level
PIs is done according to the time fence required by the current
performance indicator.</Paragraph>
      <Paragraph>In the Performance Indicators (tgeis0511m000) session the performance indicator is linked to
a calendar code. The start dates for all periods from a year are
maintained in the Enterprise Period Table (tgeis0103s000) session.</Paragraph>
      <ExampleSection>
         <SectionTitle>Example</SectionTitle>
         <Paragraph>In the calculation of work-center utilization we have</Paragraph>
         <Formula space-and-orientation="indented-estimated">
            <Paragraph> domain tgeis.valu planned.hours  |Total planned hours domain
tgeis.valu availab.hours  |Total available hours
 planned.hours = GET.PI.VALUE(tgeis.modu.sfc, "L057.1") availab.hours =
 GET.PI.VALUE(tgeis.modu.rou, "L057.2") if availab.hours &lt;&gt; 0.0 then
 cwoc.utilization = round(planned.hours/ availab.hours * 100, 0,1) else
 cwoc.utilization = 0 endif
UPDATE.PI.VALUE(cwoc.utilization)
</Paragraph>
         </Formula>
         <Paragraph>This will now be implemented as follows:

PI named SFCPLANHRS with Seq. no 10
==&gt; will contain the script for calculation planned hours
 table ttisfc011 table ttisfc012
 long dummy long end.week long end.year long start.week long start.year
 domain tgeis.valu tot.plan.hours   |Total planned hours for all
                                   |work center
 itgeis0002.get.dates.n.period(date.num(), cur.yrno, cur.yrpt,
 prev.cur.prod, cur.start.date, cur.end.date)
 itgeis0002.get.dates.n.period(tgeis000.lcdt, run.yrno, run.yrpt,
 processed.prod, start.date, end.date)
 num.to.week(start.date,dummy, dummy, start.week, start.year)
 num.to.week(end.date, dummy , dummy, end.week, end.year)
 select tisfc011.* from   tisfc011 where  tisfc011._index2 between
 {:start.year, :start.week,
:start.date} and
{:end.year, :end.week,
:end.date} selectdo if tisfc011.prdt &gt;= start.date and tisfc011.prdt &lt;=
end.date then tot.plan.hours = tot.plan.hours + tisfc011.prtm
 endif endselect
UPDATE.VALUE("SFCPLANHRS", tot.plan.hours)

PI named ROUAVLBHRS with Seq. no 10
==&gt; will contain the script for calculation of available hours for all
work center

PI existing as WCENUTILITY with seq. no 20
==&gt; will calculate the work center utilization as shown below
 domain tgeis.valu cwoc.utilization domain tgeis.valu planned.hours
 domain tgeis.valu availab.hours
 planned.hours = GET.VALUE("SFCPLANHRS", 1995, 1, 3) availab.hours =
 GET.VALUE("ROUAVLBHRS", 1995, 1, 3)
 if availab.hours &lt;&gt; 0.0 then cwoc.utilization = round (planned.hours /
 availab.hours * 100, 0,1) else cwoc.utilization = 0 endif
UPDATE.VALUE("WCENUTILITY", cwoc.utilisaton, 1995,</Paragraph>
         <Paragraph>In the calculation of work-center utilization we have
 domain tgeis.valu planned.hours  |Total planned hours domain
tgeis.valu availab.hours  |Total available hours
 planned.hours = GET.PI.VALUE(tgeis.modu.sfc, "L057.1") availab.hours =
 GET.PI.VALUE(tgeis.modu.rou, "L057.2") if availab.hours &lt;&gt; 0.0 then
 cwoc.utilization = round(planned.hours/ availab.hours * 100, 0,1) else
 cwoc.utilization = 0 endif
UPDATE.PI.VALUE(cwoc.utilization)


This will now be implemented as follows:</Paragraph>
         <Formula space-and-orientation="indented-estimated">
            <Paragraph>
PI named SFCPLANHRS with Seq. no 10
==&gt; will contain the script for calculation planned hours
 table ttisfc011 table ttisfc012
 long dummy long end.week long end.year long start.week long start.year
 domain tgeis.valu tot.plan.hours   |Total planned hours for all
                                   |work center
 itgeis0002.get.dates.n.period(date.num(), cur.yrno, cur.yrpt,
 prev.cur.prod, cur.start.date, cur.end.date)
 itgeis0002.get.dates.n.period(tgeis000.lcdt, run.yrno, run.yrpt,
 processed.prod, start.date, end.date)
 num.to.week(start.date,dummy, dummy, start.week, start.year)
 num.to.week(end.date, dummy , dummy, end.week, end.year)
 select tisfc011.* from   tisfc011 where  tisfc011._index2 between
 {:start.year, :start.week,
:start.date} and
{:end.year, :end.week,
:end.date} selectdo if tisfc011.prdt &gt;= start.date and tisfc011.prdt &lt;=
end.date then tot.plan.hours = tot.plan.hours + tisfc011.prtm
 endif endselect
UPDATE.VALUE("SFCPLANHRS", tot.plan.hours)

PI named ROUAVLBHRS with Seq. no 10
==&gt; will contain the script for calculation of available hours for all
work center

PI existing as WCENUTILITY with seq. no 20
==&gt; will calculate the work center utilization as shown below
 domain tgeis.valu cwoc.utilization domain tgeis.valu planned.hours
 domain tgeis.valu availab.hours
 planned.hours = GET.VALUE("SFCPLANHRS", 1995, 1, 3) availab.hours =
 GET.VALUE("ROUAVLBHRS", 1995, 1, 3)
 if availab.hours &lt;&gt; 0.0 then cwoc.utilization = round (planned.hours /
 availab.hours * 100, 0,1) else cwoc.utilization = 0 endif
UPDATE.VALUE("WCENUTILITY", cwoc.utilisaton, 1995,
</Paragraph>
         </Formula>
      </ExampleSection>
   </GeneralSection>
</ManualTopic>