Skip to Content
avatar image
Former Member

what is the function module that displays negative numerical number in abap?

; eg in abap -45 is displayed as 45- ,so how to display -45?

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Mar 09, 2017 at 11:37 AM

    Hi,

    Use the below function module to change the opposite sign symbol..,

    REPORT  z_demo_jg1.
    
    PARAMETERS p_amount(10) TYPE c OBLIGATORY DEFAULT '100.15-'.
    
    WRITE:/ 'BEFORE:', p_amount.
    
    CALL FUNCTION 'CLOI_PUT_SIGN_IN_FRONT'
      CHANGING
        value = p_amount.
    
    WRITE:/ 'AFTER:', p_amount.
    
    Thanks,
    Patan.
    Add comment
    10|10000 characters needed characters exceeded

  • Mar 09, 2017 at 11:41 AM

    Hi,

    Check the FM: CLOI_PUT_SIGN_IN_FRONT

    You can try this below code also:

    SHIFT amount RIGHT DELETING TRAILING '-'.

    SHIFT amount LEFT DELETING LEADING ' '.

    CONCATENATE '-' amount INTO amount.

    Regards,
    Kiran

    Add comment
    10|10000 characters needed characters exceeded