CL_CRM_MKTPL_EAI_CHANGE_TPM - EAI: Change TPM

SUBST_MERGE_LIST - merge external lists to one complete list with #if... logic for R3up   TXBHW - Original Tax Base Amount in Local Currency  
This documentation is copyright by SAP AG.

>>> Development Documentation generated by DocuGenerator v2.0 (only available in English => NO TRANSLATION!!!) <<<

General Class Description

EAI: Change TPM

__________________________________________________________

Class Info

Name:CL_CRM_MKTPL_EAI_CHANGE_TPM
Instantiation:Public

Superclass

CL_CRM_MKTPL_EAI_CHANGE

Implemented Interfaces

None

Friend Classes

None

Subclasses

None

__________________________________________________________

Methods

BUILD_CAUSAL_LISTS

Private BUILD_CAUSAL_LISTS(

IMPORTINGABAP_BOOL IV_COMPLETE_TRANS_IND_PROD
ABAP_BOOL IV_COMPLETE_TRANS_IND_PGRP
ABAP_BOOL IV_COMPLETE_TRANS_IND_PCAT
CRMT_MKTPL_EAI_TPM_CHG_CAUS_E IT_EAI_CAUSALSX
CRMT_MKTPL_CAU IT_EAI_CAUSALS
EXPORTINGCRMT_MKTPL_CAU ET_CAUS_CHANGE
CRMT_MKTPL_CAU ET_CAUS_CREATE
CRMT_MKTPL_CAU ET_CAUS_DELETE

)

Build the list of causals to add, change and delete:
- Based on the complete transmission indicators and of the product dimension, determine
if causals need to be deleted
- Based on action codes, determine if causals need to be deleted, created or changed

Parameters

- IV_COMPLETE_TRANS_IND_PRODIndicator for Causals on products
 If set to True, delete the causals not included in
 IT_EAI_CAUSALS from the current list of causals
- IV_COMPLETE_TRANS_IND_PGRPIndicator for Causals on product groups
 If set to True, delete the causals not included in
 IT_EAI_CAUSALS from the current list of causals
- IV_COMPLETE_TRANS_IND_PCATIndicator for Causals on product categories
 If set to True, delete the causals not included in
 IT_EAI_CAUSALS from the current list of causals
- IT_EAI_CAUSALSXParallel structure, indicates which values to change for
 each causal
- IT_EAI_CAUSALSTPM list of values, contains the new values for causals
- ET_CAUS_CHANGEList of causals to change
- ET_CAUS_CREATEList of causals to create
- ET_CAUS_DELETEList of causals to delete

Exceptions

- CX_CRM_MKTPL_EAI_FAILEDFailed to change the list of causals
 Resumable exception is raised to continue processing back into this method
 The expected result is to continue the processing of the causal list

________________________________________________________________________

BUILD_CAUSAL_TRADE_SPEND_LISTS

Private BUILD_CAUSAL_TRADE_SPEND_LISTS(

IMPORTINGABAP_BOOL IV_COMPLETE_TRANS_IND_PROD
ABAP_BOOL IV_COMPLETE_TRANS_IND_PGRP
ABAP_BOOL IV_COMPLETE_TRANS_IND_PCAT
CRMT_MKTPL_EAI_TPM_CHG_CAUT_E IT_EAI_CAUSAL_TR_SPENDSX
CRMT_MKTPL_EAI_CAU_TSP IT_EAI_CAUSAL_TR_SPENDS
EXPORTINGCRMT_MKTPL_TSP ET_CAUT_CREATE
CRMT_MKTPL_TSP ET_CAUT_DELETE

)

Build the list of causal trade spends to add and delete:
- Based on the complete transmission indicator, determine if causal trade spends need
to be deleted. For causal trade spend, if these flag is not set to True, there will
be an error. There is one complete transmission indicator per product dimension.
- Based on action codes, determine if causal trade spends need to be deleted or created
Challenge: For Causal Trade Spends, it is NOT possible to uniquely identify a row in
~~~~~~~~~~ the assignment block.
Solution: For causal trade spends, the complete transmission indicator must always be
~~~~~~~~~ set to True. This will automatically delete all the existing causal trade spends
assigned to the specified causals (since external applications cannot send the
causal GUIDs, this method retrieves the causal GUIDs by using the product
dimensions specified in the importing parameters).
For causal trade spends, a change of an existing entry cannot be performed because
the system cannot identify which causal trade spend to change. That is why we
delete all causal trade spends (only for specified causals) and create them
all again.
This method generates lists of causal trade spends to add and to delete.
Example: Original Promotion
~~~~~~~~ - 2 Trade Spends
- Prod_1 -> Causal_1 -> Causal Trade Spend A
-> Causal Trade Spend B
Prod_2 -> Causal_2 -> Causal Trade Spend C
-> Causal Trade Spend D
Payload/Message sent by the external application
- Complete Transmission Indicator for Prod = True (otherwise error)
- Prod_1 -> Causal_1 -> Causal Trade Spend X
-> Causal Trade Spend B
Exporting parameter
- For Prod_1 and Causal_1, Delete -> Causal Trade Spend A
-> Causal Trade Spend B
- For Prod_1 and Causal_1, Create -> Causal Trade Spend X
-> Causal Trade Spend B
- Note 1: The deletion will be performed before the creation
- Note 2: Causal Trade Spends for Prod_2 and Causal_2 are not touched.

