Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
619 views
in Technique[技术] by (71.8m points)

abap - Amount Field Length Extension: Code Adaptations (2 decimals / 3 decimals)

While preparing for the conversion to S/4HANA, our custom code check produces following error message:

Old Arithmetic type conflict (Type DMBTR, Note: 0002610650) P(13,3)

I have recreated the problem in a simple demo program.

DATA: punit TYPE dmbtr,                 "curr(23,2)
      two   TYPE dmbtr VALUE '12.55',   "curr(23,2)
      three TYPE menge_d VALUE '5.123'. "quan(13,3)
CATCH SYSTEM-EXCEPTIONS arithmetic_errors = 4.
  punit = two / three.
ENDCATCH.
WRITE (26) punit.

The error is in the line punit = two / three.

I've already checked the SAP Note 2610650 but can not find any useful information in it. Hope you can help me.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

With the new data type dmbtr_cs it worked fine. (see SAP Note 2628040)

DATA: punit TYPE dmbtr_cs,
      two   TYPE dmbtr_cs VALUE '12.55',
      three TYPE menge_d VALUE '5.123'.

CATCH SYSTEM-EXCEPTIONS arithmetic_errors = 4.
  punit = two / three.
ENDCATCH.

WRITE (26) punit.

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...