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

FM for negative values

Hi Friends,

I am getting values in negatiive like this 2,32,542- I want to put the negative sign in front of the value

-2,32,542, is there any function module for this.

Please help me.

Thanx in advance,

Venu

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Oct 14, 2006 at 09:21 AM

    Hi Venu,

    check this function module..

    CLOI_PUT_SIGN_IN_FRONT will move the negative sign from the left hand side of a number, to the right hand side of the number. Note that The result will be left justified (like all character fields), not right justifed as numbers normally are.

    chck this example..

    data: a1 type i value 56 ,

    a2 type i value 60,

    res type i.

    res = a1 - a2.

    data: res1(10).

    res1 = res.

    CALL FUNCTION 'CLOI_PUT_SIGN_IN_FRONT'

    CHANGING

    VALUE = res1.

    write res1.

    ===============================[OR]

    <b>data : char(20).

    data : val type i.

    val = val - 50.

    if val < 0.

    write val to char.

    concatenate '-' char into char .

    condense char no-gaps.

    endif.

    write : / char.</b>

    reward if useful..

    Thaks,Eswar

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Hi

      loop at it_mseg.

      AT END OF matnr.

      • Material No.

      lw_final-matnr = lw_mseg-matnr.

      • Opening qty

      lw_final-openqty = lf_open_rec_qty - lf_open_issue_qty.

      • lw_final-recpqty =

      • lw_final-issuqty =

      • Closing qty

      <b>lw_final-closqty</b> = lf_close_rec_qty - lf_close_issue_qty.

      • Getting Material Description

      SELECT SINGLE maktx INTO lf_maktx

      FROM makt

      WHERE matnr = lw_mseg-matnr

      AND spras = sy-langu.

      • Materail Description

      lw_final-maktx = lf_maktx.

      endloop.

      I want to change the value of this field.

      lw_final-closqty

      Please help me,

      thanx in advance.

      Venu

  • Posted on Oct 14, 2006 at 10:36 AM

    hi venu,

    chk this sample.

    v_amount = itab-shkzg.

    CALL FUNCTION 'CLOI_PUT_SIGN_IN_FRONT'

    CHANGING

    VALUE = itab-shkzg.

    v_amount = itab-shkzg

    endif.

    rgds

    anver

    Message was edited by: Anversha s

    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.