cancel
Showing results for 
Search instead for 
Did you mean: 

ALV - show blank cell if numeric value is zero

Former Member
0 Kudos

Hi

I have an ALV with serveral numeric and decimal fields.

Is it possible without a lot of effort (like assigning a separate cell with the visibilty attribute for each cell) to hide the cell content if the value is zero instead of showing 0 or 0,00 and so on .

Thanks

Thomas

Accepted Solutions (1)

Accepted Solutions (1)

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

>

> Hi

>

> I have an ALV with serveral numeric and decimal fields.

>

> Is it possible without a lot of effort (like assigning a separate cell with the visibilty attribute for each cell) to hide the cell content if the value is zero instead of showing 0 or 0,00 and so on .

>

> Thanks

> Thomas

I have a feeling that a cell variant or dynamic manipulation of visibility is going to be the correct answer. The data type rules will always fire for the conversion exit on output. You could maybe create a custom domain with its onw conversion exit but I would think that would actually lead to more work than just using hte cell variant/visibility property.

Answers (1)

Answers (1)

Former Member
0 Kudos

okay

could you give a hint handling this issue with a cell variant

I know how to handle a button in a cell with method set_visible_fieldname of class cl_salv_wd_uie_button.

Here I have another column with the visibilty property of the button.

But how can I handle this with normal numeric/decimal fields?

Thanks

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

I was thinking of something along the lines of cell variant with another field that is data bound to a completely different context attribute. A dummy one that is perhaps type STRING and always blank - so that you get the output without 0 or 0.0 that you are looking for.