Skip to Content

How to shift Negative sign from Right to left in ALV if data type is P

Hi Experts,

I have a requirement to display '-' sign in left side of field value in ALV output, But the field refers to data type is Packed decimal. Earlier blogs are telling use data type char then it will work in this case we cannot use filter option for that column in ALV output, Any leads how to do this with refer to data type as a packed decimal.

Thanks,

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

6 Answers

  • Jan 16, 2017 at 07:17 AM

    Did you try to add an EDIT_MASK in the field catalog? (Look for character "V" in USING EDIT MASK mask)

    Regards,
    Raymond

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jan 16, 2017 at 05:06 AM

    Hi Ramesh,

    Try this:

    *******************************

    data : lv_var1 type p VALUE '10-'.
    data : lv_var2 type char5 .

    lv_var2 = lv_var1.

    CALL FUNCTION 'CLOI_PUT_SIGN_IN_FRONT'
    CHANGING
    value = lv_var2
    .

    WRITE : lv_var2.

    *******************************

    Regards

    Ajeet Kumar

    Add comment
    10|10000 characters needed characters exceeded

  • Jan 15, 2017 at 07:36 PM

    See the following recent questions :


    Use FM "CLOI_PUT_SIGN_IN_FRONT" to reposition the negative sign ...

    Add comment
    10|10000 characters needed characters exceeded

  • Jan 16, 2017 at 05:36 AM

    Hi Ajeet,

    Thanks for replying my post but what you are suggesting already i tried . That is not my requirement.

    my requirement is need to put '-' sign symbol in left side of field value and that field is referring to data type P.

    Thanks.

    ,

    Hi Nic,

    I saw your link's which was you sent, but there they are using char field for sign symbol, which i already mentioned in my post. Do you have any idea how to display '-' sign symbol in packed decimal field.

    Thanks,

    Add comment
    10|10000 characters needed characters exceeded

  • Jan 16, 2017 at 10:31 AM

    1) Create FM CONVERSION_EXIT_ZZZZZ_OUTPUT where you will call FM CLOI_PUT_SIGN_IN_FRONT to move sign to the left

    2) Add edit mask for your column in ALV as ==ZZZZZ

    Add comment
    10|10000 characters needed characters exceeded

  • Jan 16, 2017 at 11:48 AM

    Hello,

    There's a string template formatting option which lets you position the SIGN. You don't need to use FM CLOI_PUT_SIGN_IN_FRONT.

    BR,

    Suhas

    Add comment
    10|10000 characters needed characters exceeded