CL_CRM_MKTPL_EAI - CRM MKTPL: abstract class

BAL Application Log Documentation   RFUMSV00 - Advance Return for Tax on Sales/Purchases  
This documentation is copyright by SAP AG.

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

General Class Description

CRM MKTPL: abstract class

__________________________________________________________

Class Info

Name:CL_CRM_MKTPL_EAI
Instantiation:Public

Superclass

None

Implemented Interfaces

None

Friend Classes

None

Subclasses

CL_CRM_MKTPL_EAI_CHANGE
CL_CRM_MKTPL_EAI_CREATE
CL_CRM_MKTPL_EAI_MASS_PROCESS
CL_CRM_MKTPL_EAI_PLANNING
CL_CRM_MKTPL_EAI_READ

__________________________________________________________

Methods

ADD_MESSAGE

Protected ADD_MESSAGE(

IMPORTINGSYMSGID IV_CLASS
ABAP_BOOL IV_IS_A_GENERAL_MESSAGE
SYMSGNO IV_NUMBER
CRM_MKTGS_GUID IV_OBJECT_GUID
SYMSGV IV_PAR1
SYMSGV IV_PAR2
SYMSGV IV_PAR3
SYMSGV IV_PAR4
SYMSGTY IV_TYPE

)

This method is responsible for adding a message to the application log for EAI

Parameters

- IV_CLASSMessage class, defaulted to CRM_MKTPL_EAI
- IV_IS_A_GENERAL_MESSAGEWhen set to true, the message will not be linked to a specific.
 marketing project. It will be logged as a message applying to all
 marketing projects. NOTE: If specified, IV_OBJECT_GUID must have
 an initial value.
- IV_NUMBERMessage number
- IV_OBJECT_GUIDGuid of a specific object to which we want to add the message. Usually specified
 when we log application messages (in a mass scenario for example). NOTE: If specified,
 IV_IS_A_GENERAL_MESSAGE must have a value of abap_false.
- IV_PAR1Parameter 1
- IV_PAR2Parameter 2
- IV_PAR3Parameter 3
- IV_PAR4Parameter 4
- IV_TYPEMessage type, defaulted to E

________________________________________________________________________

ADD_MESSAGES_FROM_TABLE

Protected ADD_MESSAGES_FROM_TABLE(

IMPORTINGCRMT_MKTPL_EAI_LOG IT_MESSAGE_LOG

)

Adds messages from another log to the current log.
E.g. Useful to gather all the log colelcted during a bulk scenario (parallel processing).

Parameters

- IT_MESSAGE_LOGLog containing all the messages to add to the current log.

________________________________________________________________________

ADD_MESSAGE_FROM_EXCEPTION

Protected ADD_MESSAGE_FROM_EXCEPTION(

IMPORTINGCX_CRM_MKTPL_EAI IR_EXCEPTION
ABAP_BOOL IV_IS_A_GENERAL_MESSAGE

)

This method is responsible for retrieving the message tied to the exception raised and adding it
to the EAI message log.

Parameters

- IR_EXCEPTIONReference to an instance of the CX_CRM_MKTPL_EAI_FAILED exception class.
- IV_IS_A_GENERAL_MESSAGEWhen set to true, the message will not be linked to a specific.
 marketing project. It will be logged as a messageapplying to all
 marketing projects.

________________________________________________________________________

ADD_MESSAGE_TO_LOG_TABLE

Private ADD_MESSAGE_TO_LOG_TABLE(

IMPORTINGSYMSGID IV_CLASS
CRM_MKTPL_EAI_ERROR_CATEGORY IV_ERROR_CATEGORY
SYMSGNO IV_NUMBER
SYMSGV IV_PAR1
SYMSGV IV_PAR2
SYMSGV IV_PAR3
SYMSGV IV_PAR4
CRM_MKTGS_GUID IV_RECORD_GUID
SYMSGTY IV_TYPE

)

This method is responsible for adding a message to the application log for EAI

Parameters

- IV_CLASSMessage class, defaulted to CRM_MKTPL_EAI
- IV_ERROR_CATEGORYError category representing the type of message raised when it is
 an error. We mainly use this category for SOA services in order to
 categorize the type of error sent to FEH (Forward Error Handling).
- IV_NUMBERMessage number
- IV_PAR1Parameter 1
- IV_PAR2Parameter 2
- IV_PAR3Parameter 3
- IV_PAR4Parameter 4
- IV_RECORD_GUIDUnique identifier of the record to which we need to add a message.
 If not provided (or INITIAL VALUE), the message will be interpreted
 like a general message and will not be linked to any marketing project.
