메뉴 건너뛰기

SAP 한국 커뮤니티

REPORT z17_21 .

sapjoy 2012.08.02 05:46 조회 수 : 2512

REPORT  z17_21                                 .

 

TYPES: BEGIN OF g_type_itab.

                          INCLUDE TYPE sflight.

                      TYPES:   exception   TYPE char1,

             END OF g_type_itab.

 

DATA gt_itab    TYPE TABLE OF g_type_itab.

DATA gs_itab    TYPE g_type_itab.

DATA gr_table   TYPE REF TO cl_salv_table.

 

SELECT * FROM sflight INTO CORRESPONDING FIELDS OF TABLE gt_itab

UP TO 25 ROWS.

 

LOOP AT gt_itab INTO gs_itab.

             IF gs_itab-seatsocc >= 90.

                           gs_itab-exception = '1'.

             ELSEIF gs_itab-seatsocc >= 50.

                           gs_itab-exception = '2'.

             ELSE.

                           gs_itab-exception = '3'.

             ENDIF.

 

             MODIFY gt_itab FROM gs_itab.

ENDLOOP.

 

cl_salv_table=>factory(

             IMPORTING

                          r_salv_table = gr_table

             CHANGING

                          t_table      = gt_itab ).

 

DATA: lr_columns TYPE REF TO cl_salv_columns_table,

                          lr_column  TYPE REF TO cl_salv_column_table.

 

lr_columns = gr_table->get_columns( ).

lr_columns->set_exception_column( 'EXCEPTION' ).

 

lr_column ?= lr_columns->get_column( 'EXCEPTION' ).

lr_column->set_short_text( 'MY EXCEPT' ).

 

DATA: lr_functional_settings TYPE REF TO cl_salv_functional_settings.

 

lr_functional_settings = gr_table->get_functional_settings( ).

 

DATA: lr_tooltips TYPE REF TO cl_salv_tooltips.

 

lr_tooltips = lr_functional_settings->get_tooltips( ).

 

lr_tooltips->add_tooltip(

             type       = cl_salv_tooltip=>c_type_exception

             value      = '1').

 

lr_tooltips->add_tooltip(

             type       = cl_salv_tooltip=>c_type_exception

             value      = '2').

 

lr_tooltips->add_tooltip(

             type       = cl_salv_tooltip=>c_type_exception

             value      = '3').

 

gr_table->display( ).
번호 제목 글쓴이 날짜 조회 수
» REPORT z17_21 . sapjoy 2012.08.02 2512
650 REPORT z17_20 sapjoy 2012.08.02 2907
649 REPORT z17_19 sapjoy 2012.08.02 2451
648 REPORT z17_18 . sapjoy 2012.08.02 2353
647 REPORT z17_17 . sapjoy 2012.08.02 2212
646 REPORT z17_16 . sapjoy 2012.08.02 2196
645 REPORT z17_15 . sapjoy 2012.08.02 2485
644 REPORT z17_14 . sapjoy 2012.08.02 1717
643 REPORT z17_13 . sapjoy 2012.08.02 1436
642 REPORT z17_12 . sapjoy 2012.08.02 969
641 REPORT z17_11 . sapjoy 2012.08.02 940
640 REPORT z17_10 . sapjoy 2012.08.02 990
639 REPORT z17_09 . sapjoy 2012.08.02 964
638 REPORT z17_08 . sapjoy 2012.08.02 1000
637 REPORT z17_07 . sapjoy 2012.08.02 1092
636 REPORT z17_06 . sapjoy 2012.08.02 869
635 REPORT z17_05 . sapjoy 2012.08.02 1089
634 REPORT z17_04 . sapjoy 2012.08.02 1030
633 REPORT z17_03. sapjoy 2012.08.02 917
632 REPORT z17_02 . sapjoy 2012.08.02 909