Parameters

- IV_COMPLETE_TRANS_IND_PRODIndicator for Causal trade spends on products
 If set to True, delete the causal trade spends not included
 in IT_EAI_CAUSALS_TR_SPENDS from the current list of causal
 trade spends
- IV_COMPLETE_TRANS_IND_PGRPIndicator for Causal trade spends on product groups
 If set to True, delete the causal trade spends not included
 in IT_EAI_CAUSAL_TR_SPENDS from the current list of causal
 trade spends
- IV_COMPLETE_TRANS_IND_PCATIndicator for Causal trade spends on product categories
 If set to True, delete the causal trade spends not included
 in IT_EAI_CAUSALS_TR_SPENDS from the current list of causal
 trade spends
- IT_EAI_CAUSAL_TR_SPENDSXParallel structure built by the mapping process, it contains
 the action codes, the keys and field names for causal
 trade spends to create/change/delete
- IT_EAI_CAUSAL_TR_SPENDSList of values provided by the external application, it
 contains the keys and values for the causalt trade spends to
 create/delete
- ET_CAUT_CREATEList of causal trade spends to create
- ET_CAUT_DELETEList of causal trade spends to delete

Exceptions

- CX_CRM_MKTPL_EAI_FAILEDFailed to change the list of causal trade spends
 Resumable exception is raised to continue processing back into this method
 The expected result is to continue the processing of the list of causal trade spends

________________________________________________________________________

BUILD_DATE_RANGE_LISTS

Private BUILD_DATE_RANGE_LISTS(

IMPORTINGABAP_BOOL IV_COMPLETE_TRANS_IND
CRMT_MKTPL_EAI_CHG_DATE_E IT_EAI_DATESX
CRMT_MKTPL_EAI_DATES IT_EAI_DATES
EXPORTINGCRMT_MKTPL_DATE_ATTRIBUTES ET_DATE_CHANGE
CRMT_MKTPL_DATE_ATTRIBUTES ET_DATE_DELETE

)

Build the list of date ranges to change and delete:
- Based on the complete transmission indicator, determine if date ranges need
to be deleted
- Based on action codes, determine if date ranges need to be deleted or changed

Parameters

- IV_COMPLETE_TRANS_INDIf set to True, delete the date ranges not included in
 IT_EAI_DATES from the current list of date ranges
- IT_EAI_DATESXParallel structure built by the mapping process, it contains
 the action codes, the keys and field names for date ranges
 to change/delete
- IT_EAI_DATESList of values provided by the external application, it
 contains the keys and values for the date ranges to
 change/delete
- ET_DATE_CHANGEList of date ranges to change
- ET_DATE_DELETEList of date ranges to delete

Exceptions

- CX_CRM_MKTPL_EAI_FAILEDFailed to change the list of date ranges
 Resumable exception is raised to continue processing back into this method
 The expected result is to continue the processing of the list of date ranges

________________________________________________________________________

BUILD_TRADE_SPEND_LISTS

Private BUILD_TRADE_SPEND_LISTS(

IMPORTINGABAP_BOOL IV_COMPLETE_TRANS_IND
CRMT_MKTPL_EAI_TPM_CHG_TRSP_E IT_EAI_TRADE_SPENDSX
CRMT_MKTPL_EAI_TS IT_EAI_TRADE_SPENDS
EXPORTINGCRMT_MKTPL_TS ET_TRSP_DELETE
CRMT_MKTPL_TS ET_TRSP_CHANGE
CRMT_MKTPL_TS ET_TRSP_CREATE

)

Build the list of trade spends to add, change and delete:
- Based on the complete transmission indicator, determine if trade spends need
to be deleted
- Based on action codes, determine if trade spends need to be deleted, created
or changed

Parameters

- IV_COMPLETE_TRANS_INDIf set to True, delete the trade spends not included in
 IT_EAI_TRADE_SPENDS from the current list of trade spends
- IT_EAI_TRADE_SPENDSXParallel structure built by the mapping process, it contains
 the action codes, the keys and field names for trade
 spends to create/change/delete
- IT_EAI_TRADE_SPENDSList of values provided by the external application, it
 contains the keys and values for the trade spends to
 create/change/delete
- ET_TRSP_DELETEList of trade spends to delete
- ET_TRSP_CHANGEList of trade spends to change
- ET_TRSP_CREATEList of trade spends to create

Exceptions

- CX_CRM_MKTPL_EAI_FAILEDFailed to change the list of trade spends
 Resumable exception is raised to continue processing back into this method
 The expected result is to continue the processing of the list of trade spends

