how to implement bus. scenarios for customer loyalty mgmt
Post on 14-Apr-2018
236 Views
Preview:
TRANSCRIPT
7/27/2019 How to Implement Bus. Scenarios for Customer Loyalty Mgmt
http://slidepdf.com/reader/full/how-to-implement-bus-scenarios-for-customer-loyalty-mgmt 1/55
SAP (SAP America, Inc. and SAP AG) assumes no responsibility for errors or omissions in these materials.
These materials are provided “as is” without a warranty of any kind, either express or implied, including but not limited to, the
implied warranties of merchantability, fitness for a particular purpose, or non-infringement.
SAP shall not be liable for damages of any kind including without limitation direct, special, indirect, or consequential damages
that may result from the use of these materials.
SAP does not warrant the accuracy or completeness of the information, text, graphics, links or other items contained within
these materials. SAP has no control over the information that you may access through the use of hot links contained in these
materials and does not endorse your use of third party web pages nor provide any warranty whatsoever relating to third
party web pages.
mySAP BI “How-To” papers are intended to simplify the product implementation. While specific product features and
procedures typically are explained in a practical business context, it is not implied that those features and procedures arethe only approach in solving a specific business problem using mySAP BI. Should you wish to receive additional information,
clarification or support, please refer to SAP Professional Services (Consulting/Remote Consulting).
How to…
Implement Business Scenarios forCustomer Loyalty Management
BUSINESS INFORMATION W AREHOUSE
CUSTOMER RELATIONSHIP M ANAGEMENT
STRATEGIC ENTERPRISE M ANAGEMENT
Applicable Releases: CRM 4.0, SEM 3.50, BW 3.1 / BI Content 3.3 Add-On,
August 2004
7/27/2019 How to Implement Bus. Scenarios for Customer Loyalty Mgmt
http://slidepdf.com/reader/full/how-to-implement-bus-scenarios-for-customer-loyalty-mgmt 2/55
HOW TO… IMPLEMENT BUSINESS SCENARIOS FOR CUSTOMER LOYALTY MANAGEMENT
©2004 SAP AMERICA, INC. ANDSAP AG 1
1 Business ScenarioCustomer Loyalty Management is an important business scenario within Customer Relationship
Management. It is of particular importance when businesses deal with consumers (“Business to
Consumer scenarios” or B2C). Marketing experts have proposed to introduce “Loyalty Accounts” for this
purpose. In this approach each customer gets assigned one or several numbers, which we will call
“Loyalty Points”. Within the Marketing Process it is defined how the interaction with the customer will
change the number of Loyalty Points. Typically incoming orders will increase the number of Loyalty
Points. Depending on the number of points acquired by the customer, the customer will have certain
benefits or may get specific offerings. The usage of these benefits will then reduce the number of
Loyalty Points.
Within the different industries there is of a wide range of examples for Customer Loyalty Management.
We would like to mention two examples, which show the different level of complexity, when dealing withLoyalty Points: Airlines have introduced “Frequent Flyer Programs”. For each flight the customers is
granted a number of Loyalty Points (“Miles”). If the customer has acquired a sufficient number of Miles,
he may use them to book a new flight . Some Airlines have built collaborative scenarios involving car
rental companies, hotel chains and other businesses. The computation of Loyalty Points can be very
complicated. For example the Airline may want to grant the customer additional Loyalty Points, if the
customer uses a rental car in connection with a business flight. The other example comes from Retail.
Many Retailers have introduced a Loyalty Card, which allows to identify the customer at the POS and to
interact directly with the customers. Some companies send out Coupons or Vouchers to their
customers, others work with rebates and send back money to the customer’s account.
This paper explains how to implement Customer Loyalty Management on the basis of Loyalty Points
with low level of complexity. We will therefore exclude the following topics:
1. Usage of Loyalty Points for Payment.
2. Front end applications, which would allow a customer to interact with the company to get
information about the number of Loyalty Points or to request corrections. We would like to
mention that CRM 4.0 provides sufficient flexibility to build such application for the Customer
Interaction Center or for Internet Sales on project level.
3. Complex Condition for the computation of Loyalty Points. By this we mean, that the Loyalty
Points for a number of transactions with different items can be computed by computing first the
Loyalty Points for each item and then adding them up.
We would like to add several comments:
a) The storage and computation of the Loyalty Points will be done in the Business Information
Warehouse. Our restriction on complex conditions allows us to compute the Loyalty Points within the
staging process in BW when data are loaded into BW. We will therefore call such rules for thecalculation of points “a-priori-rules”. The BW system provides extensive mechanisms to fully control the
upload of data and to ensure data integrity and completeness. Therefore standard BW procedures can
guarantee the correctness of the Loyalty Data without any enhancement of the control mechanisms. In
some businesses like Retail a large number of transactions need to be processed, which can only be
done efficiently if the computation of Loyalty Points can be done on item level. For businesses with high
transaction volume performance considerations lead to the conclusion, that the marketing process
should not allow rules for the computation of Loyalty Points, which link different items of customer
transactions. The discussion can be summarized in the following statement: “A-priori-Rules” in
Customer Loyalty Management are more suitable for the processing of large volumes of transactions.
7/27/2019 How to Implement Bus. Scenarios for Customer Loyalty Mgmt
http://slidepdf.com/reader/full/how-to-implement-bus-scenarios-for-customer-loyalty-mgmt 3/55
7/27/2019 How to Implement Bus. Scenarios for Customer Loyalty Mgmt
http://slidepdf.com/reader/full/how-to-implement-bus-scenarios-for-customer-loyalty-mgmt 4/55
HOW TO… IMPLEMENT BUSINESS SCENARIOS FOR CUSTOMER LOYALTY MANAGEMENT
©2004 SAP AMERICA, INC. ANDSAP AG 3
The example implementation does not implement a process for the reduction of points (“point reduction
scheme”). Point reduction schemes can be implemented using precisely the same methods, which are
used to compute the Loyalty Points from the incoming POS data. Vouchers for Point Reduction can
either be identified by the POS system, when they are used by the customer in the store, andprocessed with the POS upload. Or the points can be reduced immediately after the customer has
received the voucher using the upload of the out bound contact information from CRM.
2 Introduction
The setup for the application described in the previous chapter requires preparatory work in BW, SEM
and CRM:
• Create Planning InfoCube in BW for the storage of the rules
• Create Planning Area and Planning Level in SEM
• Define Planning Profile Groups in CRM Customizing
• Enhance Planning Layouts in SEM
• Create InfoCube for the Storage of Loyalty Points in BW
• Create Coding for the retrieval of rules from the Planning InfoCube
• Define Update Rules for the InfoCube with Loyalty Points using the Coding of the previous step.
This requires the creation of a start routine and several update routines
• Define Marketing Attributes and Attribut e Set in CRM for the storage of Loyalty Points
•
Define Analysis Process to transfer Loyalty Points from BW to CRM After this, a Marketing Specialist can define “Loyalty Campaigns” in CRM, choose one of the Planning
Layouts defined for “Loyalty Management” and the simply enter the data for the rules in the Key Figure
Planning for the Campaign Elements. Then be the setup of the whole application in BW the rules will be
applied, when the POS data in BW are uploaded. The creation of outbound campaign, in which all
Business Partner will be contacted and receive a voucher, for which the Number of Loyalty Points
exceeds a certain threshold, is a standard task in CRM and can be completely automated using the
Campaign Automation features of CRM 4.0. Since this is documented elsewhere, we will omit this step
here.
We would like to add one remark, which can be useful for an implementation of the scenario in Retail.
The Business Partners in CRM may be used to represent a Retail Store. If such Business Partners are
assigned to a Loyalty Campaign, the Retailer could define rules for Loyalty Campaigns, which are
specific to the stores assigned to the campaign. For this we would need to identify in BW the StoreNumber from the POS data with the Business Partner Number in CRM which represents the Retail
Store. We did not include this feature in our example implementation, but our coding, which retrieves
the rules form the Planning InfoCube, would already be able to deal with this. We are only missing the
identification of stores and Business Partners in BW. But this could easily be added.
7/27/2019 How to Implement Bus. Scenarios for Customer Loyalty Mgmt
http://slidepdf.com/reader/full/how-to-implement-bus-scenarios-for-customer-loyalty-mgmt 5/55
7/27/2019 How to Implement Bus. Scenarios for Customer Loyalty Mgmt
http://slidepdf.com/reader/full/how-to-implement-bus-scenarios-for-customer-loyalty-mgmt 6/55
HOW TO… IMPLEMENT BUSINESS SCENARIOS FOR CUSTOMER LOYALTY MANAGEMENT
©2004 SAP AMERICA, INC. ANDSAP AG 5
3 The Step By Step SolutionThe following list replicates the list for the preparatory work and links them to the objects of our example
implementation:
1. Create Planning InfoCube ZCRMLOM in BW for the storage of the rules
2. Create Planning Area ZCRMLOM and Planning Level ZCRMART in SEM
3. Define Planning Profile Groups ZLOM in CRM Customizing
4. Enhance Planning Layouts in SEM (ZLOM, ZLOMART)
5. Create InfoCube ZLOMPTS for the Storage of Loyalty Points in BW
6. Create Coding for the retrieval of rules from the Planning InfoCube
a. DDIC Structure ZLOM_S_POINTS_SCHEME and table type
ZLOM_T_POINTS_SCHEME
b. Function Group ZLOM and function module ZLOM_POINT_CALCULATION
7. Define Update Rules for the InfoCube with Loyalty Points using the Coding of the previous step
8. Define Marketing Attributes ZNBRPOINTS and Attribute Set in CRM for the storage of Loyalty
Points
9. Define Analysis Process ZYLPTS to transfer Loyalty Points from BW to CRM
10. User perspective: Loyalty Points as properties of a Business Partner
11. User perspective: How to define Loyalty Campaigns in the CRM Marketing Planner
7/27/2019 How to Implement Bus. Scenarios for Customer Loyalty Mgmt
http://slidepdf.com/reader/full/how-to-implement-bus-scenarios-for-customer-loyalty-mgmt 7/55
7/27/2019 How to Implement Bus. Scenarios for Customer Loyalty Mgmt
http://slidepdf.com/reader/full/how-to-implement-bus-scenarios-for-customer-loyalty-mgmt 8/55
7/27/2019 How to Implement Bus. Scenarios for Customer Loyalty Mgmt
http://slidepdf.com/reader/full/how-to-implement-bus-scenarios-for-customer-loyalty-mgmt 9/55
HOW TO… IMPLEMENT BUSINESS SCENARIOS FOR CUSTOMER LOYALTY MANAGEMENT
©2004 SAP AMERICA, INC. ANDSAP AG 8
Assign Key Figures:
InfoObject Description
ZBONUSP Bonus points per Piece
ZBONUSA Bonus points per Amount
0KEYFG_FLAG Flag for Planning Layout Display
(The Key Figure ZRVALUE, “Rule type value“, was not used in the scenario described here.)
ZBONUSP and ZBONUSA are key figures specifically created for this scenario to store the number of
bonus points per currency or per unit spent by the customer. Note that 0KEYFG_FLAG needs to be
included.
7/27/2019 How to Implement Bus. Scenarios for Customer Loyalty Mgmt
http://slidepdf.com/reader/full/how-to-implement-bus-scenarios-for-customer-loyalty-mgmt 10/55
HOW TO… IMPLEMENT BUSINESS SCENARIOS FOR CUSTOMER LOYALTY MANAGEMENT
©2004 SAP AMERICA, INC. ANDSAP AG 9
2 Create Planning Area ZCRMLOM and Planning
Level ZCRMART in SEM
Transaction BPS0 “Business Planning and Simulation”
Create Planning Area: “ZCRMLOM” with description “Loyalty Marketing Bonus Points Planning”.
(Specify “local” if SEM and BW system are the same, otherwise “remote” and the RFC Destination for
the BW system,)
Assign InfoCube “ZCRMLOM” “Plan cube for Loyalty Marketing”,
Create one or several Planning Levels for the Planning Area, for example “ZCRMART” with description
“Bonus Points Planning for Articles”,
Choose characteristics. In the example implementation for the planning level ZCRMART we want to
impose rules on specific products, but independent from Customers or Stores (which are Business
Partners in CRM). We assume that in our Loyalty Campaign we want to fix the currency to “EUR”, CRM
Version needs to be included for technical reasons. Version is included to distinguish the different
Planning Layouts:
7/27/2019 How to Implement Bus. Scenarios for Customer Loyalty Mgmt
http://slidepdf.com/reader/full/how-to-implement-bus-scenarios-for-customer-loyalty-mgmt 11/55
7/27/2019 How to Implement Bus. Scenarios for Customer Loyalty Mgmt
http://slidepdf.com/reader/full/how-to-implement-bus-scenarios-for-customer-loyalty-mgmt 12/55
7/27/2019 How to Implement Bus. Scenarios for Customer Loyalty Mgmt
http://slidepdf.com/reader/full/how-to-implement-bus-scenarios-for-customer-loyalty-mgmt 13/55
7/27/2019 How to Implement Bus. Scenarios for Customer Loyalty Mgmt
http://slidepdf.com/reader/full/how-to-implement-bus-scenarios-for-customer-loyalty-mgmt 14/55
7/27/2019 How to Implement Bus. Scenarios for Customer Loyalty Mgmt
http://slidepdf.com/reader/full/how-to-implement-bus-scenarios-for-customer-loyalty-mgmt 15/55
7/27/2019 How to Implement Bus. Scenarios for Customer Loyalty Mgmt
http://slidepdf.com/reader/full/how-to-implement-bus-scenarios-for-customer-loyalty-mgmt 16/55
HOW TO… IMPLEMENT BUSINESS SCENARIOS FOR CUSTOMER LOYALTY MANAGEMENT
©2004 SAP AMERICA, INC. ANDSAP AG 15
Maintain Enhancements for “Layout Flag”: set the “Hidden” flag.
Then the Preview tab strip displays how the planning area would roughly look. Note that in our example
the “Planning Currency” will be displayed in the header, since it was fixed to EUR in the planning level
ZCRMART.
7/27/2019 How to Implement Bus. Scenarios for Customer Loyalty Mgmt
http://slidepdf.com/reader/full/how-to-implement-bus-scenarios-for-customer-loyalty-mgmt 17/55
7/27/2019 How to Implement Bus. Scenarios for Customer Loyalty Mgmt
http://slidepdf.com/reader/full/how-to-implement-bus-scenarios-for-customer-loyalty-mgmt 18/55
7/27/2019 How to Implement Bus. Scenarios for Customer Loyalty Mgmt
http://slidepdf.com/reader/full/how-to-implement-bus-scenarios-for-customer-loyalty-mgmt 19/55
7/27/2019 How to Implement Bus. Scenarios for Customer Loyalty Mgmt
http://slidepdf.com/reader/full/how-to-implement-bus-scenarios-for-customer-loyalty-mgmt 20/55
7/27/2019 How to Implement Bus. Scenarios for Customer Loyalty Mgmt
http://slidepdf.com/reader/full/how-to-implement-bus-scenarios-for-customer-loyalty-mgmt 21/55
7/27/2019 How to Implement Bus. Scenarios for Customer Loyalty Mgmt
http://slidepdf.com/reader/full/how-to-implement-bus-scenarios-for-customer-loyalty-mgmt 22/55
7/27/2019 How to Implement Bus. Scenarios for Customer Loyalty Mgmt
http://slidepdf.com/reader/full/how-to-implement-bus-scenarios-for-customer-loyalty-mgmt 23/55
7/27/2019 How to Implement Bus. Scenarios for Customer Loyalty Mgmt
http://slidepdf.com/reader/full/how-to-implement-bus-scenarios-for-customer-loyalty-mgmt 24/55
7/27/2019 How to Implement Bus. Scenarios for Customer Loyalty Mgmt
http://slidepdf.com/reader/full/how-to-implement-bus-scenarios-for-customer-loyalty-mgmt 25/55
7/27/2019 How to Implement Bus. Scenarios for Customer Loyalty Mgmt
http://slidepdf.com/reader/full/how-to-implement-bus-scenarios-for-customer-loyalty-mgmt 26/55
7/27/2019 How to Implement Bus. Scenarios for Customer Loyalty Mgmt
http://slidepdf.com/reader/full/how-to-implement-bus-scenarios-for-customer-loyalty-mgmt 27/55
7/27/2019 How to Implement Bus. Scenarios for Customer Loyalty Mgmt
http://slidepdf.com/reader/full/how-to-implement-bus-scenarios-for-customer-loyalty-mgmt 28/55
7/27/2019 How to Implement Bus. Scenarios for Customer Loyalty Mgmt
http://slidepdf.com/reader/full/how-to-implement-bus-scenarios-for-customer-loyalty-mgmt 29/55
7/27/2019 How to Implement Bus. Scenarios for Customer Loyalty Mgmt
http://slidepdf.com/reader/full/how-to-implement-bus-scenarios-for-customer-loyalty-mgmt 30/55
7/27/2019 How to Implement Bus. Scenarios for Customer Loyalty Mgmt
http://slidepdf.com/reader/full/how-to-implement-bus-scenarios-for-customer-loyalty-mgmt 31/55
7/27/2019 How to Implement Bus. Scenarios for Customer Loyalty Mgmt
http://slidepdf.com/reader/full/how-to-implement-bus-scenarios-for-customer-loyalty-mgmt 32/55
7/27/2019 How to Implement Bus. Scenarios for Customer Loyalty Mgmt
http://slidepdf.com/reader/full/how-to-implement-bus-scenarios-for-customer-loyalty-mgmt 33/55
HOW TO… IMPLEMENT BUSINESS SCENARIOS FOR CUSTOMER LOYALTY MANAGEMENT
©2004 SAP AMERICA, INC. ANDSAP AG 32
Maintain Key Figures per Product depending on the rule you would like to impose:
Customers will get 2 Loyalty Points for each Euro they spend for one of the assigned 4 products and in
addition 1 Loyalty Point for each unit of the second article (“Fragrances”).
7/27/2019 How to Implement Bus. Scenarios for Customer Loyalty Mgmt
http://slidepdf.com/reader/full/how-to-implement-bus-scenarios-for-customer-loyalty-mgmt 34/55
7/27/2019 How to Implement Bus. Scenarios for Customer Loyalty Mgmt
http://slidepdf.com/reader/full/how-to-implement-bus-scenarios-for-customer-loyalty-mgmt 35/55
7/27/2019 How to Implement Bus. Scenarios for Customer Loyalty Mgmt
http://slidepdf.com/reader/full/how-to-implement-bus-scenarios-for-customer-loyalty-mgmt 36/55
7/27/2019 How to Implement Bus. Scenarios for Customer Loyalty Mgmt
http://slidepdf.com/reader/full/how-to-implement-bus-scenarios-for-customer-loyalty-mgmt 37/55
7/27/2019 How to Implement Bus. Scenarios for Customer Loyalty Mgmt
http://slidepdf.com/reader/full/how-to-implement-bus-scenarios-for-customer-loyalty-mgmt 38/55
7/27/2019 How to Implement Bus. Scenarios for Customer Loyalty Mgmt
http://slidepdf.com/reader/full/how-to-implement-bus-scenarios-for-customer-loyalty-mgmt 39/55
HOW TO… IMPLEMENT BUSINESS SCENARIOS FOR CUSTOMER LOYALTY MANAGEMENT
©2004 SAP AMERICA, INC. ANDSAP AG 38
i f not i _crmcamptyp_char i s i ni t i al and
i _cr mcamptyp_f l ag eq rs_c_f al se.
* Campai gn Type I nfoObj ect not f ound as navi gat i onal att r i bute
rai se crmcamptyp_er ror.
endif .
i f not i _bpart ner_char i s i ni ti al and
i _bpart ner_f l ag eq rs_c_f al se.
* Busi ness Part ner I nf oObj ect not f ound as navi gat i onal att r i but e
rai se bpartner_err or.
endi f .
i f not i _crm_prod_char i s i ni t i al and
i _crm_prod_f l ag eq rs_ c_f al se.
* CRM Product I nf oObj ect not f ound as navi gat i onal att r i but e
rai se cr m_prod_err or.
endi f .
i f i _bonusamount _f l ag eq r s_c_f al se.
* Bonusamount I nfoObj ect not f ound as navi gat i onal att r i but e
rai se bonusamount_err or.
endi f .
i f i _bonusquant i ty_f l ag eq rs_c_f al se.
* Bonusquant i ty I nfoObj ect not f ound as navi gat i onal att ri bute
rai se bonusquant i t y_err or.
endi f .
i f not i _l ayoutf l ag_keyf i s i ni ti al and
i _l ayoutf l ag_f l ag eq rs_c_fal se.
* Layout f l ag I nf oObj ect not f ound as navi gati onal att r i bute
rai se l ayoutf l ag_error.
endi f .
* f i l l tabl e wi th the I nf oObj ects f or the characteri sti cs
w_sf c- chanm= i _cr m_mktel m_char .
append w_sf c to l _t _sf c.
w_sfc- chanm= i _start _nav.
append w_sf c to l _t _sf c.
w_sf c- chanm= i _end_nav.
append w_sf c to l _t _sf c.
i f i _bpart ner_f l ag eq rs_c_t rue.
w_sf c- chanm= i _bpart ner_char.
append w_sf c t o l _t _sf c.endi f .
i f i _crm_prod_f l ag eq rs_c_t rue.
w_sf c- chanm= i _cr m_prod_char.
append w_sf c t o l _t _sf c.
endi f .
cl ear w_r ange.
w_r ange- chanm= i _st art _nav.
w_range- si gn = ' I ' .
w_r ange- compop = ' LE' .
7/27/2019 How to Implement Bus. Scenarios for Customer Loyalty Mgmt
http://slidepdf.com/reader/full/how-to-implement-bus-scenarios-for-customer-loyalty-mgmt 40/55
7/27/2019 How to Implement Bus. Scenarios for Customer Loyalty Mgmt
http://slidepdf.com/reader/full/how-to-implement-bus-scenarios-for-customer-loyalty-mgmt 41/55
HOW TO… IMPLEMENT BUSINESS SCENARIOS FOR CUSTOMER LOYALTY MANAGEMENT
©2004 SAP AMERICA, INC. ANDSAP AG 40
* I _TABLENAME =
* I _SAVE_I N_FI LE = ' '
* I _FI LENAME =
* I _AUTHORI TY_CHECK = RSDRC_C_AUTHCHK- READ
* I _CURRENCY_CONVERSI ON = RS_C_TRUE
* I _S_RFCMODE =
* I _MAXROWS = 0
* I _USE_DB_AGGREGATI ON = RS_C_TRUE
* I _USE_AGGREGATES = RS_C_TRUE
I _ROLLUP_ONLY = c_rol l up_onl y
* I _READ_ODS_DELTA = RS_C_FALSE
I _RESULTTYPE = c_r esul t t ype
* I _DEBUG = RS_C_FALSE
I MPORTI NG
E_END_OF_DATA = l _end_of _data
* E_AGGREGATE =
* E_RFCDATA_UC =
* E_SPL I T_OCCURRED =
TABLES
I _T_SFC = l _t_sf c
I _T_SFK = l _t_sfk
I _T_RANGE = l _t _r ange
I _T_TABLESEL = l _t _t abl esel
* I _T_RTI ME =
* I _T_REQUI D =
* E_T_RFCDATA =
E_T_RFCDATAV = l _t _r f cdatav
* E_T_FI ELD =
EXCEPTI ONS
I LLEGAL_I NPUT = 1
I LLEGAL_I NPUT_SFC =2
I LLEGAL_I NPUT_SFK = 3
I LLEGAL_I NPUT_RANGE = 4
I LLEGAL_I NPUT_TABLESEL =5
NO_AUTHORI ZATI ON = 6
NCUM_NOT_SUPPORTED = 7
GENERATI ON_ERROR = 8
I LLEGAL_DOWNLOAD = 9I LLEGAL_TABLENAME = 10
I LLEGAL_RESULTTYPE = 11
TRANS_NO_WRI TE_MODE = 12
X_MESSAGE = 13
DATA_OVERFLOW = 14
OTHERS =15.
i f sy- subrc ne 0.
rai se read_i nf ocube_err or.
endi f .
l oop at l _t _r f cdatav i nto w_r f cdatav.
7/27/2019 How to Implement Bus. Scenarios for Customer Loyalty Mgmt
http://slidepdf.com/reader/full/how-to-implement-bus-scenarios-for-customer-loyalty-mgmt 42/55
7/27/2019 How to Implement Bus. Scenarios for Customer Loyalty Mgmt
http://slidepdf.com/reader/full/how-to-implement-bus-scenarios-for-customer-loyalty-mgmt 43/55
HOW TO… IMPLEMENT BUSINESS SCENARIOS FOR CUSTOMER LOYALTY MANAGEMENT
©2004 SAP AMERICA, INC. ANDSAP AG 42
ENDFUNCTI ON.
7/27/2019 How to Implement Bus. Scenarios for Customer Loyalty Mgmt
http://slidepdf.com/reader/full/how-to-implement-bus-scenarios-for-customer-loyalty-mgmt 44/55
HOW TO… IMPLEMENT BUSINESS SCENARIOS FOR CUSTOMER LOYALTY MANAGEMENT
©2004 SAP AMERICA, INC. ANDSAP AG 43
Update Rules (1): Start Routine
ROGRAM UPDATE_ROUTI NE.*$*$ begi n of gl obal - i nsert your decl arat i on onl y bel owt hi s l i ne *- *
types: begi n of t y_crm_prod_mater i al ,
cr m_pr od type / BI 0/ OI CRM_PROD,
mater i al t ype / BI 0/OI MATERI AL,
end of ty_crm_prod_mater i al .
dat a: l _cr m_prod_mater i al t ype t y_crm_prod_mater i al .
dat a: l _t _cr m_prod_mater i al t ype sort ed t abl e of t y_crm_prod_mater i al
wi th uni que key mater i al .
data: i _mi n_val ue t ype dats val ue ' 99993112' .
dat a: i _max_val ue type dats val ue ' 00000000' .
data: l _t _poi nt_scheme type zl om_t _poi nt_scheme.
dat a: w_poi nt_ scheme t ype zl om_s_poi nt_scheme.
dat a: l om_i nfocube type rsi nfocube val ue ' ZCRMLOM' .
dat a: i _cr m_mktel m_char t ype rsi obj nmval ue ' 0CRM_MKTELM' .
data: i _st art _char type rs i obj nmval ue ' 0CRM_PLFR' .
dat a: i _end_char t ype rsi obj nmval ue ' 0CRM_PLTO' .
dat a: i _bpart ner_char t ype rsi obj nmval ue ' 0BPARTNER' .
dat a: i _cr m_prod_char t ype rsi obj nmval ue ' 0CRM_PROD' .
data: i _bonusamount_keyf type rsi obj nmval ue ' ZBONUSA' .
dat a: i _bonusquant i ty_keyf t ype rsi obj nmval ue ' ZBONUSP' .
data: i _l ayout f l ag_keyf t ype rsi obj nmval ue ' 0KEYFG_FLAG' .
data: i _no_rul es t ype i .
data: i _t mp t ype i .
*$*$ end of gl obal - i nsert your decl arat i on onl y before t hi s l i ne *- *
* The fol l ow def i ni ti on i s new i n the BW3. x
TYPES:
BEGI N OF DATA_PACKAGE_STRUCTURE.
I NCLUDE STRUCTURE / BI C/ CS80LOM_DS12. TYPES:
RECNO LI KE sy- t abi x,
END OF DATA_PACKAGE_STRUCTURE.
DATA:
DATA_PACKAGE TYPE STANDARD TABLE OF DATA_PACKAGE_STRUCTURE
WI TH HEADER LI NE
WI TH NON- UNI QUE DEFAULT KEY I NI TI AL SI ZE 0.
FORM st art up
TABLES MONI TOR STRUCTURE RSMONI TOR " user def i ned moni tori ng
7/27/2019 How to Implement Bus. Scenarios for Customer Loyalty Mgmt
http://slidepdf.com/reader/full/how-to-implement-bus-scenarios-for-customer-loyalty-mgmt 45/55
7/27/2019 How to Implement Bus. Scenarios for Customer Loyalty Mgmt
http://slidepdf.com/reader/full/how-to-implement-bus-scenarios-for-customer-loyalty-mgmt 46/55
HOW TO… IMPLEMENT BUSINESS SCENARIOS FOR CUSTOMER LOYALTY MANAGEMENT
©2004 SAP AMERICA, INC. ANDSAP AG 45
EXCEPTI ONS
I NFOCUBE_ERROR = 1
CRM_MKTELM_ERROR = 2
START_ERROR = 3
END_ERROR = 4
CRMCAMPTYP_ERROR = 5
CRMVERSI ON_ERROR = 6
BPARTNER_ERROR = 7
CRM_PROD_ERROR = 8
BONUSAMOUNT_ERROR = 9
BONUSQUANTI TY_ERROR = 10
LAYOUTFLAG_ERROR = 11
READ_I NFOCUBE_ERROR = 12
OTHERS = 13.
I F SY-SUBRC <> 0.
* i f abort i s not equal zero, the update process wi l l be cancel ed
ABORT = 1.
ENDI F.
descr i be tabl e l _t _poi nt_scheme l i nes i _no_r ul es.
l oop at DATA_PACKAGE.
i _t mp = i _no_r ul es.
whi l e i _t mp gt 1.
i nser t DATA_PACKAGE.
i _t mp = i _t mp - 1.
endwhi l e.
endl oop.
*$*$ end of rout i ne - i nser t your code onl y before thi s l i ne *- *
*
ENDFORM.
7/27/2019 How to Implement Bus. Scenarios for Customer Loyalty Mgmt
http://slidepdf.com/reader/full/how-to-implement-bus-scenarios-for-customer-loyalty-mgmt 47/55
HOW TO… IMPLEMENT BUSINESS SCENARIOS FOR CUSTOMER LOYALTY MANAGEMENT
©2004 SAP AMERICA, INC. ANDSAP AG 46
Update Rules (2): Update Routine for ZLOMPTD “Loyalty Points”
PROGRAM UPDATE_ROUTI NE.*$*$ begi n of gl obal - i nsert your decl arat i on onl y bel owt hi s l i ne *- *
types: begi n of t y_crm_prod_mater i al ,
cr m_pr od type / BI 0/ OI CRM_PROD,
mater i al t ype / BI 0/OI MATERI AL,
end of ty_crm_prod_mater i al .
dat a: l _cr m_prod_mater i al t ype t y_crm_prod_mater i al .
dat a: l _t _cr m_prod_mater i al t ype sort ed t abl e of t y_crm_prod_mater i al
wi th uni que key mater i al .
data: i _mi n_val ue t ype dats val ue ' 99993112' .
data: i _max_val ue type dats val ue ' 00000000' .
data: l _t _poi nt_scheme type zl om_t _poi nt_scheme.
dat a: w_poi nt_ scheme t ype zl om_s_poi nt_scheme.
dat a: l om_i nfocube type rsi nfocube val ue ' ZCRMLOM' .
dat a: i _cr m_mktel m_char t ype rsi obj nmval ue ' 0CRM_MKTELM' .
data: i _st art _char t ype rsi obj nmval ue ' 0CRM_PLFR' .
dat a: i _end_char t ype rsi obj nmval ue ' 0CRM_PLTO' .
dat a: i _bpart ner_char t ype rsi obj nmval ue ' 0BPARTNER' .
dat a: i _cr m_prod_char t ype rsi obj nmval ue ' 0CRM_PROD' .
dat a: i _bonusamount_keyf t ype rsi obj nmval ue ' ZBONUSA' .
dat a: i _bonusquant i ty_keyf type r si obj nmval ue ' ZBONUSP' .
data: i _l ayout f l ag_keyf t ype rsi obj nmval ue ' 0KEYFG_FLAG' .
data: i _no_rul es t ype i .
data: i _t mp t ype i .
*$*$ end of gl obal - i nsert your decl arati on onl y bef ore thi s l i ne *- *
FORM comput e_dat a_f i el d
TABLES MONI TOR STRUCTURE RSMONI TOR " user def i ned moni tori ng
USI NG COMM_STRUCTURE LI KE / BI C/CS80LOM_DS12RECORD_NO LI KE SY- TABI X
RECORD_ALL LI KE SY-TABI X
SOURCE_SYSTEM LI KE RSUPDSI MULH-LOGSYS
CHANGI NG RESULT LI KE / BI C/ VZLOMPTST- / BIC/ ZLOMPTD
RETURNCODE LI KE SY-SUBRC
ABORT LI KE SY- SUBRC. "set ABORT <> 0 to cancel update
*
*$*$ begi n of routi ne - i nsert your code onl y bel ow t hi s l i ne *- *
* f i l l the i nternal tabl e "MONI TOR", to make moni t or ent ri es
7/27/2019 How to Implement Bus. Scenarios for Customer Loyalty Mgmt
http://slidepdf.com/reader/full/how-to-implement-bus-scenarios-for-customer-loyalty-mgmt 48/55
HOW TO… IMPLEMENT BUSINESS SCENARIOS FOR CUSTOMER LOYALTY MANAGEMENT
©2004 SAP AMERICA, INC. ANDSAP AG 47
RESULT = 0.
RETURNCODE = 0.
i f i _no_rul es eq 0.
* i f t he returncode i s not equal zero, t he resul t wi l l not be updated
RETURNCODE = 1.
el se.
* r esul t val ue of the routi ne
i _t mp = RECORD_NO mod i _no_r ul es.
i _t mp = i _t mp + 1.
cl ear w_poi nt_scheme.
* at t he moment no expl i ci t t reatment of di f f erent curr enci es
read tabl e l _t _poi nt_scheme i nto w_poi nt_scheme i ndex i _t mp.
i f w_poi nt_scheme-st art _date l e COMM_STRUCTURE- cal day and
w_poi nt_scheme- end_date ge COMM_STRUCTURE-cal day and
w_poi nt_scheme-bpart ner i s i ni t i al .
* at t he moment no campai gns wi th speci f i c st ores
* al so a more el aborate t reatment woul d excl ude speci f i c products
* because they are not el egi bl e for l oyal t y poi nt s
i f w_poi nt_ scheme- crm_prod i s i ni ti al .
* rul e appl i es t o al l products
RESULT = COMM_STRUCTURE- r t _sal resa * w_poi nt_scheme- quanti t y
+ COMM_STRUCTURE- r t _possal * w_poi nt_scheme- amount .
el se.
* rul e appl i es to a speci f i c CRM Product, so check i f the Materi al
* corresponds to the CRM Product
read tabl e l _t _crm_prod_materi al i nto l _crm_prod_materi al
wi t h key materi al = COMM_STRUCTURE- materi al .
i f sy- subrc = 0.
* CRM Product f ound, so now check i f the rul e appl i es:
i f l _cr m_prod_mater i al - crm_prod = w_poi nt_scheme-crm_prod.
RESULT = COMM_STRUCTURE-rt _sal resa * w_poi nt_scheme- quanti t y
+ COMM_STRUCTURE-r t _possal * w_poi nt_scheme- amount .
el se.
RETURNCODE = 1.
endi f .
el se.
RETURNCODE = 1.
endi f .endi f .
el se.
RETURNCODE = 1.
endi f .
endi f .
* i f abort i s not equal zero, the update process wi l l be cancel ed
ABORT = 0.
*$*$ end of rout i ne - i nsert your code onl y bef ore thi s l i ne *- *
*
7/27/2019 How to Implement Bus. Scenarios for Customer Loyalty Mgmt
http://slidepdf.com/reader/full/how-to-implement-bus-scenarios-for-customer-loyalty-mgmt 49/55
7/27/2019 How to Implement Bus. Scenarios for Customer Loyalty Mgmt
http://slidepdf.com/reader/full/how-to-implement-bus-scenarios-for-customer-loyalty-mgmt 50/55
HOW TO… IMPLEMENT BUSINESS SCENARIOS FOR CUSTOMER LOYALTY MANAGEMENT
©2004 SAP AMERICA, INC. ANDSAP AG 49
* f i l l t he i nt ernal tabl e "MONI TOR", t o make moni tor ent ri es
RESULT = 0.
RETURNCODE = 0.
i f i _no_rul es eq 0.
* i f the returncode i s not equal zero, t he resul t wi l l not be updated
RETURNCODE = 1.
el se.
* r esul t val ue of the routi ne
i _t mp = RECORD_NO mod i _no_r ul es.
i _t mp = i _t mp + 1.
cl ear w_poi nt_scheme.
* at t he moment no expl i ci t t reatment of di f f erent curr enci es
read tabl e l _t _poi nt_scheme i nto w_poi nt_scheme i ndex i _t mp.
i f w_poi nt_scheme-st art _date l e COMM_STRUCTURE- cal day and
w_poi nt_scheme- end_date ge COMM_STRUCTURE-cal day and
w_poi nt_scheme-bpart ner i s i ni t i al .
* at t he moment no campai gns wi th speci f i c st ores
* al so a more el aborate t reatment woul d excl ude speci f i c products
* because they are not el egi bl e for l oyal t y poi nt s
i f w_poi nt_ scheme- crm_prod i s i ni ti al .
* rul e appl i es t o al l products
RESULT =COMM_STRUCTURE- r t _possal .
el se.
* rul e appl i es t o a speci f i c CRM Product, so check i f the Materi al
* corresponds to the CRM Product
read tabl e l _t _crm_prod_materi al i nto l _crm_prod_materi al
wi t h key materi al = COMM_STRUCTURE- materi al .
i f sy- subrc = 0.
* CRM Product f ound, so now check i f the rul e appl i es:
i f l _cr m_prod_mater i al - crm_prod = w_poi nt_scheme-crm_prod.
RESULT = COMM_STRUCTURE-r t _possal .
el se.
RETURNCODE = 1.
endi f .
el se.
RETURNCODE = 1.
endi f .endi f .
el se.
RETURNCODE = 1.
endi f .
endi f .
* i f abort i s not equal zero, the update process wi l l be cancel ed
ABORT = 0.
*$*$ end of rout i ne - i nser t your code onl y before thi s l i ne *- *
7/27/2019 How to Implement Bus. Scenarios for Customer Loyalty Mgmt
http://slidepdf.com/reader/full/how-to-implement-bus-scenarios-for-customer-loyalty-mgmt 51/55
HOW TO… IMPLEMENT BUSINESS SCENARIOS FOR CUSTOMER LOYALTY MANAGEMENT
©2004 SAP AMERICA, INC. ANDSAP AG 50
*
ENDFORM.
Update Rules (4): Update routine for 0RT_SALRESA “Quantity in Sales Unit
(POS Rcpt)”
(This routine is only necessary for verification and demonstration)
PROGRAM UPDATE_ROUTI NE.
*$*$ begi n of gl obal - i nsert your decl arat i on onl y bel ow thi s l i ne *- *
types: begi n of t y_crm_prod_mater i al ,
cr m_pr od type / BI 0/ OI CRM_PROD,
mater i al t ype / BI 0/OI MATERI AL,
end of ty_crm_prod_mater i al .
dat a: l _cr m_prod_mater i al t ype t y_crm_prod_mater i al .
dat a: l _t _cr m_prod_mater i al t ype sort ed tabl e of t y_crm_prod_mater i al
wi th uni que key mater i al .
data: i _mi n_val ue t ype dats val ue ' 99993112' .
data: i _max_val ue type dats val ue ' 00000000' .
data: l _t _poi nt_scheme type zl om_t _poi nt_scheme.
dat a: w_poi nt_ scheme t ype zl om_s_poi nt_scheme.
data: l om_i nfocube t ype r si nfocube val ue ' ZCRMLOM' .
dat a: i _cr m_mktel m_char t ype rsi obj nmval ue ' 0CRM_MKTELM' .
data: i _st art _char type rs i obj nmval ue ' 0CRM_PLFR' .
dat a: i _end_char t ype rsi obj nmval ue ' 0CRM_PLTO' .
data: i _bpart ner_char type rsi obj nmval ue ' 0BPARTNER' .
dat a: i _cr m_prod_char t ype rsi obj nmval ue ' 0CRM_PROD' .
dat a: i _bonusamount_keyf t ype rsi obj nmval ue ' ZBONUSA' .
dat a: i _bonusquant i ty_keyf t ype rsi obj nmval ue ' ZBONUSP' .
data: i _l ayout f l ag_keyf type rs i obj nmval ue ' 0KEYFG_FLAG' .
data: i _no_rul es t ype i .
data: i _t mp t ype i .
*$*$ end of gl obal - i nsert your decl arati on onl y bef ore thi s l i ne *- *
FORM comput e_dat a_f i el d
TABLES MONI TOR STRUCTURE RSMONI TOR " user def i ned moni tori ng
USI NG COMM_STRUCTURE LI KE / BI C/CS80LOM_DS12
RECORD_NO LI KE SY- TABI X
RECORD_ALL LI KE SY-TABI X
SOURCE_SYSTEM LI KE RSUPDSI MULH-LOGSYS
CHANGI NG RESULT LI KE / BI C/VZLOMPTST- RT_SALRESA
RETURNCODE LI KE SY-SUBRC
7/27/2019 How to Implement Bus. Scenarios for Customer Loyalty Mgmt
http://slidepdf.com/reader/full/how-to-implement-bus-scenarios-for-customer-loyalty-mgmt 52/55
7/27/2019 How to Implement Bus. Scenarios for Customer Loyalty Mgmt
http://slidepdf.com/reader/full/how-to-implement-bus-scenarios-for-customer-loyalty-mgmt 53/55
HOW TO… IMPLEMENT BUSINESS SCENARIOS FOR CUSTOMER LOYALTY MANAGEMENT
©2004 SAP AMERICA, INC. ANDSAP AG 52
*$*$ end of routi ne - i nser t your code onl y before thi s l i ne *- *
*
ENDFORM.
Update Rules (5): Update Routine for the Business Partner
This routine computes the Business Partner from the Card Id. The same methods is applies in
“Customer Loyalty Marketing”
PROGRAM UPDATE_ROUTI NE.
*$*$ begi n of gl obal - i nsert your decl arat i on onl y bel ow thi s l i ne *- *
types: begi n of t y_crm_prod_mater i al ,
cr m_pr od type / BI 0/ OI CRM_PROD,
mater i al t ype / BI 0/OI MATERI AL,
end of ty_crm_prod_mater i al .
dat a: l _cr m_prod_mater i al t ype t y_crm_prod_mater i al .
data: l _t _cr m_prod_mater i al t ype sort ed tabl e of t y_crm_prod_mater i al
wi th uni que key mater i al .
data: i _mi n_val ue t ype dats val ue ' 99993112' .
data: i _max_val ue type dats val ue ' 00000000' .
data: l _t _poi nt_scheme type zl om_t _poi nt_scheme.
dat a: w_poi nt_scheme t ype zl om_s_poi nt_scheme.
dat a: l om_i nfocube type rsi nfocube val ue ' ZCRMLOM' .
dat a: i _cr m_mktel m_char t ype rsi obj nmval ue ' 0CRM_MKTELM' .
data: i _st art _char type rs i obj nmval ue ' 0CRM_PLFR' .
dat a: i _end_char t ype rsi obj nmval ue ' 0CRM_PLTO' .
data: i _bpart ner_char type r si obj nmval ue ' 0BPARTNER' .
dat a: i _cr m_prod_char t ype rsi obj nmval ue ' 0CRM_PROD' .
dat a: i _bonusamount_keyf t ype rsi obj nmval ue ' ZBONUSA' .
dat a: i _bonusquant i ty_keyf t ype rsi obj nmval ue ' ZBONUSP' .
data: i _l ayout f l ag_keyf t ype r si obj nmval ue ' 0KEYFG_FLAG' .
data: i _no_rul es t ype i .
data: i _t mp t ype i .
*$*$ end of gl obal - i nsert your decl arati on onl y bef ore thi s l i ne *- *
FORM comput e_key_f i el d
TABLES MONI TOR STRUCTURE RSMONI TOR " user def i ned moni tori ng
USING COMM_STRUCTURE LI KE / BI C/CS80LOM_DS12
RECORD_NO LI KE SY- TABI X
RECORD_ALL LI KE SY-TABI X
SOURCE_SYSTEM LI KE RSUPDSI MULH-LOGSYS
CHANGI NG RESULT LI KE / BI C/VZLOMPTST- BPARTNER
RETURNCODE LI KE SY-SUBRC
ABORT LI KE SY- SUBRC. "set ABORT <> 0 to cancel update
*
7/27/2019 How to Implement Bus. Scenarios for Customer Loyalty Mgmt
http://slidepdf.com/reader/full/how-to-implement-bus-scenarios-for-customer-loyalty-mgmt 54/55
HOW TO… IMPLEMENT BUSINESS SCENARIOS FOR CUSTOMER LOYALTY MANAGEMENT
©2004 SAP AMERICA, INC. ANDSAP AG 53
*$*$ begi n of routi ne - i nsert your code onl y bel ow t hi s l i ne *- *
* f i l l t he i nt ernal tabl e "MONI TOR", t o make moni tor ent ri es
* r esul t val ue of the routi ne
CALL FUNCTI ON ' RS_BCT_LOM_MAP_BP_ASSI GN'
EXPORTI NG
BP_I D_NUM = COMM_STRUCTURE-BP_I D_NUM
BP_I D_TYPE = COMM_STRUCTURE-BP_I D_TYPE
I MPORTI NG
BPARTNER = RESULT
RCODE = RETURNCODE
ABORT = ABORT.
i f RESULT i s i ni ti al .
RETURNCODE = 1.
endi f .
*$*$ end of routi ne - i nser t your code onl y before thi s l i ne *- *
*
ENDFORM.
Updat e Rul es f or 0CRM_MKTELM “CRM Market i ng El ement ”
( Thi s r out i ne i s f or t he assi gnment of campai gns t o l oyal t y poi nt s) :
PROGRAM UPDATE_ROUTI NE.
*$*$ begi n of gl obal - i nsert your decl arati on onl y bel ow thi s l i ne *- *
types: begi n of t y_crm_prod_mater i al ,
cr m_pr od type / BI 0/ OI CRM_PROD,
mater i al t ype / BI 0/OI MATERI AL,
end of ty_crm_prod_mater i al .
dat a: l _cr m_prod_mater i al t ype t y_crm_prod_mater i al .
data: l _t _cr m_prod_mater i al t ype sort ed t abl e of t y_crm_prod_mater i al
wi th uni que key mater i al .
data: i _mi n_val ue t ype dats val ue ' 99993112' .
data: i _max_val ue type dats val ue ' 00000000' .
data: l _t _poi nt_scheme type zl om_t _poi nt_scheme.
data: w_poi nt_scheme t ype zl om_s_poi nt_scheme.
dat a: l om_i nfocube type rsi nfocube val ue ' ZCRMLOM' .
dat a: i _cr m_mktel m_char t ype rsi obj nmval ue ' 0CRM_MKTELM' .
data: i _st art _char type rs i obj nmval ue ' 0CRM_PLFR' .
dat a: i _end_char t ype rsi obj nmval ue ' 0CRM_PLTO' .
dat a: i _bpart ner_char t ype rsi obj nmval ue ' 0BPARTNER' .
dat a: i _cr m_prod_char t ype rsi obj nmval ue ' 0CRM_PROD' .
dat a: i _bonusamount_keyf t ype rsi obj nmval ue ' ZBONUSA' .
dat a: i _bonusquant i ty_keyf t ype rsi obj nmval ue ' ZBONUSP' .
data: i _l ayout f l ag_keyf type rs i obj nmval ue ' 0KEYFG_FLAG' .
7/27/2019 How to Implement Bus. Scenarios for Customer Loyalty Mgmt
http://slidepdf.com/reader/full/how-to-implement-bus-scenarios-for-customer-loyalty-mgmt 55/55
HOW TO… IMPLEMENT BUSINESS SCENARIOS FOR CUSTOMER LOYALTY MANAGEMENT
data: i _no_rul es t ype i .
data: i _t mp t ype i .
*$*$ end of gl obal - i nsert your decl arati on onl y bef ore thi s l i ne *- *
FORM comput e_key_f i el d
TABLES MONI TOR STRUCTURE RSMONI TOR " user def i ned moni tori ng
USI NG COMM_STRUCTURE LI KE / BI C/CS80LOM_DS12
RECORD_NO LI KE SY- TABI X
RECORD_ALL LI KE SY-TABI X
SOURCE_SYSTEM LI KE RSUPDSI MULH-LOGSYS
CHANGI NG RESULT LI KE / BI C/VZLOMPTST- CRM_MKTELM
RETURNCODE LI KE SY-SUBRC
ABORT LI KE SY- SUBRC. "set ABORT <> 0 to cancel update
*
*$*$ begi n of routi ne - i nsert your code onl y bel ow t hi s l i ne *- *
* f i l l t he i nt ernal tabl e "MONI TOR", t o make moni tor ent ri es
i f i _no_rul es eq 0.
* i f t he returncode i s not equal zero, the resul t wi l l not be updat ed
RETURNCODE = 1.
el se.
i _t mp = RECORD_NO mod i _no_r ul es.
i _t mp = i _t mp + 1.
cl ear w_poi nt_scheme.
read tabl e l _t _poi nt_scheme i nto w_poi nt_scheme i ndex i _t mp.
* r esul t val ue of the routi ne
RESULT = w_poi nt_scheme- cr m_mkt el m.
endi f .
* i f abort i s not equal zero, the update process wi l l be cancel ed
ABORT = 0.
*$*$ end of rout i ne - i nser t your code onl y before thi s l i ne *- *
*
ENDFORM.
top related