CL_CRM_MKTGS_BAL_ASYNC - write bal messages in parallel asyncronous processes

General Data in Customer Master   ROGBILLS - Synchronize billing plans  
This documentation is copyright by SAP AG.

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

General Class Description

This class provides methods for writing messages to BAL within parallel running processes:
Usually if you access BAL ( no matter you perform a read or write access ) the BAL framework
will create a buffer (copy of the db content) and will not refresh this buffer during your session.
This might result in loss of messages if multiple sessions running inparallel write to the same log.
To avoid this data loss this class ensures that BAL access is serialized and the BAL buffer is refreshed.

__________________________________________________________

Class Info

Name:CL_CRM_MKTGS_BAL_ASYNC
Instantiation:Public

Superclass

None

Implemented Interfaces

None

Friend Classes

None

Subclasses

None

__________________________________________________________

Methods

ADD_MSG

Public ADD_MSG(

IMPORTINGI IV_SECONDS_TO_WAIT
SY-MSGV4 IV_MSGV4
SY-MSGV3 IV_MSGV3
SY-MSGV2 IV_MSGV2
SY-MSGV1 IV_MSGV1
SY-MSGTY IV_MSGTY
SY-MSGNO IV_MSGNO
SY-MSGID IV_MSGID
ABAP_BOOL IV_CUMULATE
BAL_S_MSG IS_BAL_LOG_MSG
  IR_CX_CRM_MESSAGE

)

writes a message to BAL. The message can be provided in four ways:
- by passing an instance of cx_crm_message carrying a message
( import parameter ir_cx_crm_message )
- passing a filled message structure
( import parameter is_bal_log_msg )
- passing values for iv_msg* parameters
- passing nothing explicitly but implictly via the default option of the iv_msg* parameters:
They will take over the content of the sy-msg.. fields.

Parameters

- IV_SECONDS_TO_WAITspecifies how long the process shall wait to receive the access to BAL
- IV_CUMULATEspecifies whether equal messagesshould be cumulated or not

________________________________________________________________________

ADD_MSG_TO_LOG

Public static ADD_MSG_TO_LOG(

IMPORTINGI IV_SECONDS_TO_WAIT
SY-MSGV4 IV_MSGV4
SY-MSGV3 IV_MSGV3
SY-MSGV2 IV_MSGV2
SY-MSGV1 IV_MSGV1
SY-MSGTY IV_MSGTY
SY-MSGNO IV_MSGNO
SY-MSGID IV_MSGID
BALLOGHNDL IV_LOG_HANDLE
ABAP_BOOL IV_CUMULATE
BAL_S_MSG IS_BAL_LOG_MSG
  IR_CX_CRM_MESSAGE

)

add_msg_to_log is only a wrapper for method add_msg to allow
writing a message just by providing the log handle
without explicitly holding an instance of this class

________________________________________________________________________

GET_INSTANCE

Public static CL_CRM_MKTGS_BAL_ASYNC GET_INSTANCE(

IMPORTINGBALLOGHNDL IV_LOG_HANDLE

)

returns a singleton per log handle / ensures that there is only
one instnce of this class per log handle with the current session
because of an implementation concept change this class doesn't use
anymore the fact that every instance is a singleton
but the singleton approach was kept because its a nice feature that
doesn't carry in any disadvantages

________________________________________________________________________

LOCK_LOG_AND_REFRESH_BUFFER

Private LOCK_LOG_AND_REFRESH_BUFFER(

IMPORTINGI IV_SECONDS_TO_WAIT

)

Sets a lock to ensure BAL access is serialized for parallel running processes.
The 'normal' timeframe of approximately 3 seconds that is used by netweaver
to wait for a lock until it is granted or refused can be extended with the
input parameter iv_seconds_to_wait.
If the lock could be set within this timeframe the caller is garanteed to
have unique access to the BAL log ( as long as concurrent processes use
this API also ).
Lock ownership is transferred to update task to ensure that the lock is
removed by the next database 'commit work'.
This is only working when there is at least one function call with the addition
'IN UPDATE TASK' before the next commit work takes place.
To ensure this a 'dummy' update function call is perfromed.
After the lock is set this method refreshs the BAL buffer to ensure all
messages that might be written from other sessions to the same log are
present now in the buffer.
By this the method ensures that the next save operation for BAL will not
contain all messages of the log.

________________________________________________________________________

LOG_EXISTS_ON_DB

Private ABAP_BOOL LOG_EXISTS_ON_DB( )

checks whether log exists on db or not
usually a log exists in general ( in memory ), but not on db
if it has just been created but not saved yet


CPI1466 during Backup   Vendor Master (General Section)  
This documentation is copyright by SAP AG.


Length: 9532 Date: 20120526 Time: 110952     triton ( 155 ms )