________________________________________________________________________

CHANGE_AGREEMENT

Private CHANGE_AGREEMENT(

IMPORTINGCGPL_EXTID IV_AGREEMENT_ID

)

Change the assigned agreement i.e. delete the old agreement then add the new agreement

Parameters

- IV_AGREEMENT_IDNew agreement ID

Exceptions

- CX_CRM_MKTPL_EAI_FAILEDFailed to change the agreement
 Resumable exception is raised to continue processing back into this method

________________________________________________________________________

CHANGE_ATTRIBUTES

Private CHANGE_ATTRIBUTES(

IMPORTINGCRMT_MKTPL_EAI_CHG_FLD IT_EAI_ATTRIBUTESX
CRMS_MKTPL_EAI_HEADER_TPM_ATTR IS_EAI_ATTRIBUTES

)

Perform the changes to the TPM header data

Parameters

- IT_EAI_ATTRIBUTESXParallel structure, indicates which values to change
- IS_EAI_ATTRIBUTESTPM header attributes, contains the new values

Exceptions

- CX_CRM_MKTPL_EAI_FAILEDFailed to change the header attributes
 Resumable exception is raised to continue processing back into this method
 The expected result is to continue the processing of the header attributes

________________________________________________________________________

CHANGE_CAUSALS

Private CHANGE_CAUSALS(

IMPORTINGABAP_BOOL IV_COMPLETE_TRANS_IND_PROD
ABAP_BOOL IV_COMPLETE_TRANS_IND_PGRP
ABAP_BOOL IV_COMPLETE_TRANS_IND_PCAT
CRMT_MKTPL_EAI_TPM_CHG_CAUS_E IT_EAI_CAUSALSX
CRMT_MKTPL_CAU IT_EAI_CAUSALS

)

Perform the changes to the assignment block Causal:
- First, call the method to determine the causals to create/change/delete
- Second, apply the changes to the current list of causals. Causals can be created, changed
and/or deleted

Parameters

- IV_COMPLETE_TRANS_IND_PRODIndicator for Causals on products
 If set to True, delete the causals not included in
 IT_EAI_CAUSALS from the current list of causals
- IV_COMPLETE_TRANS_IND_PGRPIndicator for Causals on product groups
 If set to True, delete the causals not included in
 IT_EAI_CAUSALS from the current list of causals
- IV_COMPLETE_TRANS_IND_PCATIndicator for Causals on product categories
 If set to True, delete the causals not included in
 IT_EAI_CAUSALS from the current list of causals
- IT_EAI_CAUSALSXParallel structure, indicates which values to change for
 each causal
- IT_EAI_CAUSALSTPM list of values, contains the new values for causals

Exceptions

- CX_CRM_MKTPL_EAI_FAILEDFailed to change the list of causals

________________________________________________________________________

CHANGE_CAUSAL_TRADE_SPENDS

Private CHANGE_CAUSAL_TRADE_SPENDS(

IMPORTINGCRMT_MKTPL_EAI_CAU_TSP IT_EAI_CAUSAL_TR_SPENDS
ABAP_BOOL IV_COMPLETE_TRANS_IND_PROD
CRMT_MKTPL_EAI_TPM_CHG_CAUT_E IT_EAI_CAUSAL_TR_SPENDSX
ABAP_BOOL IV_COMPLETE_TRANS_IND_PCAT
ABAP_BOOL IV_COMPLETE_TRANS_IND_PGRP

)

Perform the changes to the assignment block Causal Trade Spends:
- First, call the method to determine the causal trade spends to create/change/delete
- Second, apply the changes to the current list of causal trade spends. Causal trade spends
can be created, changed and/or deleted

Parameters

- IT_EAI_CAUSAL_TR_SPENDSList of values provided by the external application, it
 contains the keys and values for the causal trade spends to
 create/change/delete
- IV_COMPLETE_TRANS_IND_PRODIndicator for Causal trade spends on products
 If set to True, delete the causal trade spends not included
 in IT_EAI_CAUSALS_TR_SPENDS from the current list of causal
 trade spends
- IT_EAI_CAUSAL_TR_SPENDSXParallel structure built by the mapping process, it contains
 the action codes, the keys and field names for causal trade
 spends to create/change/delete
- IV_COMPLETE_TRANS_IND_PCATIndicator for Causal trade spends on product categories
 If set to True, delete the causal trade spends not included
 in IT_EAI_CAUSALS_TR_SPENDS from the current list of causal
 trade spends
- IV_COMPLETE_TRANS_IND_PGRPIndicator for Causal trade spends on product groups
 If set to True, delete the causal trade spends not included
 in IT_EAI_CAUSAL_TR_SPENDS from the current list of causal
 trade spends

Exceptions

- CX_CRM_MKTPL_EAI_FAILEDFailed to change the list of causal trade spends

________________________________________________________________________

