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

write statement

Former Member
0 Likes
967

I have a write statement in a program .

WRITE W_OVERALL_CUR TO T_0300-OVERALL CURRENCY T_0300-PWHIE.

currency key has 0 decimal places,

w_overall_cur is 100.00

t_0300-overall is initially 100 and changing to 10,000 . Its like the original value is being multiplied by 100.

how do i correct this error?

7 REPLIES 7
Read only

Former Member
0 Likes
935

Hi,

make sure W_OVERALL_CUR is of type i or p.

regards,

Joris

Read only

Former Member
0 Likes
935

Sri

Instead of write use PACK stmt. or if you still want to use WRITE stmt go and check the decimal notation in your User Profile. Set it according to your requirement.

Regards,

Vinod.

Read only

0 Likes
935

how do i use pack statement? w-overall_cur is not of of type C.

Read only

Former Member
0 Likes
935

clear T_0300-OVERALL before the write statement and see..

Read only

former_member194669
Active Contributor
0 Likes
935

Hi,

Try this way

DATA v_curr TYPE p LENGTH 13 DECIMALS 0 VALUE '10,000'.

WRITE v_curr NO-GROUPING DECIMALS 0.

aRs

Read only

nitesh_jain3
Active Participant
0 Likes
935

Dear Sri,

This is not an error.. This is the correct behaviour..

Check what is the currency being populated at run time in T_0300-PWHIE.. Based on this currency the decimals in the field holding the Amount gets adjusted.. In the database all currencies are stored with 2 decimal places that is why during output you use the extension currency to adjust the decimal places based on the currency of the amount you want to display..

Cheers

Nitesh

Read only

Former Member
0 Likes
935

Hi Sri ,

This statement will write the contents in the fields based on T_0300-PWHIE.

Whatever format this particular currency has the value will be made in that format,make sure that you really want to write content based on the currency ..

I think you are writing this value in the JPY ) japanese currency ) then as per your line its correct because JPY there are no decimals .

Praveen.

HOPE THIS HELPS .