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

Hide decimal values of a quantity

Hi,

I have a problem with a variable typed MENG13. I move this data in another variable with the same type and when i print it on my smartform, decimal values appears even if it's equal to zero.

When i print directly on the smartforms, there is no decimals if the value is null.

When i do a MOVE and then print the data, decimal values appears (3 zeros).

I don't want to see these zeros, how can i do this ?

To sum up :

When decimal values are different than zero, i want to see it on my form.

When these decimal are equal to zero, i don't want to see it.

Thanks

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

6 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Jan 19, 2009 at 12:26 PM

    HI dorain,

    In smartforms if it is aquantity field and there is no value it always prints 0.00 . Unlike character which does not print nething if it is blank.

    Create a node with program flow:

    Just code this following logic.

    have a temporary variable with data type character, check if the quantity is not equal to '0'.

    if not equal to zero then pass the value to character variable else populate the character with space ( ' ' ).

    Hope this helps.

    Regards,

    Navin.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jan 19, 2009 at 12:26 PM

    Hi

    if u dont want to show the decimals,try this

    write value to value2 decimals '0'.

    and if u want write it with decimals, change 0 by a number

    regards

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 19, 2009 at 12:27 PM

    You create one Formula field just over the Total field and make the formula field to display and make the Total field is inactive (ie., Untick the Visible check box of the Total field).

    Formula : Round(Field_XYX,0)

    Let's assume that, Total field's field name is Field_XYX and Formula Field's name is Field_YXY. Then in Field_YXY you should have the above said formula.

    or

    SHIFT wf_c RIGHT DELETING TRAILING '0'.

    SHIFT wf_c RIGHT DELETING TRAILING '.' .

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jan 19, 2009 at 12:28 PM

    Hello Dorian,

    You can write a code for this:

    DATA:
    V_INT TYPE I,
    V_DEC TYPE I,
    V_INT1 TYPE CHAR13,
    V_DEC1 TYPE CHAR3,
    V_QTY TYPE CHAR17.
    
    V_INT = TRUNC( V_MENGE ).
    V_DEC = FRAC( V_MENGE ).
    
    MOVE V_INT TO V_INT1.
    MOVE V_DEC TO V_DEC1.
    
    IF V_DEC = 0.
    V_QTY = V_INT.
    CONDENSE V_QTY.
    ELSE.
    CONCATENATE V_QTY '.' V_INT INTO V_QTY.
    CONDENSE V_QTY.
    ENDIF.
    

    Display V_QTY in your SF.

    BR,

    Suhas

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jan 19, 2009 at 01:04 PM

    Hello,

    Please use TRUNC keyword.

    simply press F1 and see.

    Have a Nice Day,

    Sujeet

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 19, 2009 at 01:34 PM

    Thanks.

    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.