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

Decimal notation incorrect when using WRITE statement

0 Likes
1,636

Hi All,

In a payment run, we have 3 lines:

Customer A 50.00

Customer A 50.00

Customer B 673.00

Customer C 10.00

All lines have the currency GBP.

When the payment hits my code:

DATA: l_amount LIKE reguh-rbetr.

DATA: wa_output-amount(17).

WRITE l_amount TO wa_output-amount.

For line 1, it stays as 50.00

For line 2, it changes to 50,00

For line 3, it changes to 673,00

For line 4, it stays as 10.00

Could anyone explain why this happens?  I know I can fix this by adding CURRENCY 'GBP' to the end of the write statement but I'd like to understand why it happened in the first place.

Thanks,

Gill

1 ACCEPTED SOLUTION
Read only

Private_Member_7726
Active Contributor
0 Likes
1,280

Hi,

Are you 100% positive you can fix it by CURRENCY addition? I vaguely remember that CURRENCY merely determines the number of digits after decimal point and the decimal notation comes from user master, which can be overriden via SET COUNTRY..?

cheers

Janis

Edit in: yes, the first will be output as 50,00 the second as 50.00 on my system

REPORT  zjbtts9.

DATA: p TYPE reguh-rbetr .
DATA: c(32) TYPE c .

p = 50 .

SET COUNTRY 'AT' .
WRITE p TO c CURRENCY 'GBP'.
WRITE: / c.

SET COUNTRY 'GB' .
WRITE p TO c CURRENCY 'GBP'.
WRITE: / c.

Message was edited by: Jānis B

2 REPLIES 2
Read only

Former Member
0 Likes
1,280

Hi Gill,

Try defining your output

DATA: wa_output-amount(17) type RBETR.

Regards,

Kannan

Read only

Private_Member_7726
Active Contributor
0 Likes
1,281

Hi,

Are you 100% positive you can fix it by CURRENCY addition? I vaguely remember that CURRENCY merely determines the number of digits after decimal point and the decimal notation comes from user master, which can be overriden via SET COUNTRY..?

cheers

Janis

Edit in: yes, the first will be output as 50,00 the second as 50.00 on my system

REPORT  zjbtts9.

DATA: p TYPE reguh-rbetr .
DATA: c(32) TYPE c .

p = 50 .

SET COUNTRY 'AT' .
WRITE p TO c CURRENCY 'GBP'.
WRITE: / c.

SET COUNTRY 'GB' .
WRITE p TO c CURRENCY 'GBP'.
WRITE: / c.

Message was edited by: Jānis B