KF Service

8
8/2/2019 KF Service http://slidepdf.com/reader/full/kf-service 1/8 13.09.2011 Page 1 of 8 SAP Note 903373 - Add a new service for computing key figures  Note Language: English Version: 1 Validity: Valid Since 30.11.2005 Summary Symptom Customer needs to add a service for a given key figure. Other terms SMI, SNI, DMO, Inventory Monitor, Demand Monitor, Supply Network Inventory Monitor Reason and Prerequisites Standard process extension; note 909554. If services are implemented in Function modules use the following: ICH 4.1, SP<10 note 911035. Solution  Add a new service for computing key figures. The present note is valid for all the screen supported by the ICH Data Matrix technology (ICHDM). In ICH 4.1 the following application are supported by ICHDM: o Inventory Monitor (Supplier Collaboration only) o Demand Monitor. In ICH 5.0 the following applications are supported: o SMI monitor o SNI monitor o Demand Monitor o TPOP In the ICH Data Matrix (ICHDM) every computed key figures requires an entity (static method, instance method or function module) implementing the required computation. Such an entity is called "ICHDM service". The current assumption (and pre-requisite for the successful implementation of this note) is that the customer is in need of changing an existing service. The implementation of this note is different for the SCM 4.1 release and for the SCM 5.0 release as the 5.0 release has remarkably improved the extensibility of the ICHDM technology, making simpler the maintenance of the customer enhancements. The next section details the APIs of the services (common in any release later than 4.1), while the later sections describe the required configuration for enabling the dynamic calls to the services. ICHDM services API Function modules are not used within the standard delivery, but are supported. Typically instance and static methods are used. Any service for computing key figures (regardless of the type) has an API that reads like:

Transcript of KF Service

Page 1: KF Service

8/2/2019 KF Service

http://slidepdf.com/reader/full/kf-service 1/8

13.09.2011 Page 1 of 8

SAP Note 903373 - Add a new service for computing keyfigures

 Note Language: English Version: 1 Validity: Valid Since 30.11.2005

Summary

Symptom 

Customer needs to add a service for a given key figure.

Other terms

SMI, SNI, DMO, Inventory Monitor, Demand Monitor, Supply Network

Inventory Monitor

Reason and Prerequisites

Standard process extension; note 909554.

If services are implemented in Function modules use the following:

ICH 4.1, SP<10 note 911035.

Solution

 Add a new service for computing key figures.The present note is valid for all the screen supported by the ICH

Data Matrix technology (ICHDM). In ICH 4.1 the following application are

supported by ICHDM:

o Inventory Monitor (Supplier Collaboration only)

o Demand Monitor.

In ICH 5.0 the following applications are supported:

o SMI monitor

o SNI monitor

o Demand Monitor

o TPOP

In the ICH Data Matrix (ICHDM) every computed key figures requires an

entity (static method, instance method or function module) implementing the

required computation. Such an entity is called "ICHDM service". The current

assumption (and pre-requisite for the successful implementation of this

note) is that the customer is in need of changing an existing service.

The implementation of this note is different for the SCM 4.1 release andfor the SCM 5.0 release as the 5.0 release has remarkably improved the

extensibility of the ICHDM technology, making simpler the maintenance of

the customer enhancements.

The next section details the APIs of the services (common in any release

later than 4.1), while the later sections describe the required

configuration for enabling the dynamic calls to the services.

ICHDM services API

Function modules are not used within the standard delivery, but are

supported. Typically instance and static methods are used. Any service forcomputing key figures (regardless of the type) has an API that reads like:

Page 2: KF Service

8/2/2019 KF Service

http://slidepdf.com/reader/full/kf-service 2/8

13.09.2011 Page 2 of 8

SAP Note 903373 - Add a new service for computing keyfigures

variable name type DDIC

it_agglevindex importing /SCF/CB_AGGLEVINDEX_TAB

it_keyfigs2bcomputed importing /SCF/CB_KPRMGUIDLIST_TAB

it_periods importing /SCF/CB_PERIODS_TAB

it_indepkeyfig importing /SCF/CB_KPRMINDEX_TAB

iv_serviceprof importing /SCF/CB_SERVICEPROF

it_kprmindexold importing /SCF/CB_KPRMINDEX_TAB

et_compkeyfig exporting /SCF/CB_KPRMINDEX_TAB

et_return exporting BAPIRETTAB

The data structure used by ICHDM is explained in details in note 909554.

The table it_agglevindex contains the aggregate levels (read also as

characteristics combinations) relevant for the computation. The table

it_keyfigs2bcomputed contains the list of the key figures for which the

computation is required. The key figures required by it_keyfigs2bcomputed

MUST be returned in the exporting table et_compkeyfig (unless an error

occurr; in that case the table et_return accomodates the need of publishing

messages to the frontend). The various key figures to be computed span overbucketed period of times defined by the table it_periods. The key figures

