08-26-2013 12:23 PM
Hi Experts,
I would like to use the REUSE_ALV_BLOCK_LIST_APPEND in my report for multiple times depend on the selection data, I use it in the loop but it show only one ALV.
08-26-2013 12:39 PM
Hello , see this link : http://abap-explorer.blogspot.com.es/2008/09/display-multiple-list-under-same-list.html
Regards.
Julio
08-26-2013 1:47 PM
Hi Juan,
The link doesn't show REUSE_ALV_FIELDCATALOG_MERGE use in the loop, I need to use it in loop end loop statement to show multiple table
08-26-2013 2:08 PM
Hi Ashwin,
To use multiple ALVs in the list display, first you to initialize the ALV using,
REUSE_ALV_BLOCK_LIST_INIT.
Then in LOOP, use your FM REUSE_ALV_BLOCK_LIST_APPEND for different tables which you want to use.
After ENDLOOP. finally use the Function Module, REUSE_ALV_BLOCK_LIST_DISPLAY.
Hope this solves your purpose.
Regards,
Sumit
08-26-2013 3:45 PM
Yes you are right this is the way I am following but how to create table in the loop dynamically that I am not getting, for every loop we need to pass different table then only it will be display otherwise in the same table complete data will be display
08-26-2013 6:32 PM
Come on man.... You have to have an internal table which is having numbers. Loop at that table and for first passof the loop, pass itab1, for second pass itab2 ans so on.
First determine how many tables would be there, then either use dynamic table, or use DO ENDDO, with a variable count.
DO.
count = count+1.
case count.
when 1.
pass itab1.
when 2.
pass itab2.
exit the loop when count reaches, the number of tables.
ENDDO.
08-26-2013 6:32 PM
Come on man.... You have to have an internal table which is having numbers. Loop at that table and for first passof the loop, pass itab1, for second pass itab2 ans so on.
First determine how many tables would be there, then either use dynamic table, or use DO ENDDO, with a variable count.
DO.
count = count+1.
case count.
when 1.
pass itab1.
when 2.
pass itab2.
exit the loop when count reaches, the number of tables.
ENDDO.
08-26-2013 6:50 PM
Hi Sumit,
I appreciate you are help, but as you say in this case I do no know how many internal table I should create , I need to display the RFQ against the material that mean the no of internal table is completely dynamic , now if I make it dynamic with field symbol I need to pass the internal table name to the function module REUSE_ALV_BLOCK_LIST_APPEND how would I know the internal table name since its dynamic
08-27-2013 1:16 PM
08-26-2013 2:09 PM
Have a look at program BCALV_TEST_BLOCK_LIST.
In selection screen, "Number of Lists" value determine how many lists will be shown in output.
08-26-2013 3:48 PM
Hi thanks
In this program no of internal table are fix but in my case the no of internal table are completely dynamic, in the loop the no of internal table should be created and pass to this function module
08-27-2013 8:22 AM
Here is what you need to do.
Create an internal table that has dictionary table name, and references to internal table of that type.
TYPES:
BEGIN OF ty_dyn,
tabname TYPE dd02l-tabname,
tabref TYPE REF TO data,
END OF ty_dyn.
DATA: lt_dyn TYPE TABLE OF ty_dyn,
ls_dyn TYPE ty_dyn.
ls_dyn-tabname = 'SFLIGHT'.
GET REFERENCE OF lt_sflight INTO ls_dyn-tabref.
APPEND ls_dyn TO lt_dyn.
ls_dyn-tabname = 'SCARR'.
GET REFERENCE OF lt_scarr INTO ls_dyn-tabref.
APPEND ls_dyn TO lt_dyn.
CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_INIT'
LOOP AT lt_dyn INTO ls_dyn.
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
i_structure_name = ls_dyn-tabname
Assign ls_dyn-tabref->* to <fs>.
CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_APPEND'
i_tabname = ls_dyn-tabname
t_outtab = <fs>
ENDLOOP.
CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_DISPLAY'
09-02-2013 6:33 AM
Solve by myself with creating the 50 Internal tables
close the thread
09-02-2013 6:34 AM
09-02-2013 8:25 AM
Hi Ashwin,
You just post the solution and mark that as correct answer. Because this may be useful to someone have the same problem.
Regards,
John.
09-27-2013 1:14 PM
Dear Manish ji,
I have the requirement to display ALV Block, i have one table in which i have multiple header items. another table in which i have items data for these header items.
Now My requirement is Header Field catalog will come first then one line of header item
After that Line items field catalog and its items suppose 3 items for one header item.
Suppose i have ten Items in Header & 20 Items in Items details table, so it means it will repeat 10 times.
Kindly check my code & suggest me the changes.
FORM sub_alv_display .
is_layout-zebra ='X'.
CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_INIT'
EXPORTING
i_callback_program = sy-repid
* I_CALLBACK_PF_STATUS_SET = ' '
* I_CALLBACK_USER_COMMAND = ' '
* IT_EXCLUDING =
.
BREAK-POINT.
loop at gt_final into gs_final.
CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_APPEND'
EXPORTING
is_layout = is_layout
it_fieldcat = it_fieldcat1
i_tabname = 'GT_FINAL'
it_events = it_event
* IT_SORT =
* I_TEXT = ' '
tables
t_outtab = gt_final
EXCEPTIONS
PROGRAM_ERROR = 1
MAXIMUM_OF_APPENDS_REACHED = 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.
loop at it_final into is_final where belnr = gs_final-belnr.
CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_APPEND'
EXPORTING
is_layout = is_layout
it_fieldcat = it_fieldcat
i_tabname = 'IT_FINAL'
it_events = it_event
* IT_SORT =
* I_TEXT = ' '
tables
t_outtab = it_final
EXCEPTIONS
PROGRAM_ERROR = 1
MAXIMUM_OF_APPENDS_REACHED = 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.
endloop.
Clear IS_final.
ENDLOOP.
CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_DISPLAY'
* EXPORTING
* I_INTERFACE_CHECK = ' '
* IS_PRINT =
* I_SCREEN_START_COLUMN = 0
* I_SCREEN_START_LINE = 0
* I_SCREEN_END_COLUMN = 0
* I_SCREEN_END_LINE = 0
* IMPORTING
* E_EXIT_CAUSED_BY_CALLER =
* ES_EXIT_CAUSED_BY_USER =
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.
ENDFORM. " sub_alv_display
I am getting this output.
09-27-2013 2:24 PM
This should have been posted as a new discussion or question.
Your requirement is more suited for ALV Hierarchical list, and not ALV Block list.
Check out demo program BCALV_TEST_HIERSEQ_LIST.
09-30-2013 10:33 AM
Dear Manish,
Thanks for your reply, is it possible to do this without using <fs> in my report. Please suggest me.
Thanks & regards,
09-30-2013 11:33 AM
Your query should have been posted as a new discussion or question.
BCALV_TEST_HIERSEQ_LIST does not use <fs>
<fs> is mentioned in my previous reply, but that is for ALV block lists in loop, which is not suitable for your requirement.
08-26-2013 2:13 PM
08-27-2013 1:18 PM