Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
642 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 Reply

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.

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...