CHANGE_DATE_RANGES

Private CHANGE_DATE_RANGES(

IMPORTINGABAP_BOOL IV_COMPLETE_TRANS_IND
CRMT_MKTPL_EAI_CHG_DATE_E IT_EAI_DATESX
CRMT_MKTPL_EAI_DATES IT_EAI_DATES

)

Perform the changes to the assignment block Date Ranges:
- First, call the method to determine the date ranges to change/delete
- Second, apply the changes to the current list of date ranges. Since the date
ranges are all created as empty when the promotion is created, date ranges can only be
changed and/or deleted

Parameters

- IV_COMPLETE_TRANS_INDIf set to True, delete the date ranges not included in
 IT_EAI_DATES from the current list of date ranges
- IT_EAI_DATESXParallel structure built by the mapping process, it contains
 the action codes, the keys and field names for date ranges
 to change/delete
- IT_EAI_DATESList of values provided by the external application, it
 contains the keys and values for the date ranges to
 change/delete

Exceptions

- CX_CRM_MKTPL_EAI_FAILEDFailed to change the list of date ranges

________________________________________________________________________

CHANGE_TRADESPEND_EXCEPTION

Public CHANGE_TRADESPEND_EXCEPTION(

IMPORTINGCGPL_GUID16 IV_TRADE_PROMOTION_GUID
CGPL_GUID16 IV_TRADESPEND_GUID
CRMD_MKTGS_TSPEX IS_TRADESPEND_EXCEPTION

)

This method is responsible for deleting a trade spend exception from the marketing project

Parameters

- IV_TRADE_PROMOTION_GUIDMarketing project guid
- IV_TRADESPEND_GUIDThe Tradespend guid
- IS_TRADESPEND_EXCEPTIONA structure containing the exception to be deleted.

Exceptions

- CX_CRM_MKTPL_EAI_FAILEDFailed to change the specified trade spend exception

________________________________________________________________________

CHANGE_TRADE_PROMOTION

Private CHANGE_TRADE_PROMOTION(

IMPORTINGCRMT_MKTPL_EXTID IV_TPM_EXTERNAL_ID
CRMS_MKTPL_EAI_TPM_CHANGE IS_EAI_TPM_DATAX
CRMS_MKTPL_EAI_TPM IS_EAI_TPM_DATA

)

This method changes a trade promotion based on the requested changes provided by an
external application.
The parallel structure contains the fields names of the fields to change grouped by
assignment block. This method loops at all the assignment blocks of a trade promotion
(only the ones available to the change service) and calls the methods to process the
requested changes.
Note that the header data and the "table like" assignment blocks (like date ranges, products,
trade spends, etc.) are processed differently.

Parameters

- IV_TPM_EXTERNAL_IDExternal ID of the Trade Promotion
- IS_EAI_TPM_DATAXEAI Parallel structure built by the mapping process, it contains
 the field names of the specific fields to change. For "table like"
 assignment blocks, the keys and the action codes are required.
 The action code indicates the action to perform on a row:
 Create, Change or Delete
- IS_EAI_TPM_DATAEAI data structure (values to change per assignment block)

Exceptions

- CX_CRM_MKTPL_EAI_FAILEDThis exception is raised if an error occurs
- CX_CRM_MKTPL_EAI_LOCKUnable to set the promotion to edit mode
 =======================
 Change service glossary
 =======================
 PARALLEL STRUCTURE:
 For the change service, the introduction of a parallel structure is required. This
 structure indicates the field names of all the fields to change.
 Since the parameter IS_EAI_TPM_DATA will contain mostly empty values and since only
 the values to update are provided by the external system, the parallel structure is
 used to identify not only the field names of fields to change from one value to another
 but also the field names if fields to change from any value to empty.
 >> The convention is to use an "X" at the end of a variable name in order to identify
 >> tables/structures/values coming from the parallel structure.
 PARENT ELEMENT (PE):
 (For "table like" assignment blocks.)
 Group together all the elements of a "table like" assignment block.
 Example: An external application might want to add one product and change another product.
 The parent element for products would group together all the changes requested
 for the product assigment block.
 ELEMENT:
 (For "table like" assignment blocks.)
 One row of the parent element.
 Example: To add a product would be stored as one element in the parent element for products.
 This element would contain all the data/values of the product to add.
 To change a product would be another element.
 COMPLETE TRANSMISSION INDICATOR:
 (For "table like" assignment blocks.)
 The complete transmission indicator is at the parent element of the provided data. It can
 be set to True or False (default value).
 - TRUE: The process will treat only the elements listed in parent element.
 All elements not listed in the parent element are going to be deleted from the
 trade promotion.
 - FALSE (Default): The process will treat the elements listed in parent element.
 All elements not listed in the parent element are not touched.
 ACTION CODE:
 (For "table like" assignment blocks.)
 Indicates the action to take when processing the list of elements:
 - 01 Create: Element to create.
 Error if it exists already.
 - 02 Change: Element to change.
 Error if it does not exist.
 - 03 Delete: Element to delete.
 Error if it does not exist.
 - 04 Save: Element to create if it does not exist.
 Element to change if it exists.
 - 05 Remove: Element to delte if it exists.
 Do nothing otherwise.
 - 06 No action: Do nothing. Is mostly used when the complete transmission indicator
 is set to True. An element with action code 06 would not be changed
 nor deleted.

