Upload
umasankarreddy
View
219
Download
0
Embed Size (px)
Citation preview
8/10/2019 Forecasting Design
1/16
2014 SAP AGDietmar-Hopp-Allee 16
D-69190 Walldorf
SAP Custom Development
FBS Trade PromotionOptimization 100 - MKTPL -BOL / GenIL
Design
Version Status Date
0.1 Draft
Internal
8/10/2019 Forecasting Design
2/16
DesignInternal
2014 SAP AGDietmar-Hopp-Allee 16D-69190 Walldorf
Title: New Forecasting DesignVersion: 0.1Date: 14.09.2010
Page 2 of 16
Contents
1 Organization .................................................................................................. 4
1.1 Document Administration ............................................................................................... 4
1.1.1
Authors ...................................................................................................................... 4
1.1.2 History ....................................................................................................................... 4
1.2 Document Reference ...................................................................................................... 4
Glossary .................................................................................................................................... 5
2 High-Level Design......................................................................................... 5
2.1 Assumptions ................................................................................................................... 6
2.2 Architecture ..................................................................................................................... 6
2.3 Dynamic Behavior......................................................................................................... 10
2.4
Reusable Components ................................................................................................. 10
2.4.1 Reused Components ............................................................................................... 10
3 Detailed Design ........................................................................................... 11
3.1
Classes Methods .......................................................................................................... 11
3.1.1
Classes/Tables/structures ....................................................................................... 11
3.1.2 Methods ................................................................................................................... 11
3.1.3 Archiving .................................................................................................................. 14
3.1.4 BW extractors .......................................................................................................... 14
3.2 Unit Test Scenario ........................................................................................................ 14
4 Verification of Constraints ......................................................................... 15
4.1 Data Volumes ............................................................................................................... 15
4.2
Performance ................................................................................................................. 15
4.3 Data Protection ............................................................................................................. 15
4.4 Data Security ................................................................................................................ 15
4.5 Globalization ................................................................................................................. 15
4.6 Portability ...................................................................................................................... 15
4.7 Compatibility to Previous Versions ............................................................................... 15
5 Appendix ..................................................................................................... 15
5.1 Alternative Design Ideas ............................................................................................... 15
5.2 Overview of Modifications ............................................................................................. 15
5.3 Out of Scope ................................................................................................................. 16
8/10/2019 Forecasting Design
3/16
DesignInternal
2014 SAP AGDietmar-Hopp-Allee 16D-69190 Walldorf
Title: New Forecasting DesignVersion: 0.1Date: 14.09.2010
Page 3 of 16
6 Points for Clarification ............................................................................... 16
6.1
Open Points in Progress ............................................................................................... 16
6.2 Closed Points ................................................................................................................ 16
8/10/2019 Forecasting Design
4/16
DesignInternal
2014 SAP AGDietmar-Hopp-Allee 16D-69190 Walldorf
Title: New Forecasting DesignVersion: 0.1Date: 14.09.2010
Page 4 of 16
1 Organization
1.1 Document Administration
1.1.1 Authors
Name Company Role
Satyesh Singh Rajput SAP Custom Development India Author
1.1.2 History
1.2 Document Reference
Documents for developing within the marketing framework were used:
[Dev]: HowTo Create an Assignment (Quick Guide), Version 1.3
[Dev]:https://wiki.wdf.sap.corp/wiki/display/PTUCRM/Marketing+Generic+Object+Layer
[Dev]:https://wiki.wdf.sap.corp/wiki/display/PTUCRM/IBOM+Framework
[Dev]:https://wiki.wdf.sap.corp/wiki/display/WEBCUIF/Business+Object+Layer
[Dev]:https://wiki.wdf.sap.corp/wiki/display/WEBCUIF/Business+Object+Layer+Programming+-+How+to+Guide
[Dev]:https://wiki.wdf.sap.corp/wiki/display/WEBCUIF/Business+Object+Layer+Programming+7.0+-+How+to+Guide
[Dev]:https://wiki.wdf.sap.corp/wiki/display/WEBCUIF/Generic+Interaction+Layer
[Dev]:https://wiki.wdf.sap.corp/wiki/display/WEBCUIF/Implement+a+GenIL+Component+and+Simple+Objects+-+How+to+Guide
[Dev]:https://wiki.wdf.sap.corp/wiki/display/WEBCUIF/GenIL+Model+Editor+-+How+to+Guide [Dev]:https://wiki.wdf.sap.corp/wiki/display/WEBCUIF/GenIL+Programming+Tutorial+-
+How+to+Guide
[Dev]:https://wiki.wdf.sap.corp/wiki/display/WEBCUIF/GenIL+Programming+-+Sample+Application
Date Version Chapter Name Change/Enhancement Agreed with
0.1 All First Draft
https://wiki.wdf.sap.corp/wiki/display/PTUCRM/Marketing+Generic+Object+Layerhttps://wiki.wdf.sap.corp/wiki/display/PTUCRM/Marketing+Generic+Object+Layerhttps://wiki.wdf.sap.corp/wiki/display/PTUCRM/Marketing+Generic+Object+Layerhttps://wiki.wdf.sap.corp/wiki/display/PTUCRM/IBOM+Frameworkhttps://wiki.wdf.sap.corp/wiki/display/PTUCRM/IBOM+Frameworkhttps://wiki.wdf.sap.corp/wiki/display/PTUCRM/IBOM+Frameworkhttps://wiki.wdf.sap.corp/wiki/display/WEBCUIF/Business+Object+Layerhttps://wiki.wdf.sap.corp/wiki/display/WEBCUIF/Business+Object+Layerhttps://wiki.wdf.sap.corp/wiki/display/WEBCUIF/Business+Object+Layerhttps://wiki.wdf.sap.corp/wiki/display/WEBCUIF/Business+Object+Layer+Programming+-+How+to+Guidehttps://wiki.wdf.sap.corp/wiki/display/WEBCUIF/Business+Object+Layer+Programming+-+How+to+Guidehttps://wiki.wdf.sap.corp/wiki/display/WEBCUIF/Business+Object+Layer+Programming+-+How+to+Guidehttps://wiki.wdf.sap.corp/wiki/display/WEBCUIF/Business+Object+Layer+Programming+-+How+to+Guidehttps://wiki.wdf.sap.corp/wiki/display/WEBCUIF/Business+Object+Layer+Programming+7.0+-+How+to+Guidehttps://wiki.wdf.sap.corp/wiki/display/WEBCUIF/Business+Object+Layer+Programming+7.0+-+How+to+Guidehttps://wiki.wdf.sap.corp/wiki/display/WEBCUIF/Business+Object+Layer+Programming+7.0+-+How+to+Guidehttps://wiki.wdf.sap.corp/wiki/display/WEBCUIF/Generic+Interaction+Layerhttps://wiki.wdf.sap.corp/wiki/display/WEBCUIF/Generic+Interaction+Layerhttps://wiki.wdf.sap.corp/wiki/display/WEBCUIF/Generic+Interaction+Layerhttps://wiki.wdf.sap.corp/wiki/display/WEBCUIF/Implement+a+GenIL+Component+and+Simple+Objects+-+How+to+Guidehttps://wiki.wdf.sap.corp/wiki/display/WEBCUIF/Implement+a+GenIL+Component+and+Simple+Objects+-+How+to+Guidehttps://wiki.wdf.sap.corp/wiki/display/WEBCUIF/Implement+a+GenIL+Component+and+Simple+Objects+-+How+to+Guidehttps://wiki.wdf.sap.corp/wiki/display/WEBCUIF/GenIL+Model+Editor+-+How+to+Guidehttps://wiki.wdf.sap.corp/wiki/display/WEBCUIF/GenIL+Model+Editor+-+How+to+Guidehttps://wiki.wdf.sap.corp/wiki/display/WEBCUIF/GenIL+Model+Editor+-+How+to+Guidehttps://wiki.wdf.sap.corp/wiki/display/WEBCUIF/GenIL+Programming+Tutorial+-+How+to+Guidehttps://wiki.wdf.sap.corp/wiki/display/WEBCUIF/GenIL+Programming+Tutorial+-+How+to+Guidehttps://wiki.wdf.sap.corp/wiki/display/WEBCUIF/GenIL+Programming+Tutorial+-+How+to+Guidehttps://wiki.wdf.sap.corp/wiki/display/WEBCUIF/GenIL+Programming+Tutorial+-+How+to+Guidehttps://wiki.wdf.sap.corp/wiki/display/WEBCUIF/GenIL+Programming+-+Sample+Applicationhttps://wiki.wdf.sap.corp/wiki/display/WEBCUIF/GenIL+Programming+-+Sample+Applicationhttps://wiki.wdf.sap.corp/wiki/display/WEBCUIF/GenIL+Programming+-+Sample+Applicationhttps://wiki.wdf.sap.corp/wiki/display/WEBCUIF/GenIL+Programming+-+Sample+Applicationhttps://wiki.wdf.sap.corp/wiki/display/WEBCUIF/GenIL+Programming+-+Sample+Applicationhttps://wiki.wdf.sap.corp/wiki/display/WEBCUIF/GenIL+Programming+-+Sample+Applicationhttps://wiki.wdf.sap.corp/wiki/display/WEBCUIF/GenIL+Programming+Tutorial+-+How+to+Guidehttps://wiki.wdf.sap.corp/wiki/display/WEBCUIF/GenIL+Programming+Tutorial+-+How+to+Guidehttps://wiki.wdf.sap.corp/wiki/display/WEBCUIF/GenIL+Model+Editor+-+How+to+Guidehttps://wiki.wdf.sap.corp/wiki/display/WEBCUIF/Implement+a+GenIL+Component+and+Simple+Objects+-+How+to+Guidehttps://wiki.wdf.sap.corp/wiki/display/WEBCUIF/Implement+a+GenIL+Component+and+Simple+Objects+-+How+to+Guidehttps://wiki.wdf.sap.corp/wiki/display/WEBCUIF/Generic+Interaction+Layerhttps://wiki.wdf.sap.corp/wiki/display/WEBCUIF/Business+Object+Layer+Programming+7.0+-+How+to+Guidehttps://wiki.wdf.sap.corp/wiki/display/WEBCUIF/Business+Object+Layer+Programming+7.0+-+How+to+Guidehttps://wiki.wdf.sap.corp/wiki/display/WEBCUIF/Business+Object+Layer+Programming+-+How+to+Guidehttps://wiki.wdf.sap.corp/wiki/display/WEBCUIF/Business+Object+Layer+Programming+-+How+to+Guidehttps://wiki.wdf.sap.corp/wiki/display/WEBCUIF/Business+Object+Layerhttps://wiki.wdf.sap.corp/wiki/display/PTUCRM/IBOM+Frameworkhttps://wiki.wdf.sap.corp/wiki/display/PTUCRM/Marketing+Generic+Object+Layer8/10/2019 Forecasting Design
5/16
DesignInternal
2014 SAP AGDietmar-Hopp-Allee 16D-69190 Walldorf
Title: New Forecasting DesignVersion: 0.1Date: 14.09.2010
Page 5 of 16
Glossary
A SAP Trade Promotion Optimization 200 glossary will be provided in a central document.
2 High-Level Design
The existing design and implementation for triggering forecast is not modular and has potential to failin certain scenarios. In order to make it more modular, scalable, re-usable and neat and clean, we needto redesign the way forecast calls are made to DMF system. Currently following areas needsimprovement in the way forecasting is done:
1. Simplifying the class /TPO/CL_TPO_APPL_BASE:The class /TPO/CL_TPO_APPL_BASE iscluttered and has lot of processing logic. From marketing framework perspective the/TPO/CL_TPO_APPL_BASE is not intended to have lot of processing logic, however currently in TPO100 and TPO102 the class contains lot of processing logic, validation and methods containing severalhundred lines of code making the class bulky and prohibiting reusability. We need to make this class
leaner by delegating some of processing logic, validation to object layer, utility class, and serviceclasses.
2. Forecasting in background mode: Forecasting is still taking place using online method i.e. CRM ismaking RFC calls to DMF and waiting for results to be returned from DMF. It was decided earlier thatall DMF calls are triggered in background mode, so architectural changes are needed toaccommodate this feature. It has also been observed that in some scenarios the current approach toforecasting in online and batch mode can lead to unexpected behavior. To achieve this we need tocreate a new table /TPO/T_TPO_BGRUN for keeping track of the status for background job beingtriggered in DMF. Details about this table are provided later in the document.
3. Parallel processing for agreement forecasting:Agreement forecasting currently makes lot of RFCcalls to DMF. In real life scenario one agreement can have more than hundred TPMs and forecastingsuch agreement in current design would be challenging since each TPM forecast in agreement leadsto a RFC call, number of RFC calls in this case can be very high and will consume lot of systemresources. The parallel processing of agreement forecasting will be backward compatible for TPO100.
In order to resolve all the issues mentioned above, we need to fine tune current design for forecastingDMF calls. We also want the new design to be scalable so that, if in future we need new forecastingscenarios our design is robust and scalable to meet future requirement.
In our new design approach we will be doing taking the following approach:
1. Delegating object level validation to the object class. For example if validation is required forTPO object then the corresponding validation will be taken care by the object layer class ofTPO. Our approach will be to make use of existing method, if there is no existing methodthen in that case we will create a new method to carry out necessary validation
2. Hierarchy of classes mentioned in class diagram below will be created for better handling offorecasting in new design approach.
8/10/2019 Forecasting Design
6/16
DesignInternal
2014 SAP AGDietmar-Hopp-Allee 16D-69190 Walldorf
Title: New Forecasting DesignVersion: 0.1Date: 14.09.2010
Page 6 of 16
a. /TPO/CL_TPO_FORECAST_GEN: Generic class containing common methodsneeded for forecasting layer.
b. /TPO/CL_TPO_FORECAST_TPO: TPO specific class for methods needed for TPOspecific functionality.
c. /TPO/CL_TPO_FORECAST_TPM: TPM specific class for methods needed for TPMspecific functionality.
d. /TPO/CL_TPO_FORECAST_AGR: TPM specific class for methods needed for TPMspecific functionality.
3. Use of existing utility class /TPO/CL_TPO_UTIL: Services of utility class /TPO/CL_TPO_UTILwill be used, in specific scenarios, a new method may be created in this utility class.
4. A new table /TPO/T_TPO_BGRUN will be created to keep track of status of forecasting jobtriggered in DMF as background job. Once the background job in DMF side is finished thenCRM table and run status will be updated.
5. For agreement forecasting the data of TPMs will be grouped in several pools and then
forecasting will be done for each of the pool, once the forecasting of each of the pool iscompleted, agreement forecasting will be done. However the central entry point will still bethe class /TPO/CL_TPO_APPL_BASE.
6. The class /TPO/CL_TPO_APPL_BASE will contain a common method FORECAST which willbe called by all handler classes of TPO, TPM and AGR in this method at run time it will getthe instance of corresponding applications.
2.1 Assumptions
In order to achieve agreement forecasting by parallel forecasting of TPMs depends on the fact thatno changes are needed in DMF layer. If the assumption is not right then we may have to change our
approach.
2.2 Architecture
A high level flow using the new architecture will be as following when a user click on Predict orSimulate or Forecast button on TPO/TPM/Agreement screen, the control will be passed to respectivemethod in class /TPO/CL_TPO_APPL_BASE (till now no changes in the existing approach), then we
8/10/2019 Forecasting Design
7/16
DesignInternal
2014 SAP AGDietmar-Hopp-Allee 16D-69190 Walldorf
Title: New Forecasting DesignVersion: 0.1Date: 14.09.2010
Page 7 of 16
instantiate a new object of one of the child class /TPO/CL_TPO_FORECAST_GEN based on whetherforecasting is required for TPO or TPM or Agreement.
After object is instantiated class /TPO/CL_TPO_APPL_BASE will delegate the responsibility offorecasting to the object.
The object will create a record in /TPO/T_TPO_RUN table for this forecasting incident/event and
then trigger forecast to DMF system background mode only. The object will keep on polling for the timespecified in TPO customizing (wait time) if the forecasting get over before that then the results isdisplayed in the UI or else user is informed that forecasting has been triggered in background mode.
As new forecasting design requires changes at various layers in our new design approach we will bedoing taking the following approach:
1. Leaner /TPO/CL_TPO_APPL_BASE : In order to make the application base class/TPO/CL_TPO_APPL_BASE leaner, we will be restructuring/deleting methods mentioned inthe table below:
Method Function of the method Operation to be performed
GET_NEXT_TPO_ID Generates new ID for TPO object Move to /TPO/CL_TPO_UTIL class
HEADERCAUSAL_ASSIGN_READ Reads header causal data of TPM Move to TPM class/TPO/CL_TPO_FORECAST_TPM
FORECAST_AND_UPDATE Forecast & updates TPM
Restructure the code and put it in genericand TPM class.
1. Validation related to TPMmoves in object layer class ofCL_CRM_MKTPL_OL_TRADE.
2. Generic things like errorhandling will be usingmarketing framework classes
and methods whereverpossible, in worst case amethod will be created in TPMforecasting class.
3. Forecasting related stuff forTPM moves to TPM class.
GET_KF_VALUE Gets Key figure values Move to TPM class/TPO/CL_TPO_FORECAST_GEN
START_OBJECT_RUN Runs forecast Restructure the calls to forecast APIs
START_OBJECT_RUN_BG_MODE Runs forecast in background mode Restructure the calls to forecast APIs
GET_TPO_STATUS Returns status of TPO object Replace string literals with constants
CANCEL_RUN Cancels the background job in DMF Restructure and create a method ingeneric class
/TPO/CL_TPO_FORECAST_GEN withname CANCEL_RUN and move the APIcall /DMF/TPO_CANCEL_BATCH togeneric class
CREATE_NEW_TRADE_PROMOTION Creates a new TPM Evaluate if it can be delegated to
/TPO/CL_TPO_FORECAST_TPM
CREATE_TRADE_PROMOTION Creates a new TPM Evaluate if it can be delegated to
/TPO/CL_TPO_FORECAST_TPM
8/10/2019 Forecasting Design
8/16
DesignInternal
2014 SAP AGDietmar-Hopp-Allee 16D-69190 Walldorf
Title: New Forecasting DesignVersion: 0.1Date: 14.09.2010
Page 8 of 16
CREATE_TRADE_PROMOTIONS Creates new TPMs Evaluate if it can be delegated to
/TPO/CL_TPO_FORECAST_TPM
GET_CAUSAL_METATYPE_PATTERN Returns meta type Move to /TPO/CL_TPO_UTIL class
IS_VALID_META_TYPE Checks meta type Move to /TPO/CL_TPO_UTIL class
CHECK_CAUSALS_AGAINST_TPO_TYPE Checks causal Move to /TPO/CL_TPO_UTIL class
CONVERT_CUSTOMER_GUIDS Converts BUPA guids to a/c numbers Move to /TPO/CL_TPO_UTIL class
GET_PREDICTION_INPUT_FROM_AGR Gets prediction parameter fromagreement
Move to/TPO/CL_TPO_FORECAST_AGR
GET_PREDICTION_INPUT_FROM_TPM Gets prediction parameter from TPM Move to/TPO/CL_TPO_FORECAST_GEN
PREDICT_AGREEMENT Agreement forecasting Restructure the method and split the codein generic class and in
/TPO/CL_TPO_FORECAST_AGR class
GET_TPO_KFP_SUBCOMPONENTS Reads table crm_kfp_sub_comp Move to /TPO/CL_TPO_UTIL class
PREDICT_AGREEMENT_BG Predicts agreement in BG mode This method will become obsolete as allforecasting will be done in backgroundmode only.
SET_AGREEMENT_TIME Sets agreement time Move to/TPO/CL_TPO_FORECAST_AGR
In general the new approach will move TPO/TPM/AGR related methods to respective classes forthe sake of simplicity and modularity.
The following class diagram depicts the new class hierarchy to be realized.
a. /TPO/CL_TPO_FORECAST_GEN: Generic class containing common methods needed forforecasting layer.
b. /TPO/CL_TPO_FORECAST_TPO: TPO specific class for methods needed for TPO specificfunctionality.
c. /TPO/CL_TPO_FORECAST_TPM: TPM specific class for methods needed for TPM specific
functionality.
d. /TPO/CL_TPO_FORECAST_AGR: TPM specific class for methods needed for TPM specificfunctionality.
Details of each class and methods are provided in next section.
8/10/2019 Forecasting Design
9/16
DesignInternal
2014 SAP AGDietmar-Hopp-Allee 16D-69190 Walldorf
Title: New Forecasting DesignVersion: 0.1Date: 14.09.2010
Page 9 of 16
2. DDIC Changes: A new table /TPO/T_TPO_BGRUN will be created to store, track and updatestatus of background job in DMF. This table will not be part of object layer and it would beadded as external attribute.
Field Name Data Type Description
.include CRMS_MKTGS_ASG_PRIMARY_KEY_INC Fields for primary key of table
.include CRMS_MKTGS_ASG_CGPL_KEY_INC CGPL key fields
ASSIGN_GUID CRM_MKTGS_GUID Guid to link causal data to parent
RUN_GUID CRM_MKTGS_GUID Guid of run being triggered.
DMF_JOB_ID BTCJOBCNT Id of background job triggered in DMF
TRANSFER_STATUS /TPO/E_RUN_STATUS Status of background job triggered in DMF.
TIMESTAMP TIMESTAMPTimestamp for change logging
(It is used in BW extractors for delta handling)
Other DDIC like table types, structures etc, will be created to perform create/read/update/deletefrom table will also be created. Information about these DDIC objects are maintained in next sectionof this document.
A new class /TPO/CL_TPO_BGRUN_DB will be created to create/update/delete/read entriesfrom table /TPO/T_TPO_BGRUN. It will not be part of object layer as we want it to remainindependent so that DMF processes can update this table when forecasting has finished.
A new class /TPO/CL_TPO_RUN_DB will be created to create/update/delete/read entries fromtable /TPO/T_TPO_RUN.
3. Use of existing utility class /TPO/CL_TPO_UTIL: Services of utility class /TPO/CL_TPO_UTIL willbe used, in specific scenarios, a new method may be created in this utility class. The existing
utility class /TPO/CL_TPO_UTIL will provide more totalities to address the needs to the newclasses. The details of methods to be moved from /TPO/CL_TPO_APPL_BASE is provided innext section.
4. Grouping of TPM forecasting parameters: For agreement forecasting the data of TPMs will begrouped in several pools and then forecasting will be done for each of the pool, once theforecasting of each of the pool is completed, agreement forecasting will be done. It will beachieved via following flow:
a. The method predict_agreement of class /TPO/CL_TPO_APPL_BASE will instantiate anobject of class /TPO/CL_TPO_FORECAST_AGR.
b. Call the method predict of instantiated object.c. In the method of predict of class /TPO/CL_TPO_FORECAST_AGR loop through all TPMs and for each iteration call
method GET_PREDICTION_INPUT_FROM_TPM , once the forecast parameter for TPM is created , insert theprepared parameters into a table.d. After the loop sort the table containing parameterse. Group different parameters and for each group make a call for forecasting bases on following parameters
i. iv_senderii. iv_fc_start_dateiii. iv_fc_end_dateiv. iv_time_aggv. iv_ignore_prod_listing
8/10/2019 Forecasting Design
10/16
DesignInternal
2014 SAP AGDietmar-Hopp-Allee 16D-69190 Walldorf
Title: New Forecasting DesignVersion: 0.1Date: 14.09.2010
Page 10 of 16
vi. iv_also_unagg_flagvii. iv_use_existing_offers_flagviii. iv_fc_existing_offers_flagix.x. iv_fc_regular_sales_flagxi. iv_return_fc_info_tcd
xii. iv_scale_up_shipment_factorxiii. iv_diversion_shipment_factorxiv. iv_forward_buy_shipment_factorxv. iv_fc_time_agg_day_of_week
Once the group is prepared a forecasting for each group can be triggered and results aggregated. The logicfor aggregation can be inferred from the method /TPO/IF_FORECAST_EXT~FORECAST_JOB_STATUS ofclass /TPO/CL_BADI_FORECAST_IMPL lines 101 to 455.
The actual forecasting will still be performed in BADI layer so that if customer want to have his/her own forecastingengine they can implement forecast BADI and perform forecasting and analysis.
All these changes will be done keeping in mind following aspects:
I. Backward Compatibility with TPO 100: The changes will be done in a way so that it canbe down ported to TPO100 systems,
II. Switch using new and existing mechanism : Above changes will be done in a way thateven in TPO 200 system we can switch between old way of forecasting and new way. Sothat results can be compared, once the new design is stabilized switch will be disabledand only new will exist.
The implementation of the design will be stored in the package /TPO/P_INTEGRATION.
2.3 Dynamic Behavior
Forecasting objects will be instantiated by methods in the class /TPO/CL_TPO_APPL_BASEdepending on type of object being forecasted and would be primarily responsible for dynamic behavior offorecasting layer.
2.4 Reusable Components
2.4.1 Reused Components
Not applicable.
8/10/2019 Forecasting Design
11/16
DesignInternal
2014 SAP AGDietmar-Hopp-Allee 16D-69190 Walldorf
Title: New Forecasting DesignVersion: 0.1Date: 14.09.2010
Page 11 of 16
3 Detailed Design
3.1 Classes Methods
3.1.1 Classes/Tables/structures
3.1.1.1 Classes
Class Description
/TPO/CL_TPO_FORECAST_GEN Generic class for new forecasting layer
/TPO/CL_TPO_FORECAST_TPM Forecasting class for TPM, inheriting from /TPO/CL_TPO_FORECAST_GEN
/TPO/CL_TPO_FORECAST_AGR Forecasting class for Agreement, inheriting from /TPO/CL_TPO_FORECAST_GEN
3.1.1.2 Structures
Structures Description Used In
/TPO/S_TPO_BGRUN Attribute structure for line of table/TPO/T_TPO_BGRUN
Class/TPO/CL_TPO_FORECAST_GEN
FM /TPO/TPO_BGRUN_POST
3.1.1.3 Table types
Table types Description Function Module
/TPO/TT_TPO_BGRUN Table types for new table /TPO/T_TPO_BGRUN /TPO/TPO_BGRUN_POST
3.1.1.4 Tables
Reusing following tables to store data for forecast runs.
Tables Description
/TPO/T_TPO_RUN TPO OL: TPOObject Run Attributes (Already present in TPO system)
3.1.1.5 Function Modules
Modifications will be done in following function modules
Function Modules Description
/TPO/SING_RUN_RESULTS_UPDATE Update Object After single Prediction Run
/TPO/MULTI_RUN_RESULTS_UPDATE Update Object After Multi Prediction Run
3.1.2 Methods
Class Name:/TPO/CL_TPO_FORECAST_GEN
Attribute Visibility Data Type Purpose
8/10/2019 Forecasting Design
12/16
DesignInternal
2014 SAP AGDietmar-Hopp-Allee 16D-69190 Walldorf
Title: New Forecasting DesignVersion: 0.1Date: 14.09.2010
Page 12 of 16
MT_APPL_BASE Protected /TPO/CL_TPO_APPL_BASE To access TPO application base class & its services
Method Visibility Purpose
START_OBJECT_RUN Public Runs forecast
START_OBJECT_RUN_BG_MODE Public Runs forecast in background mode
SAVE_AND_START_RUN Public Saves Run Before Forecast in background mode
CREATE_RUN Public Creates Run
FORECAST_AND_UPDATE Public Forecast & updates TPM
GET_KF_VALUE Protected KPI Key figures
FORECAST_SINGLE_PREDICTION Protected Forecast single Prediction
FORECAST_MULTI_PREDICTION Protected Forecast Multi Prediction
/TPO/IF_TPO_FORECAST_GEN~FORECAST Public Interface
CANCEL_RUN Public Cancels Run
Class Name:/TPO/CL_TPO_FORECAST_TPM
Super Class:/TPO/CL_TPO_FORECAST_GEN
Attribute Visibility Data Type Purpose
MT_APPL_BASE Protected /TPO/CL_TPO_APPL_BASE To access TPO application base class & its services
Method Visibility Purpose
HEADERCAUSAL_ASSIGN_READ Public Reads header causal data of TPM
CREATE_TRADE_PROMOTIONS Public Creates a new TPM
CREATE_TRADE_PROMOTION Public Create TPMs
GET_PREDICTION_INPUT_FROM_TPM Public Gets prediction parameter from TPM
TPM_REF_ASSIGN_CREATE Public List of object IDs (GUIDs) for the genericproject planning
/TPO/IF_TPO_FORECAST_TPM~FORECAST Public Interface for TPM
Class Name:/TPO/CL_TPO_FORECAST_AGR
Super Class:/TPO/CL_TPO_FORECAST_GEN
Attribute Visibility Data Type Purpose
MT_APPL_BASE Protected/TPO/CL_TPO_APPL_BASE To access TPO application base class & its services
Method Visibility Purpose
GET_PREDICTION_INPUT_FROM_AGR Public Gets prediction parameter from agreement.
PREDICT_AGREEMENT Public Agreement forecasting
GET_DMF_AGG_LEVEL Public DMF aggregation data for agreement
8/10/2019 Forecasting Design
13/16
DesignInternal
2014 SAP AGDietmar-Hopp-Allee 16D-69190 Walldorf
Title: New Forecasting DesignVersion: 0.1Date: 14.09.2010
Page 13 of 16
/TPO/IF_TPO_FORECAST_GEN~FORECAST Public Interface for AGR
Class Name: /TPO/CL_TPO_UTIL
Attribute Visibility Data Type Purpose
MT_APPL_BASE Protected /TPO/CL_TPO_APPL_BASE To access TPO application base class & its services
Method Visibility Purpose
GET_NEXT_TPO_ID Public Generates new ID for TPO object
GET_TPO_STATUS Public Returns status of TPO object
GET_CAUSAL_METATYPE_PATTERN Public Returns meta type
IS_VALID_META_TYPE Public Checks meta type
CHECK_CAUSALS_AGAINST_TPO_TYPE Public Checks causal
CONVERT_CUSTOMER_GUIDS Public Converts BUPA guids to a/c numbers
GET_TPO_KFP_SUBCOMPONENTS Public Reads table crm_kfp_sub_comp
SET_TIMER Public Starts timer
Interface Name: /TPO/IF_TPO_DB_INTERACTION
Method Level Purpose
CREATE_RECORD Instance Inserts records in the table
UPDATE_RECORD Instance Update records of the table
DELETE_RECORD Instance Deletes records from the table
READ_RECORD Instance Read records from the table for the guid(s) sent.
Class Name: /TPO/CL_TPO_RUN_DB implements the interface /TPO/IF_TPO_DB_INTERACTION
Attribute Visibility Data Type Purpose
Method Visibility Purpose
CREATE_RECORD Public Insert records(s) in table /TPO/T_TPO_RUN
UPDATE_RECORD Public Update records(s) in table /TPO/T_TPO_RUN
DELETE_RECORD Public Delete records(s) from table /TPO/T_TPO_RUN
8/10/2019 Forecasting Design
14/16
DesignInternal
2014 SAP AGDietmar-Hopp-Allee 16D-69190 Walldorf
Title: New Forecasting DesignVersion: 0.1Date: 14.09.2010
Page 14 of 16
READ_RECORD Public Read records(s) from table /TPO/T_TPO_RUN
Class Name: /TPO/CL_TPO_BGRUN_DB implements the interface /TPO/IF_TPO_DB_INTERACTION
Attribute Visibility Data Type Purpose
Method Visibility Purpose
CREATE_RECORD Public Insert records(s) in table /TPO/T_TPO_BGRUN
UPDATE_RECORD Public Update records(s) in table /TPO/T_TPO_BGRUN
DELETE_RECORD Public Delete records(s) from table /TPO/T_TPO_BGRUN
READ_RECORD Public Read records(s) from table /TPO/T_TPO_BGRUN
3.1.3 Archiving
Not applicable.
3.1.4 BW extractors
Not applicable.
3.2 Unit Test Scenario
Following unit test cases needs to work for new causal design:
1. Single prediction using TPO.
2. Single prediction using TPM.
3. Simulation using TPO.
4. Simulation using TPM.
5. TPM forecasting.
6. Agreement forecasting.
8/10/2019 Forecasting Design
15/16
DesignInternal
2014 SAP AGDietmar-Hopp-Allee 16D-69190 Walldorf
Title: New Forecasting DesignVersion: 0.1Date: 14.09.2010
Page 15 of 16
4 Verification of Constraints
4.1 Data Volumes
Not relevant.
4.2 Performance
Not relevant.
4.3 Data Protection
Not relevant.
4.4 Data Security
Not relevant.
4.5 GlobalizationNot relevant.
4.6 Portability
Not relevant.
4.7 Compatibility to Previous Versions
Form based views will be created for nave users.
5 Appendix
5.1 Alternative Design Ideas
Not relevant.
5.2 Overview of Modifications
No modifications on standard objects (objects in SAP namespace).
[Here, list all necessary modifications to objects in SAP namespace (modifications to SAP standard).]
Function(Link to chapter 3 or 4)
Modification(components, objects)
8/10/2019 Forecasting Design
16/16
DesignInternal
2014 SAP AGDietmar-Hopp-Allee 16D-69190 Walldorf
Title: New Forecasting DesignVersion: 0.1Date: 14.09.2010
Page 16 of 16
5.3 Out of Scope
Not relevant.
6 Points for Clarification
6.1 Open Points in Progress
# Description Responsible Date/Decision
6.2 Closed Points
[Store closed points to remember the decisions that were made.]
# Description Responsible Date/Decision