‎2008 Jun 24 3:34 AM
Hi,
I have developed a ALV report which is working fine, if i give single value as input for a particular field in the selection. But if i give multiple values for the same fields as input, the records are getting duplicated for one input value.
For example, if i give just one PERNR in the input, it will show 6 records as output which are correct. But if i give two pernrs in the input, for one pernr it showing 12 (getting duplicates of original 6) and for other pernr it showing only one which is correct...where might i go wrong..pls suggest me...
Thanks,
Ram.
‎2008 Jun 24 3:55 AM
Hi,
Clear the final internal table which shown in the ALV...
for clear the internal table use Refresh itab statement.
Regards,
SB
‎2008 Jun 24 4:29 AM
Hi Ram,
Its just simple, if u try to again execute it will give 18 ,24 entries and so on,
you need to clear the internal table to avoid duplicates.
‎2008 Jun 24 4:39 AM
Use the following :
Clear itab.
Delete adjecent duplicates from itab.
DELETE ADJACENT DUPLICATES FROM itab comparing pernr.Regards,
Rock.
‎2008 Jun 24 4:39 AM
Hi, before assign your final internal table to ALV funtion module. just refresh the internal table.
Regards,
Venkat n
‎2008 Jun 24 5:28 AM
Hi,
When there is issue of duplicate records the first thing we need to check , if the internal table for ALV is refreshed or not.
Like all data objects, you can initialize internal tables with the
CLEAR <itab>..
This statement restores an internal table to the state it was in immediately after you declared it. This means that the table contains no lines. However, the memory already occupied by the memory up until you cleared it remains allocated to the table. If you are using internal tables with header lines, remember that the header line and the body of the table have the same name. If you want to address the body of the table in a comparison, you
must place two brackets ([ ]) after the table name.
CLEAR <itab>[].To ensure that the table itself has been initialized, you can use the
REFRESH <itab>..
This always applies to the body of the table.
Other thing we can do is use ''delete adjacent duplicates'' syntax.
Hope this will solve your problem.
Plz reward if useful.
Thanks,
Dhanashri.