2

I am missing a part to solve my problem.
If I do this operation :

TYPES: ty_p2 TYPE p DECIMALS 2.
DATA: lv_test TYPE ty_p2.

lv_test = '100.00' * '3.00'.

I got this result in a program (specific program) on debugger view :

enter image description here

this is the actual result I expect.

I got this result in a program (enhancement of a standard) on debugger view :

enter image description here

it's not the right result it's as if it were 100*3000 and it doesn't take into account the comma of the right hand operator of the multiplication.


How do you explain this ?

Is there an instruction which applies to the context of the ABAP session and which can modify the interpretation of the packed number during a multiplication? Or do you know where it comes from?

Thanks !

Suncatcher
  • 10,355
  • 10
  • 52
  • 90
depth1
  • 135
  • 10
  • 3
    Don't add code as screenshot. Screenshot codes cannot be copy-pasted. – József Szikszai Nov 24 '22 at 14:43
  • 2
    Is the "Fixed point arithmetic" turned on? Most like not... SE38 => Display => Menü Goto => Attributes. Popup comes up. Checkbox Fixed point arithmetic – József Szikszai Nov 24 '22 at 14:45
  • Thanks a lot Jozsef! , yeah that's the explanation ! I didnt know about that attribute and btw on abap docu it says its obsolete to uncheck this attribute... and it's disabled on a common standard program. I thought recovering the value on field TRDIR FIXPT with sy-repid to make a special treatment on this... Unless we can retrieve the value otherwise :p ? – depth1 Nov 24 '22 at 16:55
  • 1
    Standard programs I would leave alone, SAP will come out with a correction, if something is not working properly in the standard. I added my comment as an answer. – József Szikszai Nov 24 '22 at 19:47

1 Answers1

6

Fixed point arithmetic is not checked for the program.

When you are in change mode in SE38 (or SE80), use Menü Goto => Attributes enter image description here

A popup comes up the checkbox for "Fixed point arithmetic" has to be checked (bottom-right corner of the popup window): enter image description here

Using F1 Help on the field gives detailed explanation: enter image description here

József Szikszai
  • 4,791
  • 3
  • 14
  • 24