*&---------------------------------------------------------------------*
*& Report ZSSR_ALV_LIST
*&
*&---------------------------------------------------------------------*
*&
*&
*&---------------------------------------------------------------------*
REPORT zsan_alv_list_display.
TYPE-POOLS: slis.
TABLES: mara.
DATA: g_t_mara TYPE mara OCCURS 0 WITH HEADER LINE.
* ALV specific data objects
DATA : g_f_repid LIKE sy-repid.
DATA : g_t_fieldcat TYPE slis_t_fieldcat_alv.
DATA : g_r_fieldcat TYPE slis_fieldcat_alv.
DATA : g_t_events TYPE slis_t_event.
DATA : g_r_events TYPE slis_alv_event.
DATA : g_r_layout TYPE slis_layout_alv.
DATA : g_f_callback_user_command TYPE slis_formname.
DATA : g_f_callback_pf_status_set TYPE slis_formname.
DATA : g_r_x_variant LIKE disvariant.
DATA : g_r_variant LIKE disvariant.
DATA : g_f_exit(1) TYPE c.
DATA : g_f_save(1) TYPE c.
SELECT-OPTIONS: s_matnr FOR mara-matnr.
START-OF-SELECTION.
PERFORM get_data.
PERFORM display_data.
*&---------------------------------------------------------------------*
*& Form GET_DATA
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
FORM get_data .
SELECT *
INTO TABLE g_t_mara
FROM mara
WHERE matnr IN s_matnr.
ENDFORM. " GET_DATA
*&---------------------------------------------------------------------*
*& Form DISPLAY_DATA
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* --> p1 text
* <-- p2 text
*----------------------------------------------------------------------*
FORM display_data .
g_f_repid = sy-repid.
* Attributes for layout
g_r_layout-zebra = 'X'.
* g_r_layout-min_linesize = 119.
g_r_layout-colwidth_optimize = 'X'.
g_r_layout-f2code = '&ETA'.
g_r_layout-detail_initial_lines = 'X'.
g_r_layout-get_selinfos = 'X'.
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
* I_INTERFACE_CHECK = ' '
* I_BYPASSING_BUFFER =
* I_BUFFER_ACTIVE = ' '
i_callback_program = g_f_repid
* I_CALLBACK_PF_STATUS_SET = ' '
* I_CALLBACK_USER_COMMAND = ' '
i_structure_name = 'MARA'
is_layout = g_r_layout
* IT_FIELDCAT =
* IT_EXCLUDING =
* IT_SPECIAL_GROUPS =
* IT_SORT =
* IT_FILTER =
* IS_SEL_HIDE =
* I_DEFAULT = 'X'
* I_SAVE = ' '
* IS_VARIANT =
* IT_EVENTS =
* IT_EVENT_EXIT =
* IS_PRINT =
* IS_REPREP_ID =
* I_SCREEN_START_COLUMN = 0
* I_SCREEN_START_LINE = 0
* I_SCREEN_END_COLUMN = 0
* I_SCREEN_END_LINE = 0
* IR_SALV_LIST_ADAPTER =
* IT_EXCEPT_QINFO =
* I_SUPPRESS_EMPTY_DATA = ABAP_FALSE
* IMPORTING
* E_EXIT_CAUSED_BY_CALLER =
* ES_EXIT_CAUSED_BY_USER =
TABLES
t_outtab = g_t_mara
EXCEPTIONS
program_error = 1
OTHERS = 2
.
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDFORM. " DISPLAY_DATA
*& Report ZSSR_ALV_LIST
*&
*&---------------------------------------------------------------------*
*&
*&
*&---------------------------------------------------------------------*
REPORT zsan_alv_list_display.
TYPE-POOLS: slis.
TABLES: mara.
DATA: g_t_mara TYPE mara OCCURS 0 WITH HEADER LINE.
* ALV specific data objects
DATA : g_f_repid LIKE sy-repid.
DATA : g_t_fieldcat TYPE slis_t_fieldcat_alv.
DATA : g_r_fieldcat TYPE slis_fieldcat_alv.
DATA : g_t_events TYPE slis_t_event.
DATA : g_r_events TYPE slis_alv_event.
DATA : g_r_layout TYPE slis_layout_alv.
DATA : g_f_callback_user_command TYPE slis_formname.
DATA : g_f_callback_pf_status_set TYPE slis_formname.
DATA : g_r_x_variant LIKE disvariant.
DATA : g_r_variant LIKE disvariant.
DATA : g_f_exit(1) TYPE c.
DATA : g_f_save(1) TYPE c.
SELECT-OPTIONS: s_matnr FOR mara-matnr.
START-OF-SELECTION.
PERFORM get_data.
PERFORM display_data.
*&---------------------------------------------------------------------*
*& Form GET_DATA
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
FORM get_data .
SELECT *
INTO TABLE g_t_mara
FROM mara
WHERE matnr IN s_matnr.
ENDFORM. " GET_DATA
*&---------------------------------------------------------------------*
*& Form DISPLAY_DATA
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* --> p1 text
* <-- p2 text
*----------------------------------------------------------------------*
FORM display_data .
g_f_repid = sy-repid.
* Attributes for layout
g_r_layout-zebra = 'X'.
* g_r_layout-min_linesize = 119.
g_r_layout-colwidth_optimize = 'X'.
g_r_layout-f2code = '&ETA'.
g_r_layout-detail_initial_lines = 'X'.
g_r_layout-get_selinfos = 'X'.
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
* I_INTERFACE_CHECK = ' '
* I_BYPASSING_BUFFER =
* I_BUFFER_ACTIVE = ' '
i_callback_program = g_f_repid
* I_CALLBACK_PF_STATUS_SET = ' '
* I_CALLBACK_USER_COMMAND = ' '
i_structure_name = 'MARA'
is_layout = g_r_layout
* IT_FIELDCAT =
* IT_EXCLUDING =
* IT_SPECIAL_GROUPS =
* IT_SORT =
* IT_FILTER =
* IS_SEL_HIDE =
* I_DEFAULT = 'X'
* I_SAVE = ' '
* IS_VARIANT =
* IT_EVENTS =
* IT_EVENT_EXIT =
* IS_PRINT =
* IS_REPREP_ID =
* I_SCREEN_START_COLUMN = 0
* I_SCREEN_START_LINE = 0
* I_SCREEN_END_COLUMN = 0
* I_SCREEN_END_LINE = 0
* IR_SALV_LIST_ADAPTER =
* IT_EXCEPT_QINFO =
* I_SUPPRESS_EMPTY_DATA = ABAP_FALSE
* IMPORTING
* E_EXIT_CAUSED_BY_CALLER =
* ES_EXIT_CAUSED_BY_USER =
TABLES
t_outtab = g_t_mara
EXCEPTIONS
program_error = 1
OTHERS = 2
.
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDFORM. " DISPLAY_DATA
0 comments:
Post a Comment