Application Development and Automation 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: 
Read only

Replacing 00

Former Member
0 Likes
705

hi all,

i have a value in field amount1 = '43050.00' and amount2 = '55'. my problem is that i have to convert

amount1 as '43050.55'. while amount2 is not fixed it may be '67' or '88' etc. please help me how to convert it?

regards saurabh.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
650

Hi,

DATA: amount3 TYPE p DECIMALS 2.

amount3 = amount1 + amount2 / 100.

Regards,

Ali

6 REPLIES 6
Read only

Former Member
0 Likes
650

Hi Saurabh,

You can declare amount2 as Type P Decimal 2 . And then add the two amounts(Amount1 and Amount2). You'll get the desired result.

Thanks

Nidhi

Read only

0 Likes
650

hi nidhi thanx for reply,

my code is :

data : amount1 like BSEG-WRBTR ,

amount2(2) type c.

amount1 = '34034.00' and amount2 = '56'.

but i need to convert it as amount1 = '34034.56'.

please help me.

regards saurabh.

Read only

0 Likes
650

Hey Saurabh,

You can modify your own code itself. Check this out.



data : amount1 like BSEG-WRBTR ,
amount2(4) type c.

amount1 = '34034.00' . amount2 = '56'.
amount2 = amount2 / 100.
amount1 = amount1 + amount2.

This should work.

Cheers,

Vishnu

Read only

Former Member
0 Likes
650

REPORT ZSRK_064.

DATA : AMOUNT1 LIKE VBAP-NETPR,

AMOUNT2(2),

TEMP(4) TYPE P DECIMALS 2.

AMOUNT1 = '43050.00' .

AMOUNT2 = '65'.

MOVE AMOUNT2 TO TEMP.

TEMP = TEMP / 100.

AMOUNT1 = AMOUNT1 + TEMP.

WRITE : / AMOUNT1.

Read only

Former Member
0 Likes
651

Hi,

DATA: amount3 TYPE p DECIMALS 2.

amount3 = amount1 + amount2 / 100.

Regards,

Ali

Read only

Former Member
0 Likes
650

>

> hi all,

>

> i have a value in field amount1 = '43050.00' and amount2 = '55'. my problem is that i have to convert

> amount1 as '43050.55'. while amount2 is not fixed it may be '67' or '88' etc. please help me how to convert it?

>

> regards saurabh.

data : amount1 like BSEG-WRBTR ,

amount2(2) type c.

amount1 = '34034.00' and amount2 = '56'.

but i need to convert it as amount1 = '34034.56'.

Hi saurabh,

Why dont u declare amount2 as packed decimal instead of character. Then u can do the rest as said above.

Thanks

Nitesh

Edited by: Nitesh Kumar on Nov 17, 2008 2:55 PM