TYPE-POOLS: slis.
TYPES: BEGIN OF t_t002,
checkbox TYPE c,
spras    TYPE t002-spras,
sptxt    TYPE t002t-sptxt,
END OF t_t002.
DATA : lt_t002 TYPE STANDARD TABLE OF t_t002,
lt_t005 TYPE STANDARD TABLE OF t005.
TYPES: t_fieldcat  TYPE slis_fieldcat_alv,
t_layout    TYPE slis_layout_alv.
DATA : ls_fieldcat TYPE t_fieldcat,
ls_layout   TYPE t_layout.
DATA lt_fieldcat TYPE STANDARD TABLE OF t_fieldcat.
DATA lv_program TYPE sy-repid.
CLEAR: ls_fieldcat, lt_fieldcat[].
ls_fieldcat-fieldname = ‘SPRAS’.
ls_fieldcat-tabname   = ‘LT_T002′.
ls_fieldcat-seltext_m = ‘Dil Anahtarı’.
APPEND ls_fieldcat TO lt_fieldcat.
CLEAR ls_fieldcat.
ls_fieldcat-fieldname = ‘SPTXT’.
ls_fieldcat-tabname   = ‘LT_T002′.
ls_fieldcat-seltext_m = ‘Tanım’.
APPEND ls_fieldcat TO lt_fieldcat.
SELECT a~spras sptxt
FROM t002 AS a
INNER JOIN t002t AS b ON a~spras = b~sprsl
INTO CORRESPONDING FIELDS OF TABLE lt_t002
WHERE b~spras = sy-langu.
CALL FUNCTION ‘REUSE_ALV_POPUP_TO_SELECT’
EXPORTING
i_title              = ‘Seçim yapınız’
i_tabname            = ‘LT_T002′
i_checkbox_fieldname = ‘CHECKBOX’
it_fieldcat          = lt_fieldcat
i_callback_program   = lv_program
TABLES
t_outtab             = lt_t002.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
CHECK sy-subrc =  0.
DELETE lt_t002 WHERE checkbox NE ‘X’.
SELECT *
FROM t005
INTO CORRESPONDING FIELDS OF TABLE lt_t005
FOR ALL ENTRIES IN lt_t002
WHERE spras = lt_t002-spras.
lv_program = sy-repid.
CALL FUNCTION ‘REUSE_ALV_GRID_DISPLAY’
EXPORTING
i_callback_program = lv_program
i_structure_name   = ‘T005′
TABLES
t_outtab           = lt_t005.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.


Serkan AKKAVAK
Bilgisayar Mühendisi
serkurumsal@yandex.com