01-14-2022 3:43 PM
Hello experts,
I'm trying to blanking(hide) the duplicates in the ALV report.
As you can see, the first two fields have blanks for duplicated values.
From the 3rd column to the last column, I'd like to make a blank just like in the previous two fields.
Two conditions:
1. I don't want to remove duplicated rows, so deleting adjacent function is not needed.
2. I want to blank duplicates based on the first two fields.
In other words, even though the value '88432MU012' in the 3rd column is duplicated, I don't want to blank all of them. Instead, I want to blank the values based on the Item Number.
Plus, in the code, I used the below one where I used the GT_SORT[] for blanking the first two columns.
CALL METHOD R_GRID->SET_TABLE_FOR_FIRST_DISPLAY
EXPORTING
* I_STRUCTURE_NAME =
* IS_VARIANT =
* I_SAVE =
* I_DEFAULT = 'X'
IS_LAYOUT = GS_LAYOUT
IT_TOOLBAR_EXCLUDING = GT_TOOLBAR_EXCLUDING
* IS_VARIANT = GS_VARIANT
CHANGING
IT_OUTTAB = GT_ALV[]
IT_FIELDCATALOG = GT_FIELDCAT[]
IT_SORT = GT_SORT[].
* IT_FILTER =
But, if I sort after 3rd column, every duplicates got removed, not based on the second field.
For the output,
should look like this and hope this makes sense.
Thanks in advance!
01-14-2022 3:59 PM
In Excel (or any spreadsheet application), could you show the expected result please?
01-14-2022 4:29 PM
It seems you do not want to Sort but want to see a blank line wherever there is a Duplicate line.. well from what I understand you'll have to insert a blank row into your final output table whenever you find a duplicate.. But an additional question I have is how come all field values are same or is it just one of the possible cases?? As Sandra suggests above, you'll probably need to add further details in case the solution suggested is not what you are looking for..
Regards,
Vijay
01-14-2022 4:49 PM
Hi,
Have you tried manipulating the ALV output through "change layout" functionality/button? If you could accomplish what you want in that way, you could adopt it in your code.
Best regards.