REPORT zmus_alv .
*INTERNAL TABLO TANIMI
DATA BEGIN OF ialv OCCURS 0.
INCLUDE STRUCTURE zmfatura.
DATA END OF ialv.
* ALV İÇİN DATA TANIMI
TYPE-POOLS: slis.
DATA: gt_fieldcat TYPE slis_t_fieldcat_alv.
DATA: g_repid LIKE sy-repid.
* TABLE -> INTERNAL TABLO DATA AKTARIMI
PERFORM select_data.
* ALV İÇİN KATALOG INITIALIZATION
PERFORM fieldcat_init_01 USING gt_fieldcat[].
* SHOW ALV
PERFORM show.
*---------------------------------------------------------------------*
* FORM fieldcat_init_01 *
*---------------------------------------------------------------------*
FORM fieldcat_init_01
USING rt_fieldcat TYPE slis_t_fieldcat_alv.
DATA: ls_fieldcat TYPE slis_fieldcat_alv.
DATA: pos TYPE i VALUE 1.
CLEAR ls_fieldcat.
pos = pos + 1.
ls_fieldcat-col_pos = pos.
ls_fieldcat-fieldname = 'BUKRS'.
ls_fieldcat-seltext_m = ' ÞÝRKET KODU '.
APPEND ls_fieldcat TO rt_fieldcat.
CLEAR ls_fieldcat.
pos = pos + 1.
ls_fieldcat-col_pos = pos.
ls_fieldcat-fieldname = 'WERKS'.
ls_fieldcat-seltext_m = ' PERSONEL ALANI '.
APPEND ls_fieldcat TO rt_fieldcat.
CLEAR ls_fieldcat.
pos = pos + 1.
ls_fieldcat-col_pos = pos.
ls_fieldcat-fieldname = 'BTRTL'.
ls_fieldcat-seltext_m = ' PERSONEL ALT ALANI '.
APPEND ls_fieldcat TO rt_fieldcat.
CLEAR ls_fieldcat.
pos = pos + 1.
ls_fieldcat-col_pos = pos.
ls_fieldcat-currency = 'TRL'.
ls_fieldcat-outputlen = 20.
ls_fieldcat-fieldname = 'M100'.
ls_fieldcat-seltext_m = ' MAAÞ '.
APPEND ls_fieldcat TO rt_fieldcat.
ENDFORM. "fieldcat_init_01
*&---------------------------------------------------------------------*
*& Form SHOW
*&---------------------------------------------------------------------*
FORM show .
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = g_repid
it_fieldcat = gt_fieldcat[]
TABLES
t_outtab = ialv.
ENDFORM. " SHOW
*&---------------------------------------------------------------------*
*& Form SELECT_DATA
*&---------------------------------------------------------------------*
FORM select_data .
SELECT * FROM zmfatura INTO TABLE ialv.
ENDFORM. " SELECT_DATA
*INTERNAL TABLO TANIMI
DATA BEGIN OF ialv OCCURS 0.
INCLUDE STRUCTURE zmfatura.
DATA END OF ialv.
* ALV İÇİN DATA TANIMI
TYPE-POOLS: slis.
DATA: gt_fieldcat TYPE slis_t_fieldcat_alv.
DATA: g_repid LIKE sy-repid.
* TABLE -> INTERNAL TABLO DATA AKTARIMI
PERFORM select_data.
* ALV İÇİN KATALOG INITIALIZATION
PERFORM fieldcat_init_01 USING gt_fieldcat[].
* SHOW ALV
PERFORM show.
*---------------------------------------------------------------------*
* FORM fieldcat_init_01 *
*---------------------------------------------------------------------*
FORM fieldcat_init_01
USING rt_fieldcat TYPE slis_t_fieldcat_alv.
DATA: ls_fieldcat TYPE slis_fieldcat_alv.
DATA: pos TYPE i VALUE 1.
CLEAR ls_fieldcat.
pos = pos + 1.
ls_fieldcat-col_pos = pos.
ls_fieldcat-fieldname = 'BUKRS'.
ls_fieldcat-seltext_m = ' ÞÝRKET KODU '.
APPEND ls_fieldcat TO rt_fieldcat.
CLEAR ls_fieldcat.
pos = pos + 1.
ls_fieldcat-col_pos = pos.
ls_fieldcat-fieldname = 'WERKS'.
ls_fieldcat-seltext_m = ' PERSONEL ALANI '.
APPEND ls_fieldcat TO rt_fieldcat.
CLEAR ls_fieldcat.
pos = pos + 1.
ls_fieldcat-col_pos = pos.
ls_fieldcat-fieldname = 'BTRTL'.
ls_fieldcat-seltext_m = ' PERSONEL ALT ALANI '.
APPEND ls_fieldcat TO rt_fieldcat.
CLEAR ls_fieldcat.
pos = pos + 1.
ls_fieldcat-col_pos = pos.
ls_fieldcat-currency = 'TRL'.
ls_fieldcat-outputlen = 20.
ls_fieldcat-fieldname = 'M100'.
ls_fieldcat-seltext_m = ' MAAÞ '.
APPEND ls_fieldcat TO rt_fieldcat.
ENDFORM. "fieldcat_init_01
*&---------------------------------------------------------------------*
*& Form SHOW
*&---------------------------------------------------------------------*
FORM show .
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = g_repid
it_fieldcat = gt_fieldcat[]
TABLES
t_outtab = ialv.
ENDFORM. " SHOW
*&---------------------------------------------------------------------*
*& Form SELECT_DATA
*&---------------------------------------------------------------------*
FORM select_data .
SELECT * FROM zmfatura INTO TABLE ialv.
ENDFORM. " SELECT_DATA
Serkan AKKAVAK
Bilgisayar Mühendisi
serkurumsal@yandex.com
Social Plugin