SAP CRM Methods
SAP CRM Methods
Perhaps the cleanup is a nice place for data loss handling and may be that is why it is
not avoided, no matter how we try to exit the screen? This data loss handling is one of
the things "exit" has to worry about and "entry" doesn't. Going by the standard
components, the DO_VIEW_INIT_ON_ACTIVATION is used for registering the
handlers and the DO_CLEANUP_CONTEXT for deregistering the handlers as these
two methods will be called anyways.
The DO_INIT_CONTEXT() is called after the WD_CREATE_CONTEXT() which in turn calls
CONNECT_NODES() on context level. Thus I thought it might be a good idea to register my
event handlers in DO_INIT_CONTEXT() and unregister them in DO_CLEANUP_CONTEXT(). The
later method is called shortly before the CONNECT_NODES() on context level is called to
deregister the event handlers in there.
Modify DO_REQUEST method You now need to modify the DO_REQUEST code so that it calls
the event handling and controls which page to display based on the new page
variable/attribute. The event handling is called using the 'dispatch_input( )' command.
At output, DO_REQUEST carries out the following tasks:
i. DO_REQUEST determines whether data must be fetched from the model or from
the global attributes.
ii. DO_REQUEST fetches the table with the object keys from the top-level controller.
iii.
iv.
v.
DO_INIT_CONTEXT This method is called once when a custom controller is instantiated or, for view
controllers, each time the view becomes visible to initialize the view controller context according to the
application's needs. This method is called by WD_CREATE_CONTEXT after all the framework
initialization is done. You should redefine it in your controller implementation class.
DO_CLEANUP_CONTEXT This method is called to destroy the context of a controller. For view
controllers, this happens each time the view becomes invisible. It is called by WD_DESTROY before the
framework destroys the controller's context to allow a controller to cleanup its content internally.It should
be redefined in the implementation class.
DO_PREPARE_OUTPUT: this view displayed every time the view is displayed.
DO_FINISH_INPUT : once u press enter in ur View, u can have validations in this method. This is usually
used at the end of all the data input on the screen..
DO_VALIDATE_INPUT : when ever u enter anything on the screen, this would trigger and validations
gets triggered here.
Method
Description
Method
Description
DO_INIT
This method is called once at the start and is used for initialization.
This method behaves like a constructor method.
DO_INITATTRIBUTES This method is called with every request and is used to initialize the attributes. The
parameters are read from the request. In this method, you can also execute
initializations that are required for each request.
You can also use this method to set additional attributes. This method is not absolutely
necessary, since you can use DO_REQUEST to solve everything that you can
Service functions
You can call these methods:
Method
Description
CREATE_VIEW
A view must always belong to the same BSP application as its controller.
CALL_VIEW
CREATE_CONTROLLER
CALL_CONTROLLER
GET_ATTRIBUTE
GET_LIFETIME
Returns the lifetime of this page (only for the top-level controller)
GET_PAGE_URL
SET_ATTRIBUTE
SET_LIFETIME
Changes the lifetime of this page (only for the top-level controller)
TO_STRING
WRITE
GET_OUT
SET_MIME_TYPE
Changes the MIME type of the page or the content type of the header field
INSTANTIATE_PARAMETER
Instantiates the parameter from the request using the request data
SET_CACHING
SET_MODEL
CREATE_MODEL
GET_CONTROLLER
Fetches a sub-controller
CONTROLLER_SET_ACTIVE
DELETE_MODEL
FILL_MODEL_DATA
DELETE_CONTROLLER
Deletes a sub-controller
GET_MODEL
IS_TOPLEVEL
Framework functions
These methods are provided as part of the framework and are only included here for the sake of completeness.They
are not usually relevant for application development.
Method
Description
IF_BSP_DISPATCHER~REGISTER
Registers a sub-components
IF_BSP_CONTROLLER~FINISH_INPUT_PROCESSING
IF_BSP_CONTROLLER~FILL_VALUES
IF_BSP_CONTROLLER~HANDLE_EVENT
GET_FIELD_COMPONENT
GET_FIELD_MODEL
This method is called once when a custom controller is instantiated or, for view
controllers, each time theview becomes visible.The purpose is to create and initialize
thecontext from a framework perspective.Do not redefine that method,But use
DO_INIT_CONTEXT instead, which is made exactly for that purpose.If you already
redefined the method, as the DO_INIT_CONTEXT is relatively new, you do not have
tochange it. However, if you have the time, it would be nice to change it.
DO_INIT_CONTEXT
This method is called once when a custom controller is instantiated or, for view
controllers, each time theview becomes visible to initialize the view controller context
according to the application's needs.This method is called by WD_CREATE_CONTEXT
after all the framework initialization is done.You should redefine it in your controller
implementation class.
WD_DESTROY
This method is called to destroy the context of a controller. For view controllers, this
happens each timethe view becomes invisible. It is used within the framework and
cannot be redefined. It is also called whenthe controller instance is deleted.
DO_CLEANUP_CONTEXT
This method is called to destroy the context of a controller. For view controllers, this
happens each timethe view becomes invisible. It is called by WD_DESTROY before the
framework destroys the controller'scontext to allow controller to clean up its content
internally. It should be redefined in the implementationclass.
WD_DESTROY_CONTEXT
This method is called to destroy the context of a controller. For view controllers, this
happens each timethe view becomes invisible. It is used within the framework and
cannot be redefined. It is called byWD_DESTROY after DO_CLEANUP_CONTEXT
External List Management in SAP CRM
his is on CRM 5.2 You can only use web IC to create the Mapping formation. Dont use win
clinet for this. SAPs intention is to move every one to the Web Client(WEB-IC).
ELM (External list management) is used to load the external data from outside system in to
the CRM system.
ELM is used to load the new customer information (create new BP) or update the existing
customer information (update the BP).
When we load the data from the excel or text (.CSV file or .txt file) the customer data will
be created as a prospect(or any other role that you want).
For loading the data using ELM we need to do the following steps.
Create mapping
You can create and maintain external lists in SAP CRM by acquiring specific data from external providers
and using this data to gain new business partners. The data from external providers could include
information on:
Business partner addresses
Marketing attributes of business partners
Business transactions-related information, such as activities and leads
Survey details
External List Management involves procuring external data, defining mapping formats, checking and
preparing the data, updating existing data, creating business partners, using these business partners in
marketing campaigns, and analyzing (reporting) the methods used.
CRMV_EVENT - what is it?
What is callback?
After processing each part of CRM document, eg. Partners, Customer fields, Organizational data, etc. specific events
are executed in SAP CRM. After these events special function modules are executed. These are called "callbacks".
These callbacks are function modules that end with "_EC" in its name. It means they have special interface that is
needed when module is to be used as callback.
Callbacks are executed by SAP CRM if they are connected in transaction CRMV_EVENT to certain events. And
whether attributes set there, which work as filter, are the same as in processed activity by user.
Each callback is configured in the same way:
- it is connected to transaction category (eg. Service process)
- its time and priority of execution is set,
- it is connected to object and event (Object means part of document that is being "touched", it could be for example
"Partner" or "Orderadm_h". Event could be "Save" - while saving, "After_change", "After_create", etc.)
- it may have attributes set (eg. when processing Partner it could be partner function type),
- it could be executed for headers or/and items of documents.
What it is used for?
Callbacks are used mainly for processing documents. For example in standard they are used to copy organizational
data from previous document when creating new follow-up document.
How to check which callbacks are executed?
in CRMV_EVENT it is best to filter by specific transaction category and object. Eg. Service Process and STATUS.
Please remember that there could be more Transaction categories used in a particular process, like Service Process,
and also generic one so CRM Bus. Transactions.
check also many transactions for tracing / checking (like CRM*EVENT*, eg CRMD_EVENT_TRACE,
CRMD_EVENT_CHECK).
How to define own?
Create function module with proper interface (look at *_EC function modules) and assign in configuration (SPRO ->
CRM -> Transactions -> Basic Settings -> Edit Event Handler Table).