- IV_TYPEMessage type, defaulted to E

________________________________________________________________________

CAUSAL_ASSIGN_CHANGE

Protected CAUSAL_ASSIGN_CHANGE(

IMPORTINGCRM_MKTGS_GUID IV_MKTPROJ_GUID
CRMT_MKTPL_CAU IT_CAUSAL

)

This method is responsible for changing causals assigned to a marketing object

Parameters

- IV_MKTPROJ_GUIDMarketing Project Guid
- IT_CAUSALTable of Causals to be changed

Exceptions

- CX_CRM_MKTGS_EXCEPTIONRaised if something went wrong during function call
- CX_CRM_MKTGS_FUNCTION_FAILEDRaised if anything goes wrong in the preparation of the function call

________________________________________________________________________

CAUSAL_ASSIGN_DELETE

Protected CAUSAL_ASSIGN_DELETE(

IMPORTINGCRM_MKTGS_GUID IV_MKTPROJ_GUID
CRMT_MKTPL_CAU IT_CAUSAL

)

This method is responsible for deleting causals assigned to a marketing object

Parameters

- IV_MKTPROJ_GUIDMarketing Project Guid
- IT_CAUSALTable of Causals to be deleted

Exceptions

- CX_CRM_MKTGS_EXCEPTIONRaised if something went wrong during function call
- CX_CRM_MKTGS_FUNCTION_FAILEDRaised if anything goes wrong in the preparation of the function call

________________________________________________________________________

CAUSAL_TSPEND_ASSIGN_CHANGE

Protected CAUSAL_TSPEND_ASSIGN_CHANGE(

IMPORTINGCRMT_MKTPL_TSP IT_CAUSAL_TRADE_SPENDS
CRM_MKTGS_GUID IV_CAUSAL_GUID
CRM_MKTGS_GUID IV_MKTPROJ_GUID

)

This method is responsible for changing causal trade spends assigned to a particular
causal for a single marketing object.

Parameters

- IT_CAUSAL_TRADE_SPENDSTable of Causal Trade spends to be changed
- IV_CAUSAL_GUIDThe causal for which causal trade spends are to be changed
- IV_MKTPROJ_GUIDMarketing Project Guid

Exceptions

- CX_CRM_MKTGS_EXCEPTIONRaised if something went wrong during function call
- CX_CRM_MKTGS_FUNCTION_FAILEDRaised if anything goes wrong in the preparation of the function call

________________________________________________________________________

CAUSAL_TSPEND_ASSIGN_CREATE

Protected CAUSAL_TSPEND_ASSIGN_CREATE(

IMPORTINGCRMT_MKTPL_TSP IT_CAUSAL_TRADE_SPENDS
CRM_MKTGS_GUID IV_CAUSAL_GUID
CRM_MKTGS_GUID IV_MKTPROJ_GUID

)

This method is responsible for creating causal trade spends assigned for a particular causal

Parameters

- IT_CAUSAL_TRADE_SPENDSTable of Causal Trade spends to be created
- IV_CAUSAL_GUIDThe causal for which causal trade spends are to be created
- IV_MKTPROJ_GUIDMarketing Project Guid

Exceptions

- CX_CRM_MKTGS_EXCEPTIONRaised if something went wrong during function call
- CX_CRM_MKTGS_FUNCTION_FAILEDRaised if anything goes wrong in the preparation of the function call

________________________________________________________________________

CAUSAL_TSPEND_ASSIGN_DELETE

Protected CAUSAL_TSPEND_ASSIGN_DELETE(

IMPORTINGCRMT_MKTPL_TSP IT_CAUSAL_TRADE_SPENDS
CRM_MKTGS_GUID IV_CAUSAL_GUID
CRM_MKTGS_GUID IV_MKTPROJ_GUID

)

This method is responsible for deleting causal trade spends assigned to a particular
causal for a single marketing object.

Parameters

- IT_CAUSAL_TRADE_SPENDSTable of Causal Trade spends to be deleted
- IV_CAUSAL_GUIDThe causal for which causal trade spends are to be deleted
- IV_MKTPROJ_GUIDMarketing Project Guid

Exceptions

- CX_CRM_MKTGS_EXCEPTIONRaised if something went wrong during function call
- CX_CRM_MKTGS_FUNCTION_FAILEDRaised if anything goes wrong in the preparation of the function call

________________________________________________________________________

CONSTRUCTOR

