Вы находитесь на странице: 1из 5

CL_SALV_TABLE AVL-.

REUSE_ALV_LIST_DISPLAY
CL_GUI_ALV_GRID.

.. , ,
, , LVC_FIELDCATALOG_MERGE.
SAP , ,
ALV- CL_SALV_TABLE.
, ,
, ,
,
( MKPF
):
* , + MKPF
DATA: BEGIN OF gt_mkpf OCCURS 10,
sel(1) TYPE c.
INCLUDE STRUCTURE mkpf.
DATA: my_field(5) TYPE c,
END OF gt_mkpf.
* cl_salv_table, ALV
DATA: gc_alv_table TYPE REF TO cl_salv_table.
START-OF-SELECTION.
* MKPF
SELECT * INTO CORRESPONDING FIELDS OF TABLE gt_mkpf FROM mkpf.
*
cl_salv_table=>factory( IMPORTING r_salv_table = gc_alv_table
CHANGING t_table = gt_mkpf[] ).
* ALV-
gc_alv_table->display( ).

, ALV,
ALV-1.png .

1: ALV-1

www.sapforum.biz


. ,
. ,
. ,
. ,
,
, ,
, ALV-2.png .

2: ALV-2.png

,
, ,
.
GET_COLUMNS, ,
, ,
,
.
DATA: gc_columns TYPE REF TO cl_salv_columns_table,
gc_colwork TYPE REF TO cl_salv_column_table.
*
gc_columns = gc_alv_table->get_columns( ).
*
gc_colwork ?= gc_columns->get_column( 'SEL' ).
*
gc_colwork->set_long_text( ' ' ).
gc_colwork->set_medium_text( '' ).
gc_colwork->set_short_text( '' ).
* , SALV_DO_ALIGNMENT
gc_colwork->set_alignment( '3' ).
*
gc_colwork ?= gc_columns->get_column( 'MY_DATA' ).
* , SALV_DO_ALIGNMENT
gc_colwork->set_alignment( '1' ).

, ,
,
.
SE24. , SEL
, ALV-3.png .

www.sapforum.biz

3: ALV3-png

, ,
. ,
.
DATA: gc_sorts type ref to cl_salv_sorts.
*
gc_sorts = gc_alv_table->get_sorts( ).
*
gc_sorts->add_sort( columnname = 'MBLNR' sequence = '2' ).
gc_sorts->add_sort( columnname = 'MJAHR' sequence = '2' ).

,
,
, ALV-4.png .
, SE24
CL_SALV_SORTS.

4: ALV-4.png

, .
GET_FUNCTIONS,
. , , ,
. ALV-,
. SET_ALL,
.
DATA: gc_functions TYPE REF TO cl_salv_functions.
*
gc_functions = gc_alv_table->get_functions( ).
gc_functions->set_all( 'X' ).

ALV-5.png .
, , ,
,
.

www.sapforum.biz

5: ALV-5.png

.
, ALV-5.png
, .
.
.
DATA: gc_display TYPE REF TO cl_salv_display_settings.
*
gc_display = gc_alv_table->get_display_settings( ).
gc_display->set_list_header( ' ' ).

ALV-6.png

6: ALV-6.png

,
.
DATA: g_layout TYPE REF TO cl_salv_layout,
keys TYPE salv_s_layout_key.
*
gc_layout = gc_alv_table->get_layout( ).
keys-report = sy-repid.
gc_layout->set_key( keys ).
gc_layout->set_save_restriction( 3 ).

ALV-7.png ,
. .

7: ALV-7.png

www.sapforum.biz

, ,
,
.
DATA: gc_aggr TYPE REF TO cl_salv_aggregations.
*
gc_aggr = gc_alv_table->get_aggregations( ).
gc_aggr->add_aggregation( 'FRATH' ).

,
, ,
, . ,
, , ..
:
gc_sorts->add_sort( columnname = 'MJAHR' sequence = '2' subtotal = 'X' ).

8: ALV-8.png
,
. ,
, -
, ,
.

www.sapforum.biz

Оценить