Sei sulla pagina 1di 7

Custom View Exit Class.

Author: Ravi Sharma


Date: 04-07-2011
Table of Contents

View Exit Interface Class

Custom View Exit Class


View Exit Interface Class
The generic feeder classes usually take care of all communication aspects
between the corresponding GUIBB and the application. Nevertheless there
might be use cases that require a more specific implementation.

For this, an Exit Class can be specified in the FBI View definition. Exit Classes
provide many extension options and are the recommended means for
adapting the standard FBI processing to customers and partners needs.
Exit Class implementations inherit from TM super class
/SCMTMS/CL_UI_VIEWEXIT_CMN. An Exit Class implements the
following FBI Exit Interfaces:

- Core Interface /BOFU/IF_FBI_VIEW_EXIT_INTF: The interface does not have


any interface methods but the Exit Class implements it for enabling FBI to instantiate an
object from this class.

- Definition Interface /BOFU/IF_FBI_VIEW_EXITINTF_DEF: The


methods of this interface offer the possibility to influence the processing of
FPM phases Initialization and Get Definition (“one time” phases). Its
implementation is optional.

• Method ADAPT_FIELDS: Modify the field catalogue.


• Method ADAPT_ACTIONS: Modify the action catalogue.
• Method ADAPT_DND_DEFINITON: Modify drag & drop definitions

Definition Interface /BOFU/IF_FBI_VIEW_EXITINTF_RUN: The


methods of this interface offer the possibility to influence the processing of
User Interactions (at each roundtrip). Its implementation is also optional.

• Method ADAPT_CHANGE_LOG: Modify the list of screen changes


before converting them into BO modification records.
• Method ADAPT_EVENT: Intercept and process any event that arrives
in the underlying FBI view. If custom event IDs were added to the FBI
View, this is the place to implement the action handling for them.
• Method ADAPT_MESSAGES: Modify the returned messages from the
Modify and DO_ACTION service calls.
• Method ADAPT_DATA: Modify the data before it is passed to FPM.
The data is in the concatenated format (all related views in the chain
plus the reference fields). Thus, the component of the UI structure
must be accessed with ASSIGN COMPONENT...
• Method ADAPT_FIELD_PROPERTIES: Modify the field properties of
this view (at column level, these values are merged with the properties
from the reference fields of data structure).
• Method ADAPT_ACTION_PROPERTIES: Modify the enabled/disable
properties of this view's actions.
• Method ADAPT_SELECTION: Modify the selected lines (in list and
tree).
Custom View Exit Classes

Normally the standard View Exit classes are provided by SAP TM, to suffice
all possible objectives.

So, in order to incorporate customer requirements we normally enhance the


methods of this standard View Exit Class by creating either Pre-EXIT / Post-
EXIT on top of them.

Also, we can create an implicit enhancement in these standard methods to


meet custom requirements.

e.g. Exit Interface Class - /SCMTMS/CL_UI_VIEWEXIT_TOR

This View Exit Class is used in Freight Unit BO Application.


For Custom requirements, we can create a pre/post-exit in the
required methods or we create implicit enhancement in them via
Enhancement Framework.

However, in case we do not want to touch the standard classes and


want to have our own classes, we can create a sub-class out of it and
assign it our own FBI Views.
Newly created Z-View Exit Class.

Re-define the methods which satisfy your custom requirements


(Inheritance – OOPs basic concept)
Write your custom code in the re-definition method.

** SUPER CALL () - TO MOTHER CLASS (/SCMTMS/VIEWEXIT_TOR)


** IN CASE, YOU DO NOT WANT THE SUPER CLASS LOGIC, COMMENT IT OUT..
CALL METHOD SUPER->/BOFU/IF_FBI_VIEW_EXITINTF_RUN~ADAPT_EVENT
EXPORTING
IV_BO_KEY = IV_BO_KEY
IV_NODE_KEY = IV_NODE_KEY
IV_EVENTID = IV_EVENTID
IR_EVENT_DATA = IR_EVENT_DATA
IT_SELECTED_ROWS = IT_SELECTED_ROWS
IO_ADDITIONAL_INFO = IO_ADDITIONAL_INFO
IV_RAISED_BY_OWN_UI = IV_RAISED_BY_OWN_UI
IS_UI_CONTEXT_DATA = IS_UI_CONTEXT_DATA
CHANGING
CV_FAILED = CV_FAILED.

[*** CUSTOM LOGIC HERE…. ****


*** CUSTOM LOGIC HERE…. ****
*** CUSTOM LOGIC HERE…. **** ]

Assign the ZViewExit Class to your FBI Views.


Open a FBI View.

Assign the ZViewExit Class.

This way, you can write any logic in any of the Exit-Class methods
without enhancing/touching the standard Exit Classes.

Potrebbero piacerti anche