Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Move the sign of the number to front

Former Member
0 Kudos

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

3 REPLIES 3

Former Member
0 Kudos

Hi

use the fun module

<b>CLOI_PUT_SIGN_IN_FRONT</b>

Regards

anji

naimesh_patel
Active Contributor
0 Kudos

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

Former Member
0 Kudos

Hi,

You can use the FM CLOI_PUT_SIGN_IN_FRONT.

Thanks,

Sriram Ponna.