SAP OM_GRID_CONTROL_INITIALIZE Function Module for









OM_GRID_CONTROL_INITIALIZE is a standard om grid control initialize SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used to perform a specific ABAP function and below is the pattern details, showing its interface including any import and export parameters, exceptions etc. there is also a full "cut and paste" ABAP pattern code example, along with implementation ABAP coding, documentation and contribution comments specific to this or related objects.


See here to view full function module documentation and code listing for om grid control initialize FM, simply by entering the name OM_GRID_CONTROL_INITIALIZE into the relevant SAP transaction such as SE37 or SE38.

Function Group: OM_GRID
Program Name: SAPLOM_GRID
Main Program: SAPLOM_GRID
Appliation area: S
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:



Function OM_GRID_CONTROL_INITIALIZE pattern details

In-order to call this FM within your sap programs, simply using the below ABAP pattern details to trigger the function call...or see the full ABAP code listing at the end of this article. You can simply cut and paste this code into your ABAP progrom as it is, including variable declarations.
CALL FUNCTION 'OM_GRID_CONTROL_INITIALIZE'"
EXPORTING
* GRID_TYPE = "
* CB_BEFORE_USER_COMMAND = "
* CB_MENU_BUTTON = "
* CB_USER_COMMAND = "
* CB_SET_DD_BEHAVIOUR = "
* COLUMN_VIEW_CHANGE = 'X' "
* LAYOUT = "
* TITLE_SIZE = 3 "
* STANDARD_ICONS = 'X' "
* INITIAL_KEYS = 'X' "
* GRID_CONTAINER = "
* KEY_DATE = "
* BEGDA = SY-DATUM "
* ENDDA = '99991231' "
* APPLICATION_EVENT = 'X' "
* CB_DOUBLE_CLICK = "
* CB_TOOLBAR = "
* CB_CONTEXT_MENUE_REQUEST = "

CHANGING
GRID_HANDLE = "

TABLES
DISPLAYED_OBJECTS = "
* DISPLAYED_STRUCTURE = "
* COLUMN_HEADERS = "
* TOOLBAR_EXCLUDING = "
* LINES_TO_BE_COLORED = "

EXCEPTIONS
FAILED = 1 GRIDTYPE_NOT_FOUND = 2 INITIAL_CONTAINER = 3
.



IMPORTING Parameters details for OM_GRID_CONTROL_INITIALIZE

GRID_TYPE -

Data type: HRARRAYTYP
Optional: Yes
Call by Reference: No ( called with pass by value option)

CB_BEFORE_USER_COMMAND -

Data type: RS38L_FNAM
Optional: Yes
Call by Reference: No ( called with pass by value option)

CB_MENU_BUTTON -

Data type: RS38L_FNAM
Optional: Yes
Call by Reference: No ( called with pass by value option)

CB_USER_COMMAND -

Data type: RS38L_FNAM
Optional: Yes
Call by Reference: No ( called with pass by value option)

CB_SET_DD_BEHAVIOUR -

Data type: RS38L_FNAM
Optional: Yes
Call by Reference: No ( called with pass by value option)

COLUMN_VIEW_CHANGE -

Data type: FLAG
Default: 'X'
Optional: Yes
Call by Reference: No ( called with pass by value option)

LAYOUT -

Data type: LVC_S_LAYO
Optional: Yes
Call by Reference: No ( called with pass by value option)

TITLE_SIZE -

Data type: I
Default: 3
Optional: Yes
Call by Reference: No ( called with pass by value option)

STANDARD_ICONS -

Data type: FLAG
Default: 'X'
Optional: Yes
Call by Reference: No ( called with pass by value option)

INITIAL_KEYS -

Data type: FLAG
Default: 'X'
Optional: Yes
Call by Reference: No ( called with pass by value option)

GRID_CONTAINER -

Data type: CL_GUI_CONTAINER
Optional: Yes
Call by Reference: No ( called with pass by value option)

