SAP Function Modules

ALV_TREE_PRINT_SERVER SAP Function module







ALV_TREE_PRINT_SERVER 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_TREE_PRINT_SERVER into the relevant SAP transaction such as SE37 or SE80.

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


Pattern for FM ALV_TREE_PRINT_SERVER - ALV TREE PRINT SERVER





CALL FUNCTION 'ALV_TREE_PRINT_SERVER' "
  EXPORTING
    i_hierarchy_header =        " tv_heading
    i_hierarchy_width =         " int4
    it_checked_items =          " lvc_t_chit
*   i_oo_alv =                  "
    i_print_preview =           " as4flag
*   it_qinfo =                  " lvc_t_qinf
  TABLES
    it_items =                  " lvc_t_item
    it_nodes =                  " lvc_t_node
    it_level =                  " lvc_t_plvl
    it_exp_nodes =              " lvc_t_nkey
    it_fieldcatalog =           " lvc_t_fcat
    it_list_commentary =        " slis_t_listheader
    .  "  ALV_TREE_PRINT_SERVER

ABAP code example for Function Module ALV_TREE_PRINT_SERVER





The ABAP code below is a full code listing to execute function module ALV_TREE_PRINT_SERVER 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:
it_it_items  TYPE STANDARD TABLE OF LVC_T_ITEM,"TABLES PARAM
wa_it_items  LIKE LINE OF it_it_items ,
it_it_nodes  TYPE STANDARD TABLE OF LVC_T_NODE,"TABLES PARAM
wa_it_nodes  LIKE LINE OF it_it_nodes ,
it_it_level  TYPE STANDARD TABLE OF LVC_T_PLVL,"TABLES PARAM
wa_it_level  LIKE LINE OF it_it_level ,
it_it_exp_nodes  TYPE STANDARD TABLE OF LVC_T_NKEY,"TABLES PARAM
wa_it_exp_nodes  LIKE LINE OF it_it_exp_nodes ,
it_it_fieldcatalog  TYPE STANDARD TABLE OF LVC_T_FCAT,"TABLES PARAM
wa_it_fieldcatalog  LIKE LINE OF it_it_fieldcatalog ,
it_it_list_commentary  TYPE STANDARD TABLE OF SLIS_T_LISTHEADER,"TABLES PARAM
wa_it_list_commentary  LIKE LINE OF it_it_list_commentary .

DATA(ld_i_hierarchy_header) = 'Check type of data required'.
DATA(ld_i_hierarchy_width) = 'Check type of data required'.
DATA(ld_it_checked_items) = 'Check type of data required'.
DATA(ld_i_oo_alv) = 'some text here'.
DATA(ld_i_print_preview) = 'Check type of data required'.
DATA(ld_it_qinfo) = 'Check type of data required'.

"populate fields of struture and append to itab
append wa_it_items to it_it_items.

"populate fields of struture and append to itab
append wa_it_nodes to it_it_nodes.

"populate fields of struture and append to itab
append wa_it_level to it_it_level.

"populate fields of struture and append to itab
append wa_it_exp_nodes to it_it_exp_nodes.

"populate fields of struture and append to itab
append wa_it_fieldcatalog to it_it_fieldcatalog.

"populate fields of struture and append to itab
append wa_it_list_commentary to it_it_list_commentary. . CALL FUNCTION 'ALV_TREE_PRINT_SERVER' EXPORTING i_hierarchy_header = ld_i_hierarchy_header i_hierarchy_width = ld_i_hierarchy_width it_checked_items = ld_it_checked_items * i_oo_alv = ld_i_oo_alv i_print_preview = ld_i_print_preview * it_qinfo = ld_it_qinfo TABLES it_items = it_it_items it_nodes = it_it_nodes it_level = it_it_level it_exp_nodes = it_it_exp_nodes it_fieldcatalog = it_it_fieldcatalog it_list_commentary = it_it_list_commentary . " ALV_TREE_PRINT_SERVER
IF SY-SUBRC EQ 0. "All OK 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_i_hierarchy_header  TYPE TV_HEADING ,
it_it_items  TYPE STANDARD TABLE OF LVC_T_ITEM ,
wa_it_items  LIKE LINE OF it_it_items,
ld_i_hierarchy_width  TYPE INT4 ,
it_it_nodes  TYPE STANDARD TABLE OF LVC_T_NODE ,
wa_it_nodes  LIKE LINE OF it_it_nodes,
ld_it_checked_items  TYPE LVC_T_CHIT ,
it_it_level  TYPE STANDARD TABLE OF LVC_T_PLVL ,
wa_it_level  LIKE LINE OF it_it_level,
ld_i_oo_alv  TYPE STRING ,
it_it_exp_nodes  TYPE STANDARD TABLE OF LVC_T_NKEY ,
wa_it_exp_nodes  LIKE LINE OF it_it_exp_nodes,
ld_i_print_preview  TYPE AS4FLAG ,
it_it_fieldcatalog  TYPE STANDARD TABLE OF LVC_T_FCAT ,
wa_it_fieldcatalog  LIKE LINE OF it_it_fieldcatalog,
ld_it_qinfo  TYPE LVC_T_QINF ,
it_it_list_commentary  TYPE STANDARD TABLE OF SLIS_T_LISTHEADER ,
wa_it_list_commentary  LIKE LINE OF it_it_list_commentary.

ld_i_hierarchy_header = 'Check type of data required'.

"populate fields of struture and append to itab
append wa_it_items to it_it_items.
ld_i_hierarchy_width = 'Check type of data required'.

"populate fields of struture and append to itab
append wa_it_nodes to it_it_nodes.
ld_it_checked_items = 'Check type of data required'.

"populate fields of struture and append to itab
append wa_it_level to it_it_level.
ld_i_oo_alv = 'some text here'.

"populate fields of struture and append to itab
append wa_it_exp_nodes to it_it_exp_nodes.
ld_i_print_preview = 'Check type of data required'.

"populate fields of struture and append to itab
append wa_it_fieldcatalog to it_it_fieldcatalog.
ld_it_qinfo = 'Check type of data required'.

"populate fields of struture and append to itab
append wa_it_list_commentary to it_it_list_commentary.

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_TREE_PRINT_SERVER or its description.