title: Define returning type as packed number for method
body: <p>I am learning ABAP Objects. I'd like to have an object method returning packed number type. I've made that working finally, but I don't know if it is the correct way and I'd need some further explanation which I can't find online.</p>
  
  <p>For integer, it works fine:</p>
  
  <pre><code>METHODS: getamount RETURNING VALUE(r) TYPE i,
  </code></pre>
  
  <p>For packed number it doesn't:</p>
  
  <pre><code>METHODS: getamount RETURNING VALUE(r) TYPE p,
  </code></pre>
  
  <blockquote>
    <p>Error: The type of RETURNING parameter must be fully specified</p>
  </blockquote>
  
  <pre><code>METHODS: getamount RETURNING VALUE(r) TYPE p LENGTH 10 DECIMALS 3,
  </code></pre>
  
  <blockquote>
    <p>Error: The type of RETURNING parameter must be fully specified</p>
  </blockquote>
  
  <p>(1) Is there way to make it work with <code>p</code> type?</p>
  
  <p>I made it work by using <code>dec5_2</code>:</p>
  
  <pre><code>getamount RETURNING VALUE(r) TYPE dec5_2
  </code></pre>
  
  <p>(2) Is it the correct alternative? Is there a list of similar types?</p>
  
  <p>Also, I found <a href="https://archive.sap.com/discussions/thread/3443867" rel="nofollow noreferrer">this solution</a>, but it doesn't work for me:</p>
  
  <pre><code>CLASS lcl_rowinvoice DEFINITION.
    PUBLIC SECTION.
      METHODS:
        getamount RETURNING VALUE(r) TYPE typeprice,  
    PRIVATE SECTION.
      TYPES:
        typeprice TYPE p LENGTH 10 DECIMALS 2,
  </code></pre>
  
  <blockquote>
    <p>Unknown type "TYPEPRICE".</p>
  </blockquote>
  
  <p>(3) Is there way to make this solution to work?</p>