title: How to define a Returning parameter?
body: <p>I get used to JAVA, thus having problem to write this code in ABAP.</p>
  <p>I call a method with two parameters. It should return a number, so I can save it.</p>
  <p>What I want is</p>
  <pre><code>int result = generate_num(40,5);
  
  int generate_num(int thisNum, int newDigit){
      return thisNum * 10 + newDigit;
  }
  </code></pre>
  <p>In ABAP I tried this so far.</p>
  <p>//Declared Method</p>
  <pre><code>methods GENERATE_NUM
  importing
    !thisNum type I
    !NEWDIGIT type DIGIT_NUMBER_VALUE.
  </code></pre>
  <p>//Calling Method</p>
  <pre><code>CALL METHOD me-&gt;Generate_NUM
     EXPORTING
         thisNUm = 40
         newDigit = 5.
  </code></pre>
  <p>//Method itself</p>
  <pre><code>METHOD GENERATE_NUM.
  
    
  DATA: newNum type i.
  
    If thisnum &lt; 0.
      newNum = thisnum * 10 - newdigit.
    Else.
      newNum = thisnum * 10 + newdigit.
    ENDIF.
  
    RETURNING VALUE(newNum).   
  
  ENDMETHOD.
  </code></pre>
  <p>But I get lost in this code, have no idea how to return a value and how to save it in another variable.</p>