Skip to Content

calling a function inside a method.

Okay, so I'm a newbie in OO ABAP(having a bit hard time wrapping my head around it), I have to call a function inside a method, so I'm having a bit of confusion with the exporting and importing parameters, my function has many importing and exporting parameters, do I have to declare them all in the method's importing/exporting parameters also? please explain with an example if possible. Thank you.

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

2 Answers

  • Best Answer
    Jun 28, 2018 at 07:02 AM

    I applaud your desire to learn to program OO. Too many new programmers are firmly stuck in the last century.

    If you are encapsulating the function module in a method, then you'll need to replicate all the parameters. if you're happy with some defauls then you could, for example, set some constants in the class and use them for the defaulted values. If perhaps some of the values are being held as attributes of the class, then you'd use those.

    Really it depends on what your method is for and the reason for using that function module.

    If you have time, you could try to learn OO programming as I did. I taught myself Java through the Head First Java book (O'Reilly Press). Then applied what I learned to ABAP. Next step would be to do the TDD course on openSAP.

    Add comment
    10|10000 characters needed characters exceeded

  • Jun 28, 2018 at 07:01 AM

    Welcome to the ABAP world :-)

    The signature of your method and the function module is independent from each other.



    Add comment
    10|10000 characters needed characters exceeded