hi gurus,
Kindly check my code below because my alv program doesn't go to the secondary alv list which was to appear after i double-click it.
Points will be awarded to those who can help.
Thanks a lot.
REPORT ZMY_INTERACTIVE_ALV no standard page heading.
tables: zprod_view,
zmytable.
type-pools: slis.
data: t_prodnum type zprod_view-prodnum,
g_repid type sy-repid,
t_fieldcat type slis_t_fieldcat_alv,
g_fieldcat like line of t_fieldcat,
t_eventcat type slis_t_event,
g_eventcat like line of t_eventcat.
data: g_tab type standard table of zprod_view,
wa_tab like line of g_tab.
data: j_tab1 type standard table of zmytable,
wa_tab1 like line of j_tab1.
select-options: g_prod for zprod_view-prodnum.
start-of-selection.
select * from zprod_view into table g_tab where
prodnum in g_prod.
g_repid = sy-repid.
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = g_repid
I_CALLBACK_USER_COMMAND = 'push'
I_STRUCTURE_NAME = 'zprod_view'
TABLES
T_OUTTAB = g_tab.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
form push using command like sy-ucomm
selfield type slis_selfield.
read table j_tab1 into wa_tab1 index selfield-tabindex.
case command.
when '&IC1'.
select * from zmytable into table j_tab1
where prodnum = wa_tab-prodnum.
g_repid = sy-repid.
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
I_STRUCTURE_NAME = 'zmytable'
CHANGING
ct_fieldcat = t_fieldcat
EXCEPTIONS
INCONSISTENT_INTERFACE = 1
PROGRAM_ERROR = 2
OTHERS = 3
.
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = g_repid
IT_FIELDCAT = t_fieldcat
IT_EVENTS = t_eventcat
TABLES
t_outtab = j_tab1.
endcase.
endform.