Skip to Content
author's profile photo Former Member
Former Member

How to avoid zeros in output for a field with Decimal type

Hi Friends

In a Report one output field is declared with decimal type.

Whenver that field is not filled with any values zeros will be displayed in the output.

I tried to change the data type to char but i am facing some issues in calculations and shwoing only 2 decimal places.

So is there any way to hide the zeros in the output if we the field is not filled with any value.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Dec 13, 2011 at 09:19 AM

    Hi Amit,

    Let's say p_lc is ur decimal variable u want to dislay using the write statement.

    try to use the below way:

    write : p_lc no-ZERO.

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Hi,

      To display the output the final internal table passed to the standard program rsaqexce.

      Inside that ALV function modules are called. So we don't have control on ALV function module to change the paratmeters.

      Before passing the final internal table to the standard program if we have any option to avoid zeros the issue will be resolved.

      Thanks for all for providing different solutions. It will be great if i get suitable solution for my issue.

  • author's profile photo Former Member
    Former Member
    Posted on Dec 13, 2011 at 09:20 AM

    Hi ,

    Use the NO-ZERO in write statement where there is zeros it will display empty space if there is any value it will display the value.

    1. Data a type c length 5 value '0000'.

    Eg: Write : / a no-zero.

    o/p : empty (no zeros will display it will hide).

    2 . Data a type c length 5 value '0100'.

    Eg: Write : / a no-zero.

    o/p : 100 (no zeros will display it will hide).

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Dec 13, 2011 at 09:26 AM

    Hi,

    Please specify the report type.

    If it is ALV.

    Then use l_fieldcat-no_zero = 'X'.

    - Regards,

    Makarand Tale

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.