KEY_DATE -

Data type: SY-DATUM
Optional: Yes
Call by Reference: No ( called with pass by value option)

BEGDA -

Data type: SY-DATUM
Default: SY-DATUM
Optional: Yes
Call by Reference: No ( called with pass by value option)

ENDDA -

Data type: SY-DATUM
Default: '99991231'
Optional: Yes
Call by Reference: No ( called with pass by value option)

APPLICATION_EVENT -

Data type: FLAG
Default: 'X'
Optional: Yes
Call by Reference: No ( called with pass by value option)

CB_DOUBLE_CLICK -

Data type: RS38L_FNAM
Optional: Yes
Call by Reference: No ( called with pass by value option)

CB_TOOLBAR -

Data type: RS38L_FNAM
Optional: Yes
Call by Reference: No ( called with pass by value option)

CB_CONTEXT_MENUE_REQUEST -

Data type: RS38L_FNAM
Optional: Yes
Call by Reference: No ( called with pass by value option)

CHANGING Parameters details for OM_GRID_CONTROL_INITIALIZE

GRID_HANDLE -

Data type: CL_GUI_ALV_GRID
Optional: No
Call by Reference: No ( called with pass by value option)

TABLES Parameters details for OM_GRID_CONTROL_INITIALIZE

DISPLAYED_OBJECTS -

Data type: TREE_OBJEC
Optional: No
Call by Reference: No ( called with pass by value option)

DISPLAYED_STRUCTURE -

Data type: TREE_STRUC
Optional: Yes
Call by Reference: No ( called with pass by value option)

COLUMN_HEADERS -

Data type: OMCOLHEAD
Optional: Yes
Call by Reference: No ( called with pass by value option)

TOOLBAR_EXCLUDING -

Data type: UI_FUNCTIONS
Optional: Yes
Call by Reference: No ( called with pass by value option)

LINES_TO_BE_COLORED -

Data type: LINECOLOR
Optional: Yes
Call by Reference: No ( called with pass by value option)

EXCEPTIONS details

FAILED -

Data type:
Optional: No
Call by Reference: No ( called with pass by value option)

GRIDTYPE_NOT_FOUND -

Data type:
Optional: No
Call by Reference: No ( called with pass by value option)

INITIAL_CONTAINER -

Data type:
Optional: No
Call by Reference: No ( called with pass by value option)

Copy and paste ABAP code example for OM_GRID_CONTROL_INITIALIZE Function Module

The ABAP code below is a full code listing to execute function module POPUP_TO_CONFIRM including all data declarations. The code uses the original data declarations rather than the latest in-line data DECLARATION SYNTAX but I have included an ABAP code snippet at the end to show how declarations would look using the newer method of declaring data variables on the fly. This will allow you to compare and fully understand the new inline method. Please note some of the newer syntax such as the @DATA is not available until a later 4.70 service pack (SP8), which i why i have stuck to the origianl for this example.