Public CONSTRUCTOR( )

This constructor is responsible for keeping an instance of the appl_base api.

________________________________________________________________________

CONVERT_DATES_DATS_2_TIMESTAMP

Protected CONVERT_DATES_DATS_2_TIMESTAMP(

IMPORTINGCRM_MKTPL_PLANFINISHDATE IV_END_DATE
CRM_MKTGS_GUID IV_MKTPROJ_GUID
CRM_MKTPL_PLANSTARTDATE IV_START_DATE
EXPORTINGTIMESTAMP EV_START_DATE_TIMESTAMP
TIMESTAMP EV_END_DATE_TIMESTAMP

)

This method is responsible for converting start and end dates of a marketing project.
It does the conversion from type DATS to timestamp.

Parameters

- IV_END_DATEEnd date in DATS format
- IV_MKTPROJ_GUIDMarketing Project Guid
- IV_START_DATEStart date in DATS format
- EV_START_DATE_TIMESTAMPStart date in timestamp format
- EV_END_DATE_TIMESTAMPEnd date in timestamp format

________________________________________________________________________

CONVERT_DATES_TIMESTAMP_2_DATS

Protected CONVERT_DATES_TIMESTAMP_2_DATS(

IMPORTINGTIMESTAMP IV_END_DATE_TIMESTAMP
CRM_MKTGS_GUID IV_MKTPROJ_GUID
TIMESTAMP IV_START_DATE_TIMESTAMP
EXPORTINGCRM_MKTPL_PLANFINISHDATE EV_END_DATE
CRM_MKTPL_PLANSTARTDATE EV_START_DATE

)

This method is responsible for converting start and end dates of a marketing project.
It does the conversion from type timestamp to DATS.
NOTE: This method is called ONLY as a workaround for product where appl_base methods
do not accept a type DATS in the input structure. It should always be the responsibility
of the CALLED method to convert the dates and NOT the responsibility of the caller.

Parameters

- IV_END_DATE_TIMESTAMPEnd date in timestamp format
- IV_MKTPROJ_GUIDMarketing Project Guid
- IV_START_DATE_TIMESTAMPStart date in timestamp format
- EV_END_DATEEnd date in DATS format
- EV_START_DATEStart date in DATS format

________________________________________________________________________

FREE

Protected FREE( )

Clear member attributes of classes

________________________________________________________________________

GET_CURRENT_RECORD_GUID

Private CRM_MKTGS_GUID GET_CURRENT_RECORD_GUID( )

Returns the guid of the record currently in process by our EAI service.

Returns

Guid of the record currently in process by our EAI service.

________________________________________________________________________

GET_EXTERNAL_ID_FROM_GUID

Protected CGPL_EXTID GET_EXTERNAL_ID_FROM_GUID(

IMPORTINGCGPL_GUID16 IV_MKTPROJ_GUID

)

This method uses a function module to retrieve the appropriate external ID from a valid marketing project GUID

Returns

RV_EXTERNAL_ID external ID of marketing project

Parameters

- IV_MKTPROJ_GUIDGUID of marketing project

________________________________________________________________________

GET_EXTERNAL_ID_FROM_REC_GUID

Protected CRM_MKTGS_EXTERNAL_ID GET_EXTERNAL_ID_FROM_REC_GUID(

IMPORTINGCRM_MKTGS_GUID IV_RECORD_GUID

)

Gets the external ID of a project associated to a specific record guid.
This method will work only if the message log contains the record guid
and if the external ID was linked to the record guid.

Returns

Project external ID associated to the record guid received.

Parameters

- IV_RECORD_GUIDRecord guid to translate into a project external ID.
 

________________________________________________________________________

GET_GUID_FROM_EXTERNAL_ID

Protected CGPL_GUID16 GET_GUID_FROM_EXTERNAL_ID(

IMPORTINGCGPL_EXTID IV_EXTERNAL_ID

)

This method uses a function module to retrieve the appropriate GUID from a valid marketing
project ID

Returns

RV_MKTPROJ_GUID Guid of marketing project

Parameters

- IV_EXTERNAL_IDExternal ID of marketing project

________________________________________________________________________

GET_LOG

Protected GET_LOG(

EXPORTINGCRMT_MKTPL_EAI_LOG ET_MESSAGE_LOG

)

This method is an accessor method to get access to the message log

Parameters

- ET_MESSAGE_LOGA table of messages

________________________________________________________________________

GET_PROJECT_GUID_FROM_REC_GUID

