Skip to Content
0
Former Member
Apr 22, 2013 at 02:08 PM

Regarding the sign +/- in the amount field

22 Views

Hi everybody,

i am having one concern in the amount field. i searched in the SDN but i couldnt get the correct solution. Can anyone help me out in this for me.

My issue is, i am having a amount which i am fetching from XYZ table. In that table i am having a field and the amount is directly stored a debit or credit one. like eg 5,55,555.55-. Now i want the value to be displayed in my ALV output as -5,55,555.55 in the numeric format only.

i have written this code which i have shown below. p_amt refers to the data type as p DECIMALS 2 and f_amount refers to the data type char21.

WRITE p_amt TO f_amount.
SHIFT f_amount RIGHT CIRCULAR.
REPLACE ALL OCCURRENCES OF ',' IN f_amount WITH space.
CONDENSE f_amount NO-GAPS.

after this code i tried to pass the f_amount into the numeric format again, but the -ve sign is coming of as it is 5,55,555.55-, instead of -5,55,555.55. if i tried to pass the value as a char to the ALV it is coming as -555555.55, this format customer is not accepting it, due to while he is trying to download the data into the spreadsheet it is coming as a text. they want it in the numeric format so that they can do the calculation.

Can anyone help me out in this, as i tried in the SDN but i couldnt get the proper solution, so i posted it.