________________________________________________________________________

CHANGE_TRADE_PROMOTION_SRV

Public CHANGE_TRADE_PROMOTION_SRV(

IMPORTINGCRMT_MKTPL_EXTID IV_TPM_EXTERNAL_ID
CRMS_MKTPL_EAI_TPM_CHANGE IS_EAI_TPM_DATAX
CRMS_MKTPL_EAI_TPM IS_EAI_TPM_DATA
EXPORTINGCRMT_MKTPL_EAI_LOG ET_MESSAGE_LOG

)

This method is responsible for changing one trade promotion.

Parameters

- IV_TPM_EXTERNAL_IDExternal ID of the Trade Promotion
- IS_EAI_TPM_DATAXFor the change service, the introduction of a parallel structure is required.
 This structure indicates the field names of all the fields to modify.
 Since the parameter IS_EAI_TPM_DATA will contain mostly empty values because only
 the values to update are provided by the external system, the parallel structure is
 used to identify not only the field names to change from one value to another but
 also the field names to change from any value to empty.
- IS_EAI_TPM_DATAList of values provided by the external application, it
 contains the values of all the changes to perform
 on the trade promotion. For "table like" assignment blocks,
 keys are also required to identify the row to change.
- ET_MESSAGE_LOGTable of messages

________________________________________________________________________

CHANGE_TRADE_SPENDS

Private CHANGE_TRADE_SPENDS(

IMPORTINGABAP_BOOL IV_COMPLETE_TRANS_IND
CRMT_MKTPL_EAI_TPM_CHG_TRSP_E IT_EAI_TRADE_SPENDSX
CRMT_MKTPL_EAI_TS IT_EAI_TRADE_SPENDS

)

Perform the changes to the assignment block Trade Spend:
- First, call the method to determine the trade spends to create/change/delete
- Second, apply the changes to the current list of trade spends. Trade spends
can be created, changed and/or deleted

Parameters

- IV_COMPLETE_TRANS_INDIf set to True, delete the trade spends not included in
 IT_EAI_TRADE_SPENDS from the current list of trade spends
- IT_EAI_TRADE_SPENDSXParallel structure built by the mapping process, it contains
 the action codes, the keys and field names for trade
 spends to create/change/delete
- IT_EAI_TRADE_SPENDSList of values provided by the external application, it
 contains the keys and values for the trade spends to
 create/change/delete

Exceptions

- CX_CRM_MKTPL_EAI_FAILEDFailed to change the list of trade spends

________________________________________________________________________

DELETE_TRADESPEND_EXCEPTION

Public DELETE_TRADESPEND_EXCEPTION(

IMPORTINGCGPL_GUID16 IV_TRADE_PROMOION_GUID
CGPL_GUID16 IV_TRADESPEND_GUID
CRMD_MKTGS_TSPEX IS_TRADESPEND_EXCEPTION

)

This method is responsible for deleting a trade spend exception from the marketing project

Parameters

- IV_TRADE_PROMOION_GUIDMarketing project guid
- IV_TRADESPEND_GUIDThe Tradespend guid
- IS_TRADESPEND_EXCEPTIONA structure containing the exception to be deleted.

Exceptions

- CX_CRM_MKTPL_EAI_FAILEDFailed to delete the specified trade spend exception

________________________________________________________________________

GET_CAUSAL_BY_KEY

Private CL_CRM_MKTPL_TPM_CAU_ITEM GET_CAUSAL_BY_KEY(

IMPORTINGCOMT_PRODUCT_ID IV_PRODUCT_ID
CRM_MKTPL_CAU_PRODUCT_GROUP IV_PRODUCT_GROUP
COMT_CATEGORY_ID IV_PRODUCT_CATEGORY
CRM_MKTPL_CAU_DIMENSION_TYPE IV_DIMENSION_TYPE
CL_CRM_MKTPL_TPM_CAU_COLL IR_CAUSAL_COLL

)

Return the causal item for the provided key

Returns

RR_CAUSAL_ITEM Causal item

Parameters

- IV_PRODUCT_IDTo provide if the Causal to retrieve is for a Product
- IV_PRODUCT_GROUPTo provide if the Causal to retrieve is for a Product Group
- IV_PRODUCT_CATEGORYTo provide if the Causal to retrieve is for a Product Category
- IV_DIMENSION_TYPEIndicates the product dimension type (product, product group or
 product category)
- IR_CAUSAL_COLLCollection of causals

________________________________________________________________________

GET_EAI_ASG_BLOCK_DATA