Protected CRM_MKTGS_GUID GET_PROJECT_GUID_FROM_REC_GUID(

IMPORTINGCRM_MKTGS_GUID IV_RECORD_GUID

)

Gets the project guid representing the record guid of the log.

Returns

Project guid representing the project referred by the record guid of the log.

Parameters

- IV_RECORD_GUIDRecord guid to translate to a project guid.
 

________________________________________________________________________

GET_REC_GUID_FROM_OBJECT_GUID

Private CRM_MKTGS_GUID GET_REC_GUID_FROM_OBJECT_GUID(

IMPORTINGCRM_MKTGS_GUID IV_OBJECT_GUID

)

Gets the record guid found in the log for a specific project object guid.
This method will work only if the message log contains the record guid
and if the object guid was linked to the record guid.
NOTE: This method is typically used to associate a message raised during the save process
for a mass scenario where messages could be logged for any projects involved in the process.

Returns

Record guid associated to the found marketing project object guid.

Parameters

- IV_OBJECT_GUIDProject ID for which we would like to find the record guid.
 

________________________________________________________________________

INITIALIZE_BAL_LOG

Private BALLOGHNDL INITIALIZE_BAL_LOG( )

Initialize BAL log for SLG1 message logging.

________________________________________________________________________

INIT_LOG_FOR_CURRENT_RECORD

Protected INIT_LOG_FOR_CURRENT_RECORD(

IMPORTINGCRM_MKTGS_GUID IV_RECORD_GUID

)

Add a new line in the message log to store messages logged in the
processing of the record received in parameter.

Parameters

- IV_RECORD_GUIDIdentifier of the record to process in our service.

________________________________________________________________________

LINK_EXTERNAL_ID_TO_REC_GUID

Protected LINK_EXTERNAL_ID_TO_REC_GUID(

IMPORTINGCRM_MKTGS_EXTERNAL_ID IV_MKTPROJ_EXTERNAL_ID

)

Link the record guid of a log entry to its marketing project external ID.
A guid is currently the only way to associate the messages to the record to process
because we can receive an empty external ID. Once an external ID is determined, we
link the two values for better clarity in the log we will return. This log is the only
way for the caller of the service to know which project has which messages.

Parameters

- IV_MKTPROJ_EXTERNAL_IDExternal ID of the project associated to the record in process.

________________________________________________________________________

LINK_OBJECT_GUID_TO_REC_GUID

Protected LINK_OBJECT_GUID_TO_REC_GUID(

IMPORTINGCRM_MKTGS_GUID IV_MKTPROJ_OBJECT_GUID

)

Link the record guid of a log entry to its marketing project object guid.
A record guid is currently the only way to associate the messages to the record to process
because we can receive an empty external ID.
This method is useful especially when called from a mass create scenario. Since we can
receive multiple times the same external ID, we need a way to distinguish which message
goes with which external ID. Even if we receive an external ID that already exists, we will
try to create a project (that will give us an object guid) and the create process will raise
the error that the project already exists.
Even if we do not have the same external ID in the mass process, we need to associate the
application messages raised during the save process to their respective project.

Parameters

- IV_MKTPROJ_OBJECT_GUIDExternal ID of the project associated to the record in process.

________________________________________________________________________

LOG_APPLICATION_MESSAGES

Protected ABAP_BOOL LOG_APPLICATION_MESSAGES( )

This method is in charge of getting and logging all the messages that were logged in the application log

Returns

RV_HAS_ERRORS Returns true if there was at least one error message that was logged

________________________________________________________________________

ON_TRANSACTION_FINISHED

Protected ON_TRANSACTION_FINISHED(

IMPORTING KIND

)

This method is responsible of calling the AFTER_COMMIT() processing.
It is the event handler for the after commit sent by the system.
It will be called once the statement "COMMIT WORK [AND WAIT]" is executed.
This after_commit processing is absolutely needed to complete the save process
because we do not have control over the COMMIT statement. The COMMIT is sent by
the system PI or the web service.

Parameters

- KINDState performed by system.

________________________________________________________________________

SAVE

Protected SAVE(

EXPORTINGCRMT_MKTGS_ITEM_MSG ET_ERRONEOUS_OBJECTS

)

This method is responsible for saving the marketing objects

Parameters

- ET_ERRONEOUS_OBJECTSIf the save fails, this parameter will contain a list of objects that failed and their error messages



ABAP Short Reference   General Data in Customer Master  
This documentation is copyright by SAP AG.


Length: 41273 Date: 20120526 Time: 113044     triton ( 348 ms )