SAP Function Modules

ALV_LIST_VARIANT_DEFINE SAP Function module







ALV_LIST_VARIANT_DEFINE is a standard SAP function module available within R/3 SAP systems depending on your version and release level. Below is the pattern details for this FM showing its interface including any import and export parameters, exceptions etc as well as any documentation contributions (Comments) specific to the object.

See here to view full function module documentation and code listing, simply by entering the name ALV_LIST_VARIANT_DEFINE into the relevant SAP transaction such as SE37 or SE80.

Associated Function Group: SKBH
Released Date: Not Released
Processing type: Normal fucntion module
Normal function module settings


Pattern for FM ALV_LIST_VARIANT_DEFINE - ALV LIST VARIANT DEFINE





CALL FUNCTION 'ALV_LIST_VARIANT_DEFINE' "
* EXPORTING
*   i_control =                 " kkblo_control
*   i_max_width = 250           " sy-linsz
*   i_no_worning = SPACE        "
*   i_as_popup = 'X'            "
*   it_sort =                   " kkblo_t_sortinfo
*   i_flg_lvc =                 " c
*   i_tree_or_grid =            " c
  IMPORTING
    e_list_width =              " sy-linsz      List width
    e_save =                    " c
  CHANGING
    c_fieldcatalog =            " kkblo_t_fieldcat
  EXCEPTIONS
    NO_CHANGE = 1               "
    .  "  ALV_LIST_VARIANT_DEFINE

ABAP code example for Function Module ALV_LIST_VARIANT_DEFINE





The ABAP code below is a full code listing to execute function module ALV_LIST_VARIANT_DEFINE including all data declarations. The code uses 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 original method of declaring data variables up front. 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).

DATA:
ld_e_list_width  TYPE SY-LINSZ ,
ld_e_save  TYPE C .

DATA(ld_c_fieldcatalog) = 'Check type of data required'.
DATA(ld_i_control) = 'Check type of data required'.
DATA(ld_i_max_width) = '123 '.
DATA(ld_i_no_worning) = 'some text here'.
DATA(ld_i_as_popup) = 'some text here'.
DATA(ld_it_sort) = 'Check type of data required'.
DATA(ld_i_flg_lvc) = 'Check type of data required'.
DATA(ld_i_tree_or_grid) = 'Check type of data required'. . CALL FUNCTION 'ALV_LIST_VARIANT_DEFINE' * EXPORTING * i_control = ld_i_control * i_max_width = ld_i_max_width * i_no_worning = ld_i_no_worning * i_as_popup = ld_i_as_popup * it_sort = ld_it_sort * i_flg_lvc = ld_i_flg_lvc * i_tree_or_grid = ld_i_tree_or_grid IMPORTING e_list_width = ld_e_list_width e_save = ld_e_save CHANGING c_fieldcatalog = ld_c_fieldcatalog EXCEPTIONS NO_CHANGE = 1 . " ALV_LIST_VARIANT_DEFINE
IF SY-SUBRC EQ 0. "All OK ELSEIF SY-SUBRC EQ 1. "Exception "Add code for exception here ENDIF.







ABAP code to compare 7.40 inline data declaration with original syntax

The below ABAP code uses the older none in-line data declarations. This allows you to see the coding differences/benefits of the later inline syntax. It may also be useful if you are using an older version of SAP as some of the newer syntax above, such as the @DATA is not available until 4.70 EHP 8.

DATA:
ld_c_fieldcatalog  TYPE KKBLO_T_FIELDCAT ,
ld_e_list_width  TYPE SY-LINSZ ,
ld_i_control  TYPE KKBLO_CONTROL ,
ld_e_save  TYPE C ,
ld_i_max_width  TYPE SY-LINSZ ,
ld_i_no_worning  TYPE STRING ,
ld_i_as_popup  TYPE STRING ,
ld_it_sort  TYPE KKBLO_T_SORTINFO ,
ld_i_flg_lvc  TYPE C ,
ld_i_tree_or_grid  TYPE C .

ld_c_fieldcatalog = 'Check type of data required'.
ld_i_control = 'Check type of data required'.
ld_i_max_width = '123 '.
ld_i_no_worning = 'some text here'.
ld_i_as_popup = 'some text here'.
ld_it_sort = 'Check type of data required'.
ld_i_flg_lvc = 'Check type of data required'.
ld_i_tree_or_grid = 'Check type of data required'.

Contribute (Add Comments)

Please help keep this info upto date and use the comments section below to add useful hints, tips and information specific to this SAP function. This will then be available for you and other users to easily find by simply searching on the object name ALV_LIST_VARIANT_DEFINE or its description.