can be computed starting from the knowledge of other key figures (such as

the Projected Stock depends on the Demand): the "independent" key figures

are provided in the table it_indepkeyfig.

The variable iv_serviceprof allows to pass to the service a character-based

information in order to perform several operation within the same entity,

simply by providing a character-based parameter specified by the

configuration.

The table it_kprmindexold is only used for update mechanisms and should be

ignored in this case.

Every service written to compute key figures and used within the ICHDM MUST

comply with this API.

Service configuration

Before a given service can be associated to the computation of a given key

figures, it has to be configured for the use within the ICHDM. This

repository of service is available, both in release 4.1 and 5.0 in the

transparent table /SCF/CBSERVICES (use transaction SM30 to display the

entries). Regardless of the software release, any service must be declared

within this table.

As the configuration varies slighlty from the release 4.1, let us considerthe required configuration steps in different sections.

Service configuration in SCM 4.1.The release 4.1 delivers two pre-configured data matrices:

ICHDM identifier Business Process Application

ICHSMI01 SMI Inventory Monitor

ICHSMI03 DMO Demand Monitor

The configuration of the ICHDM is performed in the following tables:

Name Description/SCF/CB_DEF ICHDM definition

/SCF/CBAGGCPRM ICHDM aggregate level configuration

Page 3: KF Service

8/2/2019 KF Service

http://slidepdf.com/reader/full/kf-service 3/8

13.09.2011 Page 3 of 8

SAP Note 903373 - Add a new service for computing keyfigures

/SCF/CBAGGKPRM ICHDM key figure configuration

/SCF/CBKPRMSERV ICHDM key figures computation services

/SCF/CB_DEP Table of dependencies (which key figures are

required for the service, in case one key figures

depends on other key figures)

There is more than one way in achieving the change of service in the

delivered configured ICHDM. The recommended procedure requires that the

necessary changes are introduced in tables /SCF/CBKPRMSERV and /SCF/CB_DEP.

As both of these tables are delivered as "E" tables, with a given specified

customer namespace, and because one needs to change entries in the SAP

namespace, this operation constitutes a customer modification.

In this configuration the key figures have technical names (parameter

KPRM). Please refer to the following mapping

Inventory Monitor

Description KPRM (key figure technical name)Average Demand AVGDEMAND

Days of Supply DAYSOFSUPPLY

Demand DEMAND

In transit INTRANSIT

Maximum proposal MAXPROPOSAL

Maximum Stock MAXSTOCK

Minimum proposal MINPROPOSAL

Minimum Stock MINSTOCK

Firm Receipts ORDER

Planned Receipts PLANSHIP

Projected stock PROJSTOCK

Demand Monitor

Description KPRM (key figure technical name)

Customer Order CORDER

Absolute Deviation on Order DELTAORDER

Percentage Deviation on Order DELTAORDERPER

Absolute Deviation on Plan DELTAPLAN

Percentage Deviation on Plan DELTAPLANPER

Supplier In Transit INTRANSIT

Customer Plan NETDEMAND

Supplier Plan PLANSHIP

Supplier Order SORDER

Example

-------

Let us consider that one wants to modify the Projected Stock service used

in the Inventory Monitor within the release 4.1. If we check the table

/SCF/CBKPRMSERV for the ICHDM = ICHSMI01 and for the key figure PROJSTOCK

we find that for the aggregate level PRODLOCTOPRTFR (product, customer

location and supplier) the key figure is computed by the service

ICHSMIPROJSTOCK.

If we now check the service table /SCF/CBSERVICES we discover the

coordinates of the entity computing the projected stock (just find classand method name and load the object with SE80 or SE24).

By looking at the table of the dependencies /SCF/CB_DEP we also find out

Page 4: KF Service

8/2/2019 KF Service

http://slidepdf.com/reader/full/kf-service 4/8

13.09.2011 Page 4 of 8

SAP Note 903373 - Add a new service for computing keyfigures

that the projected stock of SMI requires --before the projected stock can

be computed-- that the key figures DEMAND, INTRANSIT,PLANSHIP be already

available.

Let us now assume that the customer wants to perform a different algorithm

for computing the projection so that the projected stock is NOT dependent

any longer on the INTRANSIT quantities and depends on the Average Demand,

AVGDEMAND.

The new algorithm can be encapsulated in any of the above mentioned

entities (static method, instance method and function module). Possibly use

function modules or static methods as the instance methods require some

additional development preparation (contact development for the latter

case).

Once the algorithm has been coded and implemented in an entity respecting

the above mentioned API, one need to enter one record for the new service

in table /SCF/CBSERVICES.

The service identifier is contained in the field SERVICE. The new entered

service must now replace the standard SAP service for the projected stock

in table /SCF/CBKPRMSERV (ICHSMIPROJSTOCK).

