Skip to Content
avatar image
Former Member

FM to convert negative value to positive value

hi guys,

any FM to convert negative value to positive value

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

5 Answers

  • Best Answer
    Sep 29, 2008 at 07:05 AM

    why do you need FM? just use pure ABAP to get the absolute value:

    value = ABS( value ).

    hope this helps

    ec

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Sep 29, 2008 at 07:05 AM

    Hi,

    No need for FM, just use the below code;

    IF value LT 0.
        value = value * -1.
    ENDIF.

    This will convert a negative value to positive.

    Regards

    Karthik D

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Sep 29, 2008 at 07:07 AM

    Hi,

    No function module is available as far as i know.

    But you can simple multiply the value with -1. it will give the desired result.

    why you are specillay checking for a FM? any reason?

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Sep 29, 2008 at 07:07 AM
    IF value LT 0.
        value =  0 - value .
    ENDIF.
    
    Add comment
    10|10000 characters needed characters exceeded

  • Sep 29, 2008 at 07:08 AM

    hi,

    check this fm.

    BKK_SET_SIGN_IN_AMOUNT.

    Add comment
    10|10000 characters needed characters exceeded