Private GET_EAI_ASG_BLOCK_DATA(

IMPORTINGABAP_COMPNAME IV_EAI_DATAX_COMP_NAME
CRMS_MKTPL_EAI_TPM_CHANGE IS_EAI_TPM_DATAX
CRMS_MKTPL_EAI_TPM IS_EAI_TPM_DATA
EXPORTINGANY EST_EAI_TPM_DATA
CRMT_BOOLEAN EV_EAI_COMPLETE_TRANS_IND3
CRMT_BOOLEAN EV_EAI_COMPLETE_TRANS_IND2
CRMT_BOOLEAN EV_EAI_COMPLETE_TRANS_IND
STANDARD TABLE ET_EAI_TPM_DATAX

)

Method that returns the EAI data and the EAI parallel structure data for a specific
assignment block.
Importing parameter IS_EAI_TPM_DATAX is a structure in which there is one component per
TPM assignment block. The components of this structure have two possible component types:
- The component type is a TABLE:
The parallel structure component is a list of fields to change for a specific structure
(like for TPM header data). In this case:
- Return the EAI data (new values)from IS_EAI_TPM_DATA-
- Return the list of field names to change listed in IS_EAI_TPM_DATAX-
- The component type is a STRUCTURE:
The parallel structure component is a parent element of a "table like" assignment block
(like date ranges, products, trade spends, etc.). In this case:
- Return the EAI data (list of elements with their new values) from
IS_EAI_TPM_DATA-
- Return the complete transmission indicator(s) of the assignment block from
IS_EAI_TPM_DATAX--COMPLETE_TRANSMISSION_IND
IS_EAI_TPM_DATAX--COMPLETE_TRANSMISSION_IND2
IS_EAI_TPM_DATAX--COMPLETE_TRANSMISSION_IND3
- Return the EAI parallel structure data (list of elements with the file names to
change) from IS_EAI_TPM_DATAX--

Parameters

- IV_EAI_DATAX_COMP_NAMEName of the assigment block for which the EAI data is
 requested
- IS_EAI_TPM_DATAXEAI Parallel structure built by the mapping process, it
 contains the field names of the fields to change.
 For "table like" assignment blocks, the keys and the
 action codes are required. The action code indicates the
 action to perform on a row: Create, Change or Delete
- IS_EAI_TPM_DATAEAI data structure (values to change for all assignment blocks)
- EST_EAI_TPM_DATAEAI data of the assigment block
- EV_EAI_COMPLETE_TRANS_IND3For "table like" assignment blocks only, complete transmission
 indicator
- EV_EAI_COMPLETE_TRANS_IND2For "table like" assignment blocks only, complete transmission
 indicator
- EV_EAI_COMPLETE_TRANS_INDFor "table like" assignment blocks only, complete transmission
 indicator
- ET_EAI_TPM_DATAXEAI parallel structure data of the assignment block

Exceptions

- CX_CRM_MKTPL_EAI_FAILEDFailed to retrieve the assignment block data

________________________________________________________________________

GET_EAI_ASG_BLOCK_TYPES

Private GET_EAI_ASG_BLOCK_TYPES(

IMPORTINGABAP_COMPNAME IV_EAI_DATAX_COMP_NAME
CRMS_MKTPL_EAI_TPM_CHANGE IS_EAI_TPM_DATAX
CRMS_MKTPL_EAI_TPM IS_EAI_TPM_DATA
EXPORTINGSTRING EV_EAI_ASG_BLOCK_TYPEX
STRING EV_EAI_ASG_BLOCK_TYPE
ABAP_COMPNAME EV_EAI_ASG_BLOCK_NAME

)

Method that returns the EAI data type and the EAI parallel structure data type of a specific
assignment block.

Parameters

- IV_EAI_DATAX_COMP_NAMEName of the assigment for which the EAI data types
 are requested
- IS_EAI_TPM_DATAXEAI Parallel structure built by the mapping process, it
 contains the field names of the specific fields to change.
- IS_EAI_TPM_DATAEAI data structure (values to change per assignment block)
- EV_EAI_ASG_BLOCK_TYPEXType of the parallel structure data for the assignment block
- EV_EAI_ASG_BLOCK_TYPEType of the data structure for the assignment block
- EV_EAI_ASG_BLOCK_NAMEName of the assignment block

Exceptions

- CX_CRM_MKTPL_EAI_FAILEDFailed to assign the assignment block data

________________________________________________________________________

GET_TRSP_ATTR_FOR_CAU_TR_SPEND

Private GET_TRSP_ATTR_FOR_CAU_TR_SPEND(

IMPORTINGCRMS_MKTPL_EAI_CAU_TSP_ROW IS_CAUSAL_TRADE_SPEND_ATTR
EXPORTINGCRMS_MKTPL_COST_ATTRIBUTES ES_TRADE_SPEND_ATTR

)

This method gets the trade spend attributes based on the information related
to one causal trade spend

Parameters