The last step requires an adjustment to the dependencies. If the newalgorithm is able to ignore the INTRANSIT key figure, one does not need to

delete the entry:

ICH data matrix ID ICHSMI1

ICHDM aggr. level ID PRODLOCTOPRTFR

ICHDM key figure prm PROJSTOCK

ICHDM service ID ICHSMIPROJSTOCK

Dependency sequence 2

ICHDM dep agglevID PRODLOCTOPRTFR

Dependent key figure INTRANSIT

even though by deleting the entry one can possibly obtain some performance

advantage (as the in transit quantities are then not required for

evaluating the projected stock, hence the inventory status does not depend

on the In transit, making the load of the Inventory Monitor Overview

possibly faster).

For sure, one need to add an entry to require the dependency on the Average

Demand, such as

ICH data matrix ID ICHSMI1

ICHDM aggr. level ID PRODLOCTOPRTFR

ICHDM key figure prm PROJSTOCK

ICHDM service ID ICHSMIPROJSTOCK

Dependency sequence 4

ICHDM dep agglevID PRODLOCTOPRTFRDependent key figure AVGDEMAND.

These last steps conclude the configuration for the release 4.1.

Service configuration in SCM 5.0.

In the release 5.0 it is possible to change the service configuration

without violating the SAP namespace for the configuration tables and

therefore introducing an enhancement that modifies the original delivered

SAP configuration. The reader interested only in the SCM 5.0 is also

strongly suggested to fully understand the procedure required for the

release 4.1 as that procedure would also work in the release 5.0.

As the previous section describes, the tables /SCF/CBKPRMSERV and

Page 5: KF Service

8/2/2019 KF Service

http://slidepdf.com/reader/full/kf-service 5/8

13.09.2011 Page 5 of 8

SAP Note 903373 - Add a new service for computing keyfigures

/SCF/CB_DEP contain the standard delivered SAP configuration entries. These

two tables are delivered as "E" tables. The release 5.0 introduced two

tables for the use of the SAP customers: /SCF/CCBKPRMSERV and /SCF/CCB_DEP

(note the additional "C"). Both these tables are delivered as "C" tables.

Example

-------

Let us now consider the same example we used in the previous section for

detailing how the tables can be modified in order to allow the customer to

change the behavior of the projected stock algorithm for the SMI process.

Again, this is one of the possible way to change an ICHDM service yet it is

not the only one. However, this has to be considered the reccommended way

of introducing a new service for an existing key figure in SCM 5.0 and

later releases.

For sake of convenience, let us repeat the same steps. Have a look at the

ICHDM = ICHSMI01 in the table /SCF/CBKPRMSERV for the key figure PROJSTOCK

for the aggregate level PRODLOCTOPRTFR. The service ID for this combination

reads: ICHSMIPROJSTOCK.

The main difference with the procedure to be used in SCM 4.1 is that the

tables introduced in 5.0 allow to remove the setup used in the standard and

add some additional content, without having to modify the standard SAP

table content.

In the present case one would have to do the following:

1. Create and setup a new service (function module or method)

2. Set up the customer table in order to remove the standard Projected

stock computation and dependency entries (key figures to be known

before the projected stock is computed)

3. Add the entries taking care of assigning the new service to the

projected stock key figure and also the information about which key

