Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

ALV

Former Member
0 Kudos

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

1 ACCEPTED SOLUTION

Former Member
0 Kudos

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

4 REPLIES 4

Former Member
0 Kudos

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.

Former Member
0 Kudos

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

kiran_k8
Active Contributor
0 Kudos

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

former_member182371
Active Contributor
0 Kudos

Hi,

have a look at the following SDN wiki code snippet

(hope you can adapt it to your needs):

https://www.sdn.sap.com/irj/sdn/wiki?path=/display/snippets/tabstrip%20in%20alv(OOPS)&focusedComment...

Best regards.