- IS_CAUSAL_TRADE_SPEND_ATTRAttributes of a causal trade spend
- ES_TRADE_SPEND_ATTRAttributes of the trade spend

________________________________________________________________________

IS_FIELDNAME_FOR_PLANNING

Redefined Protected ABAP_BOOL IS_FIELDNAME_FOR_PLANNING(

IMPORTINGFIELDNAME IV_FIELDNAME

)

Indicates if the change of planning data is requested by the external application

Returns

RV_FIELDNAME_FOR_PLANNING True if the external application requests the change of
planning data

Parameters

- IV_FIELDNAMEField name to validate

________________________________________________________________________

TREAT_CAUSAL_LISTS

Private TREAT_CAUSAL_LISTS(

IMPORTINGCRMT_MKTPL_CAU IT_CAUS_DELETE
CRMT_MKTPL_CAU IT_CAUS_CREATE
CRMT_MKTPL_CAU IT_CAUS_CHANGE

)

Apply the changes to the current list of causals. Causals can be added, changed and/or
deleted.

Parameters

- IT_CAUS_DELETEList of causals to delete
- IT_CAUS_CREATEList of causals to create
- IT_CAUS_CHANGEList of causals to change

Exceptions

- CX_CRM_MKTPL_EAI_FAILEDFailed to change the list of causals
 Resumable exception is raised to continue processing back into this method
 The expected result is to continue the processing of causals to add/change/delete

________________________________________________________________________

TREAT_CAUSAL_TRADE_SPEND_LISTS

Private TREAT_CAUSAL_TRADE_SPEND_LISTS(

IMPORTINGCRMT_MKTPL_TSP IT_CAUT_DELETE
CRMT_MKTPL_TSP IT_CAUT_CREATE

)

Apply the changes to the current list of causal trade spends. Causal trade spends can be added,
and/or deleted.

Parameters

- IT_CAUT_DELETEList of causal trade spends to delete
- IT_CAUT_CREATEList of causal trade spends to create

Exceptions

- CX_CRM_MKTPL_EAI_FAILEDFailed to change the list of causal trade spends
 Resumable exception is raised to continue processing back into this method
 The expected result is to continue the processing of causal trade spends
 to add/delete

________________________________________________________________________

TREAT_DATE_RANGE_LISTS

Private TREAT_DATE_RANGE_LISTS(

IMPORTINGCRMT_MKTPL_DATE_ATTRIBUTES IT_DATE_CHANGE
CRMT_MKTPL_DATE_ATTRIBUTES IT_DATE_DELETE

)

Apply the changes to the current list of date ranges. Date ranges can be changed and/or deleted.

Parameters

- IT_DATE_CHANGEList of date ranges to change
- IT_DATE_DELETEList of date ranges to delete

Exceptions

- CX_CRM_MKTPL_EAI_FAILEDFailed to change the list of date ranges
 Resumable exception is raised to continue processing back into this method
 The expected result is to continue the processing of date ranges to change/delete

________________________________________________________________________

TREAT_INDICATORS_FOR_CAUSALS

Private TREAT_INDICATORS_FOR_CAUSALS(

IMPORTINGABAP_BOOL IV_COMPLETE_TRANS_IND_PROD
ABAP_BOOL IV_COMPLETE_TRANS_IND_PGRP
ABAP_BOOL IV_COMPLETE_TRANS_IND_PCAT
CRMT_MKTPL_CAU IT_EAI_CAUSALS
CL_CRM_MKTPL_TPM_CAU_COLL IR_CAUS_COLL
CHANGINGCRMT_MKTPL_CAU CT_CAUS_DELETE

)

This method builds the list of causals to delete based on the complete transmission indicators.
There is one complete transmission indicator per product dimension.
For each product dimension,
- If the complete transmission indicator is set to true,
delete all the causals that are not included in IT_EAI_CAUSALS from the current
marketing object.

Parameters

- IV_COMPLETE_TRANS_IND_PRODComplete transmission indicator for products
- IV_COMPLETE_TRANS_IND_PGRPComplete transmission indicator for product groups
- IV_COMPLETE_TRANS_IND_PCATComplete transmission indicator for product categories
- IT_EAI_CAUSALSList of causals to create/change/delete
- IR_CAUS_COLLReference to the current list of causals
- CT_CAUS_DELETEList of causals to delete

________________________________________________________________________

TREAT_INDICATORS_FOR_CAU_TR_SP

Private TREAT_INDICATORS_FOR_CAU_TR_SP(

IMPORTINGABAP_BOOL IV_COMPLETE_TRANS_IND_PROD
ABAP_BOOL IV_COMPLETE_TRANS_IND_PGRP
ABAP_BOOL IV_COMPLETE_TRANS_IND_PCAT
CRMT_MKTPL_EAI_CAU_TSP IT_EAI_CAUSAL_TR_SPENDS
CL_CRM_MKTPL_TPM_CAU_COLL IR_CAUSAL_COLL
CHANGINGCRMT_MKTPL_TSP CT_CAUT_DELETE

)

