Alv , standart rapor

*&———————————————————————*
*& Report ZSTANDART
*&
*&———————————————————————*
*&
*&
*&———————————————————————*

REPORT ZSTANDART.

TABLES : ztest.

DATA: er_layout TYPE slis_layout_alv,
er_fieldcat TYPE slis_t_fieldcat_alv,
er_sp_group TYPE slis_t_sp_group_alv,
e_save(1) TYPE c,
e_variant LIKE disvariant,
er_events TYPE slis_t_event,
ex_fieldcat TYPE slis_t_fieldcat_alv,
ex_sp_group TYPE slis_t_sp_group_alv,
ex_layout TYPE slis_layout_alv,
ex_events TYPE slis_t_event.
DATA: gt_list_top_of_page TYPE slis_t_listheader.
DATA: t_sort TYPE slis_t_sortinfo_alv WITH HEADER LINE ,
is_print TYPE slis_print_alv ,answer.
*
*
DATA: BEGIN OF itab_alv OCCURS 0,
chk.
INCLUDE STRUCTURE ztest.
DATA: END OF itab_alv.
*
*
SELECTION-SCREEN BEGIN OF BLOCK islemtipi WITH FRAME TITLE
text-002.

PARAMETERS:
rbtnyeni RADIOBUTTON GROUP sec,
rbtnlist RADIOBUTTON GROUP sec.
SELECTION-SCREEN END OF BLOCK islemtipi.
*
*
SELECTION-SCREEN BEGIN OF BLOCK iadetipi WITH FRAME TITLE
text-001.

PARAMETERS:
rbtnseh RADIOBUTTON GROUP isl,
rbtnfin RADIOBUTTON GROUP isl.
SELECTION-SCREEN END OF BLOCK iadetipi.
*
SELECTION-SCREEN BEGIN OF BLOCK sorgu WITH FRAME TITLE
text-003.
SELECT-OPTIONS:
sno FOR ztest-no,
starih FOR ztest-tarih.
SELECTION-SCREEN END OF BLOCK sorgu.
*

START-OF-SELECTION.

IF rbtnyeni EQ ‘X’.
DO 10 TIMES.
append itab_alv.
ENDDO.
ELSEIF rbtnlist EQ ‘X’.


ENDIF.

FORM display_data.
DATA list_function TYPE rs38l-name.
PERFORM e03_eventtab_build USING er_events[].
PERFORM e04_comment_build USING gt_list_top_of_page[].
PERFORM get_format.
PERFORM alv_alv.
ENDFORM.

FORM e03_eventtab_build USING e03_lt_events TYPE slis_t_event.
DATA: ls_event TYPE slis_alv_event.
CALL FUNCTION ‘REUSE_ALV_EVENTS_GET’
EXPORTING
i_list_type = 0
IMPORTING
et_events = e03_lt_events.
READ TABLE e03_lt_events WITH KEY name = slis_ev_top_of_page INTO
ls_event.
IF sy-subrc = 0.
MOVE ‘SAYFA_BASI’ TO ls_event-form.
APPEND ls_event TO e03_lt_events.
ENDIF.
ENDFORM. “e03_eventtab_build

FORM sayfa_basi.
CALL FUNCTION ‘REUSE_ALV_COMMENTARY_WRITE’
EXPORTING
it_list_commentary = gt_list_top_of_page.
ENDFORM. “sayfa_basi

FORM e04_comment_build USING e04_lt_top_of_page TYPE
slis_t_listheader.
DATA: ls_line TYPE slis_listheader.
FREE: e04_lt_top_of_page.
CLEAR ls_line.
ls_line-typ = ‘H’.
ls_line-info = sy-title.
APPEND ls_line TO e04_lt_top_of_page.
CLEAR ls_line.
ENDFORM. ” e04_comment_build

FORM get_format.
DATA: lv_itab TYPE slis_tabname.
REFRESH er_fieldcat[].
lv_itab = ‘ITAB_ALV’.

