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: 

Decimal place in pricing condition value routine - Move string value to a p type variable

allenchenit
Explorer
0 Kudos
1,062

Hi there,

I tried to search but failed to find any valuable info. to my issue, hence I raise it here.

I am going to create a SD pricing condition value routine with purpose of rounding the condition value.

I create the condition value routine via VOFM as below.

I've create the routine 978 (form RV64A978), to demonstrate my query I simplified the code as below.

When I tried to move the string value of variable lv_pricechar = '0.01' to p type variable lv_price_arr it becomes 0.0001(expected value should be 0.01) which was divided by 100.

But when I copied the same codes to create a new report program and ran directly, the lv_price_arr turns to be 0.0100 now in the program.

Anyone know why within the pricing condition value routine run the lv_price_arr would be divided by 100 when its value was copied from a char type variable.

Appreciated your clarification.

Thank you!

Allen

1 ACCEPTED SOLUTION

Sandra_Rossi
Active Contributor
706

It has been asked a lot of time but probably it's difficult to find those questions.

It's due to the old program attribute "fixed-point arithmetics". By default, new programs have it set to CHECKED. SD programs had this flag NOT CHECKED, therefore by assigning the value '0.01' the decimal point is ignored (like integer value 1) both in source and target and you see '0.0001' in target variable.

EDIT: as Allen said, I incorrectly inverted Checked/Not checked, now it's corrected.

3 REPLIES 3

Sandra_Rossi
Active Contributor
707

It has been asked a lot of time but probably it's difficult to find those questions.

It's due to the old program attribute "fixed-point arithmetics". By default, new programs have it set to CHECKED. SD programs had this flag NOT CHECKED, therefore by assigning the value '0.01' the decimal point is ignored (like integer value 1) both in source and target and you see '0.0001' in target variable.

EDIT: as Allen said, I incorrectly inverted Checked/Not checked, now it's corrected.

706

Thank you very much Sandra,

You are right, it is related to fixed-point arithmetic.

Just to correct, by default new program is flagged, while this calling program in SD pricing has it removed.

New program -

SD pricing program -

Thank you again, issue resolved.

0 Kudos
706

Thanks for the feedback. Answer corrected for the future visitors.