This method builds the list of causal trade spends to delete based on the complete
transmission indicators. There is one complete transmission indicator per product dimension.
For each product dimension,
- If the complete transmission indicator is set to true,
delete all the causal trade spends that are not included in IT_EAI_CAUSALS from the
current marketing object.
For Causal Trade Spends, the Complete Transmission Indicators need to be set to True.
Since it is not possible to have a unique key for Causal Trade Spends, we cannot identify
which causal trade spend(s) to change or to delete. Therefore, all the Causal Trade
Spends are deleted (only those assigned to specified causals).
This implies that only creation of Causal Trade Spends are possible later on.

Parameters

- IV_COMPLETE_TRANS_IND_PRODComplete transmission indicator for products
- IV_COMPLETE_TRANS_IND_PGRPComplete transmission indicator for product groups
- IV_COMPLETE_TRANS_IND_PCATComplete transmission indicator for product categories
- IT_EAI_CAUSAL_TR_SPENDSList of causal trade spends to create/change/delete
- IR_CAUSAL_COLLReference to the current list of causals
- CT_CAUT_DELETEList of causal trade spends to delete

Exceptions

- CX_CRM_MKTPL_EAI_FAILEDThis exception is raised when the complete transmission
 indicator is not set. For causal trade spends, the
 indicator(s) of the product dimension(s) to process
 need to be set to True.

________________________________________________________________________

TREAT_INDICATOR_FOR_DATES

Private TREAT_INDICATOR_FOR_DATES(

IMPORTINGABAP_BOOL IV_COMPLETE_TRANS_IND
CRMT_MKTPL_EAI_DATES IT_EAI_DATES
CL_CRM_MKTPL_DATE_COLL IR_DATE_COLL
CHANGINGCRMT_MKTPL_DATE_ATTRIBUTES CT_DATE_DELETE

)

This method builds the list of date ranges to delete based on the complete transmission indicator.
If the complete transmission indicator is set to true, delete all the date ranges that are not
included in IT_EAI_DATES from the current marketing object.

Parameters

- IV_COMPLETE_TRANS_INDComplete transmission indicator
- IT_EAI_DATESList of date ranges to create/change/delete
- IR_DATE_COLLReference to the current list of date ranges
- CT_DATE_DELETEList of date ranges to delete

________________________________________________________________________

TREAT_TPM_ASG_BLOCKS

Private ABAP_BOOL TREAT_TPM_ASG_BLOCKS(

IMPORTINGCRMT_BOOLEAN IV_EAI_COMPLETE_TRANS_IND3
CRMT_BOOLEAN IV_EAI_COMPLETE_TRANS_IND2
CRMT_BOOLEAN IV_EAI_COMPLETE_TRANS_IND
FIELDNAME IV_EAI_ASG_BLOCK
STANDARD TABLE IT_EAI_DATAX
ANY IST_EAI_DATA

)

Call the appropriate process based on the assignment block

Returns

RV_UPDATE_PLANNING Is set to True if planning data needs to be updates

Parameters

- IV_EAI_COMPLETE_TRANS_IND3For "table like" assignment blocks only, complete transmission
 indicator
- IV_EAI_COMPLETE_TRANS_IND2For "table like" assignment blocks only, complete transmission
 indicator
- IV_EAI_COMPLETE_TRANS_INDFor "table like" assignment blocks only, complete transmission
 indicator
- IV_EAI_ASG_BLOCKName of the assignment block to treat
- IT_EAI_DATAXEAI parallel structure data of the assignment block
- IST_EAI_DATAEAI data of the assigment block

Exceptions

- CX_CRM_MKTPL_EAI_FAILEDThis exception is raised if an error occurs during the
 processing of an assignment block

________________________________________________________________________

TREAT_TRADE_SPEND_LISTS

Public TREAT_TRADE_SPEND_LISTS(

IMPORTINGCGPL_GUID16 IV_TPM_GUID
CRMT_MKTPL_TS IT_TRSP_DELETE
CRMT_MKTPL_TS IT_TRSP_CREATE
CRMT_MKTPL_TS IT_TRSP_CHANGE

)

Apply the changes to the current list of trade spends. Trade spends can be added,
changed and/or deleted.

Parameters

- IV_TPM_GUIDGUID of the trade promotion
- IT_TRSP_DELETEList of trade spends to delete
- IT_TRSP_CREATEList of trade spends to create
- IT_TRSP_CHANGEList of trade spends to change

Exceptions

- CX_CRM_MKTPL_EAI_FAILEDFailed to change the list of trade spends
 Resumable exception is raised to continue processing back into this method
 The expected result is to continue the processing of trade spends to add/change/delete



BAL Application Log Documentation   BAL Application Log Documentation  
This documentation is copyright by SAP AG.


Length: 90835 Date: 20120526 Time: 113118     triton ( 494 ms )