figures the projected stock depends upon (in this case we will remove

the dependency from "In Transit" and add the dependency from "Average

Demand").

These steps can be perfomed in sequence or in parallel. As long as we

provide consistency with the entries in the configuration table is ok (for

instance one needs to define the service before one can assign it).

The first point is quite easy. Let us assume we have a function module or a

static method. Let us open the SM30 view on table /SCF/CBSERVICES. Let usdefine a completely new service: the service will have to be in customer

namespace, that is anything starting with "X", "Y" or "Z".

The second step requires first to look into the tables /SCF/CBKPRMSERV and

/SCF/CB_DEP for the key values:

ICH data matrix ID ICHSMI1

ICHDM aggr. level ID PRODLOCTOPRTFR

ICHDM key figure prm PROJSTOCK

ICHDM service ID ICHSMIPROJSTOCK

In table /SCF/CBKPRMSERV one should find only one entry. Note down the key

values, which are exactly the same we have here above with the addiction ofthe sequence number (part of the key as well) which should be:

SEQ NR 1

Page 6: KF Service

8/2/2019 KF Service

http://slidepdf.com/reader/full/kf-service 6/8

13.09.2011 Page 6 of 8

SAP Note 903373 - Add a new service for computing keyfigures

.

Now, let us open the SM30 view for table /SCF/CCBKPRMSERV. Let us create a

new entry for the key:

ICH data matrix ID ICHSMI1

ICHDM aggr. level ID PRODLOCTOPRTFR

ICHDM key figure prm PROJSTOCK

ICHDM service ID ICHSMIPROJSTOCK

SEQ NR 1

making sure that we also flag the field "Remove from standard". This

ensures that the configuration entry provided with the SAP standard will

not be processed as if it would not exists. We now need to ensure that

there will be a new entry for computing the Projected Stock key figure.

Hence let us introduce a new entry in the table /SCF/CCBKPRMSERV, for

instance:

ICH data matrix ID ICHSMI1

ICHDM aggr. level ID PRODLOCTOPRTFR

ICHDM key figure prm PROJSTOCK

ICHDM service ID <here you need the new entry introduced in

/SCF/CBSERVICES>SEQ NR 4

So far we ensured the assignment, but we need still to arrange the

dependency entries. As the service ID is an explicit part of the key and we

are changing the service ID, it follows that we need to ensure that all the

entries in the SAP table /SCF/CB_DEP be removed for ensuring consistency.

For the key values:

ICH data matrix ID ICHSMI1

ICHDM aggr. level ID PRODLOCTOPRTFR

ICHDM key figure prm PROJSTOCK

ICHDM service ID ICHSMIPROJSTOCK

SEQ NR 1

the SAP standard configuration should contain 3 entries in the /SCF/CB_DEP

table:

ICH data matrix ID ICHSMI1

ICHDM aggr. level ID PRODLOCTOPRTFR

ICHDM key figure prm PROJSTOCK

ICHDM service ID ICHSMIPROJSTOCK

SEQ NR 1

Dependency sequence 1

ICHDM dep AgglevID PRODLOCTOPRTFR

Dependent Key figure DEMAND

ICH data matrix ID ICHSMI1ICHDM aggr. level ID PRODLOCTOPRTFR

ICHDM key figure prm PROJSTOCK

ICHDM service ID ICHSMIPROJSTOCK

SEQ NR 1

Dependency sequence 2

ICHDM dep AgglevID PRODLOCTOPRTFR

Dependent Key figure INTRANSIT

ICH data matrix ID ICHSMI1

ICHDM aggr. level ID PRODLOCTOPRTFR

ICHDM key figure prm PROJSTOCK

ICHDM service ID ICHSMIPROJSTOCKSEQ NR 1

Dependency sequence 3

Page 7: KF Service

8/2/2019 KF Service

http://slidepdf.com/reader/full/kf-service 7/8

13.09.2011 Page 7 of 8

SAP Note 903373 - Add a new service for computing keyfigures

ICHDM dep AgglevID PRODLOCTOPRTFR

Dependent Key figure PLANSHIP.

For each of these entries we will need to have an entry with the same key

in table /SCF/CCB_DEP, making sure to set the flag "Remove from standard" .

At this point in order to ensure dependency on Demand, Average Demand and

Planned Receipts one would have to add these entries to the same table

(/SCF/CCB_DEP):

ICH data matrix ID ICHSMI1

ICHDM aggr. level ID PRODLOCTOPRTFR

ICHDM key figure prm PROJSTOCK

ICHDM service ID <here you need the new entry introduced in

/SCF/CBSERVICES>

SEQ NR 4 (we changed the SEQ NR)

Dependency sequence 1

ICHDM dep AgglevID PRODLOCTOPRTFR

Dependent Key figure DEMAND

ICH data matrix ID ICHSMI1

ICHDM aggr. level ID PRODLOCTOPRTFR

ICHDM key figure prm PROJSTOCK

ICHDM service ID <here you need the new entry introduced in

/SCF/CBSERVICES>

SEQ NR 4 (we changed the SEQ NR)

Dependency sequence 2

ICHDM dep AgglevID PRODLOCTOPRTFR

Dependent Key figure AVGDEMAND

ICH data matrix ID ICHSMI1

ICHDM aggr. level ID PRODLOCTOPRTFR

ICHDM key figure prm PROJSTOCK

ICHDM service ID <here you need the new entry introduced in

/SCF/CBSERVICES>

SEQ NR 4 (we changed the SEQ NR)

Dependency sequence 3

ICHDM dep AgglevID PRODLOCTOPRTFR

Dependent Key figure PLANSHIP.

Et voila', the ICHDM = ICHSMI01 will now work with a different algorithm

and a new set of input key figures.

Page 8: KF Service

8/2/2019 KF Service

http://slidepdf.com/reader/full/kf-service 8/8

13.09.2011 Page 8 of 8

SAP Note 903373 - Add a new service for computing keyfigures

Header Data

Release Status: Released for Customer

Released on: 26.10.2006 08:28:15

Master Language: English

Priority: Recommendations/additional info

Category: Consulting

Primary Component: SCM-ICH-IMO Inventory Monitor

Secondary Components:

SCM-ICH-SNI Supply Network Inventory

 Valid Releases

Software Component Release From  

Release

To

Release

and

Subsequent

SCM 410 410 410 X