‎2011 May 04 4:16 AM
Hi All.
I have this:
-
some codes here----
ls_event-name = 'TOP_OF_LIST'.
lS_event-form = 'HEADER'.
APPEND ls_event TO li_events.
LOOP i_tab1.
wa_header-typ = 'H'.
wa_header-info = i_tab1-field1.
append wa_header to t_header.
LOOP i_tab2.
--building i_output.
ENDLOOP.
CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_APPEND'
EXPORTING
is_layout = lv_layout
it_fieldcat = li_fieldc
i_tabname = 'I_OUTPUT'
it_events = li_events.
TABLES
t_outtab = i_output
ENDLOOP.
CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_DISPLAY'
-
some codes here -
form HEADER.
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
it_list_commentary = t_header.
endform.
Now I want this output
'i_tab1-field1' <--- kinda like a header but only on the table
______________________
/____/______/____/______/
/____/______/____/______/
'i_tab1-field1' <--- different value from the first one.
______________________
/____/______/____/______/
/____/______/____/______/
The problem is I'm getting the same header. And the worst part is, both tables are the same. How do I fix this?!
Thanks,
Jay
‎2011 May 04 4:44 AM
Hi.,
U are using the same event for all appends., try like this.,
CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_APPEND'
EXPORTING
is_layout = lv_layout
it_fieldcat = li_fieldc
i_tabname = 'I_OUTPUT'
it_events = li_events.
TABLES
t_outtab = i_output.
CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_APPEND'
EXPORTING
is_layout = lv_layout
it_fieldcat = li_fieldc
i_tabname = 'I_OUTPUT'
it_events = li_events1.
TABLES
t_outtab = i_output.
use different event name and different form name.,
hope this helps u.,
Thanks & Regards
Kiran
‎2011 May 04 4:44 AM
Hi.,
U are using the same event for all appends., try like this.,
CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_APPEND'
EXPORTING
is_layout = lv_layout
it_fieldcat = li_fieldc
i_tabname = 'I_OUTPUT'
it_events = li_events.
TABLES
t_outtab = i_output.
CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_APPEND'
EXPORTING
is_layout = lv_layout
it_fieldcat = li_fieldc
i_tabname = 'I_OUTPUT'
it_events = li_events1.
TABLES
t_outtab = i_output.
use different event name and different form name.,
hope this helps u.,
Thanks & Regards
Kiran
‎2011 May 04 7:04 AM
Hi Jay,
Create 2 differnt events like it_events1 and it_event2. and now pass these 2 event to your 2 differnt function modules.
in 2 evets you need to create the text which ever want to display.
example:
FORM lt_events1.
CLEAR wa_events1.
wa_events1-name = slis_ev_top_of_page.
wa_events1-form = 'TOP_OF_PAGE_1'.
APPEND wa_events1 TO it_events1.
CLEAR wa_events1.
ENDFORM. "lt_events1
FORM lt_events2 .
CLEAR wa_events2.
wa_events2-name = slis_ev_top_of_page.
wa_events2-form = 'TOP_OF_PAGE_2'.
APPEND wa_events2 TO it_events2.
CLEAR wa_events2.
ENDFORM.
FORM top_of_page_1.
WRITE:/ text-001 COLOR 3.
ENDFORM.
FORM top_of_page_2.
WRITE:/ text-002 COLOR 5.
ENDFORM.
Hope this helps you..
Regards,
Chinna
Edited by: Chinna guntur on May 4, 2011 11:34 AM
‎2011 May 04 7:25 AM
Hi All--
This is what I noticed though.
1. I will only be using 1 internal table for appending which is inside a loop rebuilding the table each loop.
CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_APPEND'
EXPORTING
is_layout = lv_layout
it_fieldcat = li_fieldc
i_tabname = 'I_OUTPUT'
it_events = li_events.
TABLES
t_outtab = i_output
I think this created the problem of all blocks having the same data. Is there even a way to use 'REUSE_ALV_BLOCK_LIST_APPEND'
using the same table?
2. For events, I don't know how many table blocks will be appended so creating many events is not an ideal solution. Although 19 blocks is the limit, still..... Also, I rearranged the code, using the same events inside the loop. I got my output but not on the same page. It goes like this:
LOOP itab1.
'REUSE_ALV_BLOCK_LIST_INIT'
LOOP itab2.
-build i_output-
ENDLOOP.
'REUSE_ALV_BLOCK_LIST_APPEND'
'REUSE_ALV_BLOCK_LIST_DISPLAY'
ENDLOOP.
Is there a way to have the output on the same page?! I mean no need to press back to display the next table ?! And not placing INIT and DISPLAY outside the outer loop because I'm using the same internal table and doing so will result into table blocks having the same data.
‎2011 Jul 19 7:34 AM