‎2009 Jul 30 8:03 AM
Dear Friends,
How to get a different header name and different logo in secondary list in an ALV interactive reports. Thank you
‎2009 Jul 30 8:16 AM
HI,
use the below code for reference.
type-pools : slis, icon.
data: begin of t_itab occurs 0,
kunnr type kunnr,
waers type waers,
dmbtr type dmbtr,
end of t_itab.
data: w_fieldcat type slis_fieldcat_alv,
it_fieldcat type slis_t_fieldcat_alv,
t_sort type slis_t_sortinfo_alv,
w_sort type slis_sortinfo_alv,
w_layout type slis_layout_alv,
w_events type slis_alv_event,
t_events type slis_T_event.
t_itab-kunnr = '0001'.
t_itab-waers = 'USD'.
t_itab-dmbtr = '100.00'.
append t_itab.
t_itab-kunnr = '0001'.
t_itab-waers = 'USD'.
t_itab-dmbtr = '200.00'.
append t_itab.
t_itab-kunnr = '0002'.
t_itab-waers = 'USD'.
t_itab-dmbtr = '100.00'.
append t_itab.
w_fieldcat-fieldname = 'KUNNR'.
w_fieldcat-tabname = 't_itab'.
append w_fieldcat to it_fieldcat.
clear w_fieldcat.
w_fieldcat-fieldname = 'WAERS'.
w_fieldcat-tabname = 't_itab'.
append w_fieldcat to it_fieldcat.
clear w_fieldcat.
w_fieldcat-fieldname = 'DMBTR'.
w_fieldcat-tabname = 't_itab'.
w_fieldcat-do_sum = 'X'.
append w_fieldcat to it_fieldcat.
clear w_fieldcat.
*
w_sort-fieldname = 'KUNNR'.
w_sort-up = 'X'.
w_sort-group = '*'.
w_sort-subtot = 'X'.
append w_sort to t_sort.
w_events-name = 'TOP_OF_PAGE'.
w_events-form = 'TOP_OF_PAGE'.
append w_events to t_events.
clear w_events.
w_events-name = 'USER_COMMAND'.
w_events-form = 'USER_COMMAND'.
append w_events to t_events.
clear w_events.
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
i_callback_program = sy-repid
it_fieldcat = it_fieldcat
it_sort = t_sort
is_layout = w_layout
it_events = t_events
TABLES
t_outtab = t_itab
EXCEPTIONS
program_error = 1
OTHERS = 2.
IF sy-subrc = 0.
ENDIF.
form top_of_page.
data: w_value type char4.
w_value = '@5B@'.
data: t_list_header type SLIS_T_LISTHEADER ,
w_list_header type slis_listheader.
w_list_header-typ = 'S'.
w_list_header-info = 'First List'.
append w_list_header to t_list_header.
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
it_list_commentary = t_list_header
I_LOGO =
I_END_OF_LIST_GRID =
I_ALV_FORM = 'X'
.
endform.
FORM user_command USING r_ucomm LIKE sy-ucomm rs_selfield TYPE
slis_selfield."#EC CALLED
CASE r_ucomm.
WHEN '&IC1' .
perform second_list.
ENDCASE.
ENDFORM.
FORM second_list.
refresh : t_itab, t_events, it_fieldcat.
t_itab-kunnr = '0003'.
t_itab-waers = 'USD'.
t_itab-dmbtr = '100.00'.
append t_itab.
t_itab-kunnr = '0004'.
t_itab-waers = 'USD'.
t_itab-dmbtr = '200.00'.
append t_itab.
t_itab-kunnr = '0005'.
t_itab-waers = 'USD'.
t_itab-dmbtr = '100.00'.
append t_itab.
t_itab-kunnr = '0006'.
t_itab-waers = 'USD'.
t_itab-dmbtr = '400.00'.
append t_itab.
t_itab-kunnr = '0006'.
t_itab-waers = 'USD'.
t_itab-dmbtr = '300.00'.
append t_itab.
t_itab-kunnr = '0004'.
t_itab-waers = 'USD'.
t_itab-dmbtr = '100.00'.
append t_itab.
w_fieldcat-fieldname = 'KUNNR'.
w_fieldcat-tabname = 't_itab'.
append w_fieldcat to it_fieldcat.
clear w_fieldcat.
w_fieldcat-fieldname = 'WAERS'.
w_fieldcat-tabname = 't_itab'.
append w_fieldcat to it_fieldcat.
clear w_fieldcat.
w_fieldcat-fieldname = 'DMBTR'.
w_fieldcat-tabname = 't_itab'.
w_fieldcat-do_sum = 'X'.
append w_fieldcat to it_fieldcat.
clear w_fieldcat.
w_events-name = 'TOP_OF_PAGE'.
w_events-form = 'TOP_OF_PAGE1'.
append w_events to t_events.
clear w_events.
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
i_callback_program = sy-repid
it_fieldcat = it_fieldcat
it_sort = t_sort
is_layout = w_layout
it_events = t_events
TABLES
t_outtab = t_itab
EXCEPTIONS
program_error = 1
OTHERS = 2.
IF sy-subrc = 0.
ENDIF.
ENDFORM.
form top_of_page1.
data: w_value type char4.
w_value = '@5B@'.
data: t_list_header type SLIS_T_LISTHEADER ,
w_list_header type slis_listheader.
w_list_header-typ = 'S'.
w_list_header-info = 'Second List'.
append w_list_header to t_list_header.
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
it_list_commentary = t_list_header
I_LOGO =
I_END_OF_LIST_GRID =
I_ALV_FORM = 'X'
.
endform.
‎2009 Jul 30 8:09 AM
For header, you can use SET PF-STATUS statement for different seconadary list.
‎2009 Jul 30 8:15 AM
Hi Joytsna,
There is a event "TOP-OF-PAGE DURING LINE-SELECTION" for secondary lists in interactive reports.
Write your code below this event.
Thanks,
Prabhu
‎2009 Jul 30 8:15 AM
hi,
use the below sample program for reference.
type-pools : slis, icon.
data: begin of t_itab occurs 0,
kunnr type kunnr,
waers type waers,
dmbtr type dmbtr,
end of t_itab.
data: w_fieldcat type slis_fieldcat_alv,
it_fieldcat type slis_t_fieldcat_alv,
t_sort type slis_t_sortinfo_alv,
w_sort type slis_sortinfo_alv,
w_layout type slis_layout_alv,
w_events type slis_alv_event,
t_events type slis_T_event.
t_itab-kunnr = '0001'.
t_itab-waers = 'USD'.
t_itab-dmbtr = '100.00'.
append t_itab.
t_itab-kunnr = '0001'.
t_itab-waers = 'USD'.
t_itab-dmbtr = '200.00'.
append t_itab.
t_itab-kunnr = '0002'.
t_itab-waers = 'USD'.
t_itab-dmbtr = '100.00'.
append t_itab.
w_fieldcat-fieldname = 'KUNNR'.
w_fieldcat-tabname = 't_itab'.
append w_fieldcat to it_fieldcat.
clear w_fieldcat.
w_fieldcat-fieldname = 'WAERS'.
w_fieldcat-tabname = 't_itab'.
append w_fieldcat to it_fieldcat.
clear w_fieldcat.
w_fieldcat-fieldname = 'DMBTR'.
w_fieldcat-tabname = 't_itab'.
w_fieldcat-do_sum = 'X'.
append w_fieldcat to it_fieldcat.
clear w_fieldcat.
*
w_sort-fieldname = 'KUNNR'.
w_sort-up = 'X'.
w_sort-group = '*'.
w_sort-subtot = 'X'.
append w_sort to t_sort.
w_events-name = 'TOP_OF_PAGE'.
w_events-form = 'TOP_OF_PAGE'.
append w_events to t_events.
clear w_events.
w_events-name = 'USER_COMMAND'.
w_events-form = 'USER_COMMAND'.
append w_events to t_events.
clear w_events.
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
i_callback_program = sy-repid
it_fieldcat = it_fieldcat
it_sort = t_sort
is_layout = w_layout
it_events = t_events
TABLES
t_outtab = t_itab
EXCEPTIONS
program_error = 1
OTHERS = 2.
IF sy-subrc = 0.
ENDIF.
form top_of_page.
data: w_value type char4.
w_value = '@5B@'.
data: t_list_header type SLIS_T_LISTHEADER ,
w_list_header type slis_listheader.
w_list_header-typ = 'S'.
w_list_header-info = 'First List'.
append w_list_header to t_list_header.
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
it_list_commentary = t_list_header
I_LOGO =
I_END_OF_LIST_GRID =
I_ALV_FORM = 'X'
.
endform.
FORM user_command USING r_ucomm LIKE sy-ucomm rs_selfield TYPE
slis_selfield."#EC CALLED
CASE r_ucomm.
WHEN '&IC1' .
perform second_list.
ENDCASE.
ENDFORM.
FORM second_list.
refresh : t_itab, t_events, it_fieldcat.
t_itab-kunnr = '0003'.
t_itab-waers = 'USD'.
t_itab-dmbtr = '100.00'.
append t_itab.
t_itab-kunnr = '0004'.
t_itab-waers = 'USD'.
t_itab-dmbtr = '200.00'.
append t_itab.
t_itab-kunnr = '0005'.
t_itab-waers = 'USD'.
t_itab-dmbtr = '100.00'.
append t_itab.
t_itab-kunnr = '0006'.
t_itab-waers = 'USD'.
t_itab-dmbtr = '400.00'.
append t_itab.
t_itab-kunnr = '0006'.
t_itab-waers = 'USD'.
t_itab-dmbtr = '300.00'.
append t_itab.
t_itab-kunnr = '0004'.
t_itab-waers = 'USD'.
t_itab-dmbtr = '100.00'.
append t_itab.
w_fieldcat-fieldname = 'KUNNR'.
w_fieldcat-tabname = 't_itab'.
append w_fieldcat to it_fieldcat.
clear w_fieldcat.
w_fieldcat-fieldname = 'WAERS'.
w_fieldcat-tabname = 't_itab'.
append w_fieldcat to it_fieldcat.
clear w_fieldcat.
w_fieldcat-fieldname = 'DMBTR'.
w_fieldcat-tabname = 't_itab'.
w_fieldcat-do_sum = 'X'.
append w_fieldcat to it_fieldcat.
clear w_fieldcat.
w_events-name = 'TOP_OF_PAGE'.
w_events-form = 'TOP_OF_PAGE1'.
append w_events to t_events.
clear w_events.
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
i_callback_program = sy-repid
it_fieldcat = it_fieldcat
it_sort = t_sort
is_layout = w_layout
it_events = t_events
TABLES
t_outtab = t_itab
EXCEPTIONS
program_error = 1
OTHERS = 2.
IF sy-subrc = 0.
ENDIF.
ENDFORM.
form top_of_page1.
data: w_value type char4.
w_value = '@5B@'.
data: t_list_header type SLIS_T_LISTHEADER ,
w_list_header type slis_listheader.
w_list_header-typ = 'S'.
w_list_header-info = 'Second List'.
append w_list_header to t_list_header.
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
it_list_commentary = t_list_header
I_LOGO =
I_END_OF_LIST_GRID =
I_ALV_FORM = 'X'
.
endform.
regards,
Bhavana
‎2009 Jul 30 8:16 AM
HI,
use the below code for reference.
type-pools : slis, icon.
data: begin of t_itab occurs 0,
kunnr type kunnr,
waers type waers,
dmbtr type dmbtr,
end of t_itab.
data: w_fieldcat type slis_fieldcat_alv,
it_fieldcat type slis_t_fieldcat_alv,
t_sort type slis_t_sortinfo_alv,
w_sort type slis_sortinfo_alv,
w_layout type slis_layout_alv,
w_events type slis_alv_event,
t_events type slis_T_event.
t_itab-kunnr = '0001'.
t_itab-waers = 'USD'.
t_itab-dmbtr = '100.00'.
append t_itab.
t_itab-kunnr = '0001'.
t_itab-waers = 'USD'.
t_itab-dmbtr = '200.00'.
append t_itab.
t_itab-kunnr = '0002'.
t_itab-waers = 'USD'.
t_itab-dmbtr = '100.00'.
append t_itab.
w_fieldcat-fieldname = 'KUNNR'.
w_fieldcat-tabname = 't_itab'.
append w_fieldcat to it_fieldcat.
clear w_fieldcat.
w_fieldcat-fieldname = 'WAERS'.
w_fieldcat-tabname = 't_itab'.
append w_fieldcat to it_fieldcat.
clear w_fieldcat.
w_fieldcat-fieldname = 'DMBTR'.
w_fieldcat-tabname = 't_itab'.
w_fieldcat-do_sum = 'X'.
append w_fieldcat to it_fieldcat.
clear w_fieldcat.
*
w_sort-fieldname = 'KUNNR'.
w_sort-up = 'X'.
w_sort-group = '*'.
w_sort-subtot = 'X'.
append w_sort to t_sort.
w_events-name = 'TOP_OF_PAGE'.
w_events-form = 'TOP_OF_PAGE'.
append w_events to t_events.
clear w_events.
w_events-name = 'USER_COMMAND'.
w_events-form = 'USER_COMMAND'.
append w_events to t_events.
clear w_events.
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
i_callback_program = sy-repid
it_fieldcat = it_fieldcat
it_sort = t_sort
is_layout = w_layout
it_events = t_events
TABLES
t_outtab = t_itab
EXCEPTIONS
program_error = 1
OTHERS = 2.
IF sy-subrc = 0.
ENDIF.
form top_of_page.
data: w_value type char4.
w_value = '@5B@'.
data: t_list_header type SLIS_T_LISTHEADER ,
w_list_header type slis_listheader.
w_list_header-typ = 'S'.
w_list_header-info = 'First List'.
append w_list_header to t_list_header.
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
it_list_commentary = t_list_header
I_LOGO =
I_END_OF_LIST_GRID =
I_ALV_FORM = 'X'
.
endform.
FORM user_command USING r_ucomm LIKE sy-ucomm rs_selfield TYPE
slis_selfield."#EC CALLED
CASE r_ucomm.
WHEN '&IC1' .
perform second_list.
ENDCASE.
ENDFORM.
FORM second_list.
refresh : t_itab, t_events, it_fieldcat.
t_itab-kunnr = '0003'.
t_itab-waers = 'USD'.
t_itab-dmbtr = '100.00'.
append t_itab.
t_itab-kunnr = '0004'.
t_itab-waers = 'USD'.
t_itab-dmbtr = '200.00'.
append t_itab.
t_itab-kunnr = '0005'.
t_itab-waers = 'USD'.
t_itab-dmbtr = '100.00'.
append t_itab.
t_itab-kunnr = '0006'.
t_itab-waers = 'USD'.
t_itab-dmbtr = '400.00'.
append t_itab.
t_itab-kunnr = '0006'.
t_itab-waers = 'USD'.
t_itab-dmbtr = '300.00'.
append t_itab.
t_itab-kunnr = '0004'.
t_itab-waers = 'USD'.
t_itab-dmbtr = '100.00'.
append t_itab.
w_fieldcat-fieldname = 'KUNNR'.
w_fieldcat-tabname = 't_itab'.
append w_fieldcat to it_fieldcat.
clear w_fieldcat.
w_fieldcat-fieldname = 'WAERS'.
w_fieldcat-tabname = 't_itab'.
append w_fieldcat to it_fieldcat.
clear w_fieldcat.
w_fieldcat-fieldname = 'DMBTR'.
w_fieldcat-tabname = 't_itab'.
w_fieldcat-do_sum = 'X'.
append w_fieldcat to it_fieldcat.
clear w_fieldcat.
w_events-name = 'TOP_OF_PAGE'.
w_events-form = 'TOP_OF_PAGE1'.
append w_events to t_events.
clear w_events.
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
i_callback_program = sy-repid
it_fieldcat = it_fieldcat
it_sort = t_sort
is_layout = w_layout
it_events = t_events
TABLES
t_outtab = t_itab
EXCEPTIONS
program_error = 1
OTHERS = 2.
IF sy-subrc = 0.
ENDIF.
ENDFORM.
form top_of_page1.
data: w_value type char4.
w_value = '@5B@'.
data: t_list_header type SLIS_T_LISTHEADER ,
w_list_header type slis_listheader.
w_list_header-typ = 'S'.
w_list_header-info = 'Second List'.
append w_list_header to t_list_header.
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
it_list_commentary = t_list_header
I_LOGO =
I_END_OF_LIST_GRID =
I_ALV_FORM = 'X'
.
endform.
‎2009 Jul 30 8:21 AM
Hi,
you are displaing primary list for alv by using FM: REUSE_ALV_GRID_DISPLAY.
then you are writing interactive option like....
data: w_repid type sy-repid.
w_repid = sy-repid.
case sy-ucomm.
when '&IC1'
IF rs_selfield-FIELDNAME = 'EBELN'.
select * from ekpo into table it_ekpo where ebeln = rs_selfield-FIELDVALUE.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_BYPASSING_BUFFER = ' '
I_BUFFER_ACTIVE = ' '
I_CALLBACK_PROGRAM = w_repid
I_CALLBACK_PF_STATUS_SET = ' '
I_CALLBACK_USER_COMMAND = ' '
I_CALLBACK_TOP_OF_PAGE = 'TOP_OF_PAGE '
IS_LAYOUT =
IT_FIELDCAT = i_fieldcatlog1
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 =
TABLES
t_outtab = it_ekpo
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.
for top-of-page display use FM:REUSE_ALV_COMMENTARY_WRITE
form top_of_page.
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
it_list_commentary = i_top(for display content in top-of-page )
I_LOGO = 'name of the logo'
I_END_OF_LIST_GRID =
I_ALV_FORM =
.
for logo uploading use tr. OAER.
give class name: pictures
class type 'OT'
OBJECT NAME = 'name of the logo'.
ENDIF.
ENDCASE.
if you need more input then tell me.
Regards,
Tutun
‎2009 Jul 30 8:23 AM
‎2009 Jul 30 8:26 AM
hi,
type-pools : slis, icon.
data: begin of t_itab occurs 0,
kunnr type kunnr,
waers type waers,
dmbtr type dmbtr,
end of t_itab.
data: w_fieldcat type slis_fieldcat_alv,
it_fieldcat type slis_t_fieldcat_alv,
t_sort type slis_t_sortinfo_alv,
w_sort type slis_sortinfo_alv,
w_layout type slis_layout_alv,
w_events type slis_alv_event,
t_events type slis_T_event.
t_itab-kunnr = '0001'.
t_itab-waers = 'USD'.
t_itab-dmbtr = '100.00'.
append t_itab.
t_itab-kunnr = '0001'.
t_itab-waers = 'USD'.
t_itab-dmbtr = '200.00'.
append t_itab.
t_itab-kunnr = '0002'.
t_itab-waers = 'USD'.
t_itab-dmbtr = '100.00'.
append t_itab.
w_fieldcat-fieldname = 'KUNNR'.
w_fieldcat-tabname = 't_itab'.
append w_fieldcat to it_fieldcat.
clear w_fieldcat.
w_fieldcat-fieldname = 'WAERS'.
w_fieldcat-tabname = 't_itab'.
append w_fieldcat to it_fieldcat.
clear w_fieldcat.
w_fieldcat-fieldname = 'DMBTR'.
w_fieldcat-tabname = 't_itab'.
w_fieldcat-do_sum = 'X'.
append w_fieldcat to it_fieldcat.
clear w_fieldcat.
w_events-name = 'TOP_OF_PAGE'.
w_events-form = 'TOP_OF_PAGE'.
append w_events to t_events.
clear w_events.
w_events-name = 'USER_COMMAND'.
w_events-form = 'USER_COMMAND'.
append w_events to t_events.
clear w_events.
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
i_callback_program = sy-repid
it_fieldcat = it_fieldcat
it_sort = t_sort
is_layout = w_layout
it_events = t_events
TABLES
t_outtab = t_itab
EXCEPTIONS
program_error = 1
OTHERS = 2.
IF sy-subrc = 0.
ENDIF.
form top_of_page.
data: t_list_header type SLIS_T_LISTHEADER ,
w_list_header type slis_listheader.
w_list_header-typ = 'S'.
w_list_header-info = 'First List'.
append w_list_header to t_list_header.
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
it_list_commentary = t_list_header
I_LOGO =
I_END_OF_LIST_GRID =
I_ALV_FORM = 'X'
.
endform.
FORM user_command USING r_ucomm LIKE sy-ucomm rs_selfield TYPE
slis_selfield."#EC CALLED
CASE r_ucomm.
WHEN '&IC1' .
perform second_list.
ENDCASE.
ENDFORM.
FORM second_list.
refresh : t_itab, t_events, it_fieldcat.
t_itab-kunnr = '0003'.
t_itab-waers = 'USD'.
t_itab-dmbtr = '100.00'.
append t_itab.
t_itab-kunnr = '0004'.
t_itab-waers = 'USD'.
t_itab-dmbtr = '200.00'.
append t_itab.
t_itab-kunnr = '0005'.
t_itab-waers = 'USD'.
t_itab-dmbtr = '100.00'.
append t_itab.
t_itab-kunnr = '0006'.
t_itab-waers = 'USD'.
t_itab-dmbtr = '400.00'.
append t_itab.
t_itab-kunnr = '0006'.
t_itab-waers = 'USD'.
t_itab-dmbtr = '300.00'.
append t_itab.
t_itab-kunnr = '0004'.
t_itab-waers = 'USD'.
t_itab-dmbtr = '100.00'.
append t_itab.
w_fieldcat-fieldname = 'KUNNR'.
w_fieldcat-tabname = 't_itab'.
append w_fieldcat to it_fieldcat.
clear w_fieldcat.
w_fieldcat-fieldname = 'WAERS'.
w_fieldcat-tabname = 't_itab'.
append w_fieldcat to it_fieldcat.
clear w_fieldcat.
w_fieldcat-fieldname = 'DMBTR'.
w_fieldcat-tabname = 't_itab'.
w_fieldcat-do_sum = 'X'.
append w_fieldcat to it_fieldcat.
clear w_fieldcat.
w_events-name = 'TOP_OF_PAGE'.
w_events-form = 'TOP_OF_PAGE1'.
append w_events to t_events.
clear w_events.
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
i_callback_program = sy-repid
it_fieldcat = it_fieldcat
it_sort = t_sort
is_layout = w_layout
it_events = t_events
TABLES
t_outtab = t_itab
EXCEPTIONS
program_error = 1
OTHERS = 2.
IF sy-subrc = 0.
ENDIF.
ENDFORM.
form top_of_page1.
data: t_list_header type SLIS_T_LISTHEADER ,
w_list_header type slis_listheader.
w_list_header-typ = 'S'.
w_list_header-info = 'Second List'.
append w_list_header to t_list_header.
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
it_list_commentary = t_list_header
I_LOGO =
I_END_OF_LIST_GRID =
I_ALV_FORM = 'X'
.
endform.
‎2009 Jul 30 8:29 AM
Hi,
the code is not coming in readable format. so sending the program again.
type-pools : slis, icon.
data: begin of t_itab occurs 0,
kunnr type kunnr,
waers type waers,
dmbtr type dmbtr,
end of t_itab.
data: w_fieldcat type slis_fieldcat_alv,
it_fieldcat type slis_t_fieldcat_alv,
t_sort type slis_t_sortinfo_alv,
w_sort type slis_sortinfo_alv,
w_layout type slis_layout_alv,
w_events type slis_alv_event,
t_events type slis_T_event.
t_itab-kunnr = '0001'.
t_itab-waers = 'USD'.
t_itab-dmbtr = '100.00'.
append t_itab.
t_itab-kunnr = '0001'.
t_itab-waers = 'USD'.
t_itab-dmbtr = '200.00'.
append t_itab.
t_itab-kunnr = '0002'.
t_itab-waers = 'USD'.
t_itab-dmbtr = '100.00'.
append t_itab.
w_fieldcat-fieldname = 'KUNNR'.
w_fieldcat-tabname = 't_itab'.
append w_fieldcat to it_fieldcat.
clear w_fieldcat.
w_fieldcat-fieldname = 'WAERS'.
w_fieldcat-tabname = 't_itab'.
append w_fieldcat to it_fieldcat.
clear w_fieldcat.
w_fieldcat-fieldname = 'DMBTR'.
w_fieldcat-tabname = 't_itab'.
w_fieldcat-do_sum = 'X'.
append w_fieldcat to it_fieldcat.
clear w_fieldcat.
w_events-name = 'TOP_OF_PAGE'.
w_events-form = 'TOP_OF_PAGE'.
append w_events to t_events.
clear w_events.
w_events-name = 'USER_COMMAND'.
w_events-form = 'USER_COMMAND'.
append w_events to t_events.
clear w_events.
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
i_callback_program = sy-repid
it_fieldcat = it_fieldcat
it_events = t_events
TABLES
t_outtab = t_itab
EXCEPTIONS
program_error = 1
OTHERS = 2.
IF sy-subrc = 0.
ENDIF.
form top_of_page.
data: t_list_header type SLIS_T_LISTHEADER ,
w_list_header type slis_listheader.
w_list_header-typ = 'S'.
w_list_header-info = 'First List'.
append w_list_header to t_list_header.
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
it_list_commentary = t_list_header
I_LOGO =
I_END_OF_LIST_GRID =
I_ALV_FORM = 'X'
.
endform.
FORM user_command USING r_ucomm LIKE sy-ucomm rs_selfield TYPE
slis_selfield."#EC CALLED
CASE r_ucomm.
WHEN '&IC1' .
perform second_list.
ENDCASE.
ENDFORM.
FORM second_list.
refresh : t_itab, t_events, it_fieldcat.
t_itab-kunnr = '0003'.
t_itab-waers = 'USD'.
t_itab-dmbtr = '100.00'.
append t_itab.
t_itab-kunnr = '0004'.
t_itab-waers = 'USD'.
t_itab-dmbtr = '200.00'.
append t_itab.
t_itab-kunnr = '0005'.
t_itab-waers = 'USD'.
t_itab-dmbtr = '100.00'.
append t_itab.
t_itab-kunnr = '0006'.
t_itab-waers = 'USD'.
t_itab-dmbtr = '400.00'.
append t_itab.
t_itab-kunnr = '0006'.
t_itab-waers = 'USD'.
t_itab-dmbtr = '300.00'.
append t_itab.
t_itab-kunnr = '0004'.
t_itab-waers = 'USD'.
t_itab-dmbtr = '100.00'.
append t_itab.
w_fieldcat-fieldname = 'KUNNR'.
w_fieldcat-tabname = 't_itab'.
append w_fieldcat to it_fieldcat.
clear w_fieldcat.
w_fieldcat-fieldname = 'WAERS'.
w_fieldcat-tabname = 't_itab'.
append w_fieldcat to it_fieldcat.
clear w_fieldcat.
w_fieldcat-fieldname = 'DMBTR'.
w_fieldcat-tabname = 't_itab'.
w_fieldcat-do_sum = 'X'.
append w_fieldcat to it_fieldcat.
clear w_fieldcat.
w_events-name = 'TOP_OF_PAGE'.
w_events-form = 'TOP_OF_PAGE1'.
append w_events to t_events.
clear w_events.
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
i_callback_program = sy-repid
it_fieldcat = it_fieldcat
it_sort = t_sort
is_layout = w_layout
it_events = t_events
TABLES
t_outtab = t_itab
EXCEPTIONS
program_error = 1
OTHERS = 2.
IF sy-subrc = 0.
ENDIF.
ENDFORM.
form top_of_page1.
data: w_value type char4.
w_value = '@5B@'.
data: t_list_header type SLIS_T_LISTHEADER ,
w_list_header type slis_listheader.
w_list_header-typ = 'S'.
w_list_header-info = 'Second List'.
append w_list_header to t_list_header.
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
it_list_commentary = t_list_header
I_LOGO =
I_END_OF_LIST_GRID =
I_ALV_FORM = 'X'
.
endform.
‎2009 Jul 30 8:31 AM