09-01-2007 7:20 AM
Hi Gurus,
Please help me regarding my issue. I have one internal table in that table i have the records in the following format.
<u>Material</u> <u>quantity</u>
mat1 100
mat1 200
mat1 600
mat2 10
mat2 20
I need to develop alv report for mat1 and another alv for mat2. How to do this? Please guide me some suggestions.
Points will be awarded
Regards
Ravi
09-01-2007 7:32 AM
Hi Ravi,
You can split the internal table into multiple internal tables based on material but you can show only one alv report at a time using simple list or grid display.
Instead, build a hierarchy alv report where you will display the list of material in the header and when you can display the details in item details.
Thanks,
Vinay
09-01-2007 7:28 AM
Hi,
Do like this..
create a new table tab1 of same structure as tab.
SORT tab BY matnr.
LOOP AT tab.
tab1-matnr = tab-matnr.
tab1-qty = tab-qty.
-
APPEND tab1.
AT END OF matnr.
CALL function 'REUSE_ALV_GRID_LIST' using table tab1.
after the function call, REFRESH tab1.
ENDAT.
ENDLOOP.
Create the catalog table before the loop only, so you will only change the data table contents in the loop.
Thanks and Regards,
Vikas Bittera.
09-01-2007 7:32 AM
Hi Ravi,
You can split the internal table into multiple internal tables based on material but you can show only one alv report at a time using simple list or grid display.
Instead, build a hierarchy alv report where you will display the list of material in the header and when you can display the details in item details.
Thanks,
Vinay
09-01-2007 7:38 AM
Ravikanth,
first have one more internal table wth the same records.
loop at itab1.
move-correspong itab1 to itab2.
append itab2.
endloop.
now itab1 and itab2 will have the same data.
************
loop at itab1.
if itab1-matnr NE 'MAT1'
delete itab1.
endif.
endloop.
call reuse_alv_grid_display
In this alv pass internal table itab1 so that you will have only records related to MAT1.
********
loop at itab2.
if itab2-matnr NE 'MAT2'
delete itab2.
endif.
endloop.
call resue_alv_list_display.
In this alv pass internal table itab2 so that you will have only records related to MAT2.
If any doubts revert it.
K.Kiran.
Message was edited by:
Kiran K
09-01-2007 11:49 AM
Hi,
have a look at the following SDN wiki code snippet
(hope you can adapt it to your needs):
Best regards.