DATA:
lv_failed  TYPE STRING, "   
lv_grid_type  TYPE HRARRAYTYP, "   
lv_grid_handle  TYPE CL_GUI_ALV_GRID, "   
lt_displayed_objects  TYPE STANDARD TABLE OF TREE_OBJEC, "   
lv_cb_before_user_command  TYPE RS38L_FNAM, "   
lv_cb_menu_button  TYPE RS38L_FNAM, "   
lv_cb_user_command  TYPE RS38L_FNAM, "   
lv_cb_set_dd_behaviour  TYPE RS38L_FNAM, "   
lv_column_view_change  TYPE FLAG, "   'X'
lv_layout  TYPE LVC_S_LAYO, "   
lv_title_size  TYPE I, "   3
lv_standard_icons  TYPE FLAG, "   'X'
lv_initial_keys  TYPE FLAG, "   'X'
lv_grid_container  TYPE CL_GUI_CONTAINER, "   
lv_gridtype_not_found  TYPE CL_GUI_CONTAINER, "   
lt_displayed_structure  TYPE STANDARD TABLE OF TREE_STRUC, "   
lv_key_date  TYPE SY-DATUM, "   
lt_column_headers  TYPE STANDARD TABLE OF OMCOLHEAD, "   
lv_initial_container  TYPE OMCOLHEAD, "   
lv_begda  TYPE SY-DATUM, "   SY-DATUM
lt_toolbar_excluding  TYPE STANDARD TABLE OF UI_FUNCTIONS, "   
lv_endda  TYPE SY-DATUM, "   '99991231'
lt_lines_to_be_colored  TYPE STANDARD TABLE OF LINECOLOR, "   
lv_application_event  TYPE FLAG, "   'X'
lv_cb_double_click  TYPE RS38L_FNAM, "   
lv_cb_toolbar  TYPE RS38L_FNAM, "   
lv_cb_context_menue_request  TYPE RS38L_FNAM. "   

  CALL FUNCTION 'OM_GRID_CONTROL_INITIALIZE'  "
    EXPORTING
         GRID_TYPE = lv_grid_type
         CB_BEFORE_USER_COMMAND = lv_cb_before_user_command
         CB_MENU_BUTTON = lv_cb_menu_button
         CB_USER_COMMAND = lv_cb_user_command
         CB_SET_DD_BEHAVIOUR = lv_cb_set_dd_behaviour
         COLUMN_VIEW_CHANGE = lv_column_view_change
         LAYOUT = lv_layout
         TITLE_SIZE = lv_title_size
         STANDARD_ICONS = lv_standard_icons
         INITIAL_KEYS = lv_initial_keys
         GRID_CONTAINER = lv_grid_container
         KEY_DATE = lv_key_date
         BEGDA = lv_begda
         ENDDA = lv_endda
         APPLICATION_EVENT = lv_application_event
         CB_DOUBLE_CLICK = lv_cb_double_click
         CB_TOOLBAR = lv_cb_toolbar
         CB_CONTEXT_MENUE_REQUEST = lv_cb_context_menue_request
    CHANGING
         GRID_HANDLE = lv_grid_handle
    TABLES
         DISPLAYED_OBJECTS = lt_displayed_objects
         DISPLAYED_STRUCTURE = lt_displayed_structure
         COLUMN_HEADERS = lt_column_headers
         TOOLBAR_EXCLUDING = lt_toolbar_excluding
         LINES_TO_BE_COLORED = lt_lines_to_be_colored
    EXCEPTIONS
        FAILED = 1
        GRIDTYPE_NOT_FOUND = 2
        INITIAL_CONTAINER = 3
. " OM_GRID_CONTROL_INITIALIZE




ABAP code using 7.40 inline data declarations to call FM OM_GRID_CONTROL_INITIALIZE

The below ABAP code uses the newer in-line data declarations. This allows you to see the coding differences/benefits of the later inline syntax. Please note some of the newer syntax below, such as the @DATA is not available until 4.70 EHP 8.

 
 
 
 
 
 
 
 
DATA(ld_column_view_change) = 'X'.
 
 
DATA(ld_title_size) = 3.
 
DATA(ld_standard_icons) = 'X'.
 
DATA(ld_initial_keys) = 'X'.
 
 
 
 
"SELECT single DATUM FROM SY INTO @DATA(ld_key_date).
 
 
 
"SELECT single DATUM FROM SY INTO @DATA(ld_begda).
DATA(ld_begda) = SY-DATUM.
 
 
"SELECT single DATUM FROM SY INTO @DATA(ld_endda).
DATA(ld_endda) = '99991231'.
 
 
DATA(ld_application_event) = 'X'.
 
 
 
 


Search for further information about these or an SAP related objects



Comments on this SAP object

What made you want to lookup this SAP object? Please tell us what you were looking for and anything you would like to be included on this page!