Skip to Content
avatar image
Former Member

ALV - show blank cell if numeric value is zero

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

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Best Answer
    Nov 05, 2008 at 04:19 PM

    >

    > 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.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Nov 05, 2008 at 04:51 PM

    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

    Add comment
    10|10000 characters needed characters exceeded

    • 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.