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: 

Hide a specified cell in ALV grid

former_member443015
Participant
0 Kudos

Dear all,

I have a question about ABAP coding with alv grid.

In my dialog program (SE80), I have created a custom ALV grid. There are about 10 columns in the grid and one of the column contains number value (e.g. 0.00).  For that column, there are some cells should have NO values. If I set the datatype of the column to ‘P’, the cell will be displayed as 0.00 even when the cell contains no value.

If I set the datatype of the column to ‘C’, the cell is able to show empty when the cell contains no value and show 0.00 when the value is 0.00. But I can’t use the sum features for the alv grid for that column if I set the column datatype to ‘C’.

As I want to use the sum features of the alv grid and show empty when the cell contains no values. May I ask is it possible to adjust the style of a specified cell in the alv grid so that the cell is invisible when contains no value. Or do you have any suggestions to me?

Many thanks for all of your helps.

Sunny

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi Sheung,

Do you try set 'NO_ZERO as 'X' on your fieldcatlog?

Regards,

Archer

7 REPLIES 7

Former Member
0 Kudos

Hi Sheung,

Do you try set 'NO_ZERO as 'X' on your fieldcatlog?

Regards,

Archer

0 Kudos

Thanks Archer.

Yes, I have try to set 'NO_ZERO' as 'X' in fieldcatlog. After I set 'NO_ZERO', the cells shows empty if the value is empty. But when the cell value is 0.00, it shows Empty also. In this case, we prefer the cell shows 0.00.

Thanks for your reply again.

Sunny

0 Kudos

How do you judge the cell is empty? as i know, 'empty' is 0.00, and 'initial' same is 0.00 to type P.

0 Kudos

Dear Archer,

Thanks you reply.

We have another column (Show_Flag) to control this cell.

For example if the value of Show_Flag is 'X', then the cell in that row which I mentioned should show the number value(i.e. 100.00 , 0.00 or -123.00...etc)

But if the value of show_flag of the row is '', then the cell in that row which I mentioned show show empty/hide the value.

Thank you very much again

Sunny

matt
Active Contributor
0 Kudos

Since you're mucking about with standard functionality so much your only option is to have a type C field and to do the summing yourself.

0 Kudos

Dear Matthew,

Many thanks for your explanation. I think you are right.

May I ask is it possible to change the color of each cell?

Thanks very much

Sunny

matt
Active Contributor
0 Kudos

Yes. And that's a FAQ, well covered so please search.