CALL FUNCTION ‘REUSE_ALV_FIELDCATALOG_MERGE’
EXPORTING
i_program_name = sy-repid
i_internal_tabname = lv_itab
i_inclname = sy-repid
CHANGING
ct_fieldcat = er_fieldcat
EXCEPTIONS
inconsistent_interface = 1
program_error = 2
OTHERS = 3.
PERFORM fieldcat_modify USING er_fieldcat[].
ENDFORM. “get_format

FORM fieldcat_modify USING u_er_fieldcat TYPE slis_t_fieldcat_alv.
DATA: xs_fieldcat TYPE slis_fieldcat_alv.
LOOP AT u_er_fieldcat INTO xs_fieldcat.
CASE xs_fieldcat-fieldname.
xs_fieldcat-edit = ‘X’.

xs_fieldcat-seltext_l = ‘Açıklama’.
xs_fieldcat-seltext_m = ‘Açıklama’.
xs_fieldcat-seltext_s = ‘Açıkl’.
xs_fieldcat-outputlen = 100.
WHEN OTHERS.
*

ENDCASE.
xs_fieldcat-reptext_ddic = xs_fieldcat-seltext_l.
xs_fieldcat-seltext_m = xs_fieldcat-seltext_l.
xs_fieldcat-seltext_s = xs_fieldcat-seltext_l.
MODIFY u_er_fieldcat FROM xs_fieldcat.
ENDLOOP.
ENDFORM. “fieldcat_modify

FORM alv_alv.
* e_variant-variant = p_vari.
* er_layout-zebra = ‘X’.
er_layout-box_fieldname = ‘CHK’.
* er_layout-info_fieldname = ‘COLOR’.
* er_layout-colwidth_optimize = ‘X’.
CALL FUNCTION ‘REUSE_ALV_GRID_DISPLAY’
EXPORTING
i_callback_program = sy-repid
i_callback_pf_status_set = ‘STATUS’
i_callback_user_command = ‘USER_COMMAND’
it_fieldcat = er_fieldcat[]
it_events = er_events[]
is_layout = er_layout
is_print = is_print
it_special_groups = er_sp_group
i_default = ‘X’
i_save = ‘A’
TABLES
t_outtab = itab_alv
EXCEPTIONS
program_error = 1
OTHERS = 2.
ENDFORM. “alv_alv

FORM user_command USING r_ucomm TYPE sy-ucomm
rs_selfield TYPE slis_selfield .
DATA: l_ucomm TYPE sy-ucomm.
DATA: l_grid TYPE REF TO cl_gui_alv_grid.
DATA: ans.
DATA: lt_ret LIKE TABLE OF bapireturn WITH HEADER LINE.
DATA: lt_item LIKE TABLE OF bapiebanc WITH HEADER LINE,
lv_banfn TYPE banfn.
RANGES:
sel_obj FOR objs-objectname,
sel_type FOR objs-objecttype.

CALL FUNCTION ‘GET_GLOBALS_FROM_SLVC_FULLSCR’
IMPORTING
e_grid = l_grid.
rs_selfield-refresh = ‘X’.
l_ucomm = r_ucomm .
r_ucomm = ‘&REFRESH’.
CALL METHOD l_grid->set_function_code
CHANGING
c_ucomm = r_ucomm.

r_ucomm = ‘&REFRESH’.
CALL METHOD l_grid->set_function_code
CHANGING
c_ucomm = r_ucomm.

ENDFORM. ” user_command

FORM status USING extab TYPE slis_t_extab.
SET PF-STATUS ‘STATUS’.
ENDFORM. “status

You may also like...

Bir cevap yazın

E-posta hesabınız yayımlanmayacak. Gerekli alanlar * ile işaretlenmişlerdir

This site uses Akismet to reduce spam. Learn how your comment data is processed.