2007 Jan 10 8:39 AM
Hi,
How to merge the repetitive entries of field, while displaying in ALV.
For example:
In my internal table ITAB has 3 fields, VBELN, POSNR, AMOUNT. If ITAB contains 1 record say 100 with 4 line items 10, 20, 30 & 40. I need to display it as
VBELN POSNR AMT
100 10 2500
20 1500
30 2600
40 5680
I do want to display VBELN value only once, since it is same.
I tried using sort option in ALV and also populated the cell_merge value in layout with value 'X'. But it is not working as desired.
I am using the FM 'Reuse_alv_grid_display. Can anyone help me out.
PS: In the ITAB, VBELN is the second field. First is the indicator field (MARK).
With Regards,
NL
2007 Jan 10 9:08 AM
i dont know if you comment spos whether it will work or not ?
otherwise format your itab like that
data : v_vbeln like vbap-vbeln.
sort itab by vbeln.
loop at itab.
on change of itab-vbeln.
v_vbeln = itab-vbeln.
endon.
itab-vbeln = v_vbeln.
modify itab.
clear v_vbeln.
endloop.
regards
shiba dutta
2007 Jan 10 8:55 AM
you have already said you have used sort option in that whether you have only used up = 'X' and group = 'UL'. or not ?
try to comment cell_merge.
please let me know.
regards
shiba dutta
2007 Jan 10 8:57 AM
define your vbeln as char and dont use the original data type from table.
Thanks.
2007 Jan 10 9:02 AM
The sort table is populated as follows. Also ITAB contains more than 20 fields.
WA_SORT-FIELDNAME = 'VBELN'.
WA_SORT-SPOS = '1'.
WA_SORT-UP = 'X'.
WA_SORT-group = 'UL'.
APPEND WA_SORT TO I_SORT.
Still i could not get the desired result.
With Regards,
NL
2007 Jan 10 9:08 AM
i dont know if you comment spos whether it will work or not ?
otherwise format your itab like that
data : v_vbeln like vbap-vbeln.
sort itab by vbeln.
loop at itab.
on change of itab-vbeln.
v_vbeln = itab-vbeln.
endon.
itab-vbeln = v_vbeln.
modify itab.
clear v_vbeln.
endloop.
regards
shiba dutta
2007 Jan 10 9:10 AM
Hi Naveen,
Well you can modify your table by other records vbeln as space and printing checking based on vbeln is repeating or not .
If useful reward .