Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 8332

Re: Uncatchable runtime error on returning method call

$
0
0

I asked the developers if it is a bug or a feature.

 

If it is a feature (the documentation cited by Suhas points in that direction), I will make it more clear there and add an example.

 

As of Release 7.40, you can use the conversion operator CONV in order to achieve the expected behavior!

 

TYPES dec8 TYPE p LENGTH 8.
TYPES dec1 TYPE p LENGTH 1.

 

CLASS demo DEFINITION.
  PUBLIC SECTION.
    CLASS-METHODS main RETURNING VALUE(p8) TYPE dec8.
ENDCLASS.

 

CLASS demo IMPLEMENTATION.
  METHOD main.
    p8 = 12345.
  ENDMETHOD.
ENDCLASS.

 

START-OF-SELECTION.

  DATA p1 TYPE dec1.

  TRY.
     "p1 = demo=>main( ).
      p1 = CONV dec8( demo=>main( ) ).
    CATCH cx_sy_conversion_overflow.
  ENDTRY.

 

 

 


Viewing all articles
Browse latest Browse all 8332

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>