11-21-2007 3:47 PM
Dear ALL,
Could you tell me please how I can move the sign of the number to front?
For example I have 235,00-. I need -235,00.
Thanks a lot.
Best regards
Igor
11-21-2007 3:54 PM
11-21-2007 4:00 PM
Try with this:
REPORT ZTEST_NP.
DATA: P_DBMTR TYPE DMBTR.
DATA: C_VALUE(20),
L_VALUE(19),
L_SIGN.
P_DBMTR = '123456.78-'.
C_VALUE = P_DBMTR.
IF C_VALUE CA '-'.
SPLIT C_VALUE AT '-' INTO L_VALUE L_SIGN.
CONCATENATE '-' L_VALUE INTO C_VALUE.
CONDENSE C_VALUE.
SHIFT C_VALUE RIGHT DELETING TRAILING SPACE.
ENDIF.
WRITE: C_VALUE.
One drawback, you will not able to total on this value.
Regards,
Naimesh Patel
11-21-2007 4:00 PM
Hi,
You can use the FM CLOI_PUT_SIGN_IN_FRONT.
Thanks,
Sriram Ponna.