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: 

Blanking duplicated output in ALV

0 Kudos

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!

3 REPLIES 3

Sandra_Rossi
Active Contributor

In Excel (or any spreadsheet application), could you show the expected result please?

vijay_hariharan
Contributor
0 Kudos

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

hsyngvural
Participant

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.