Monday, 26 September 2016

The hassle with function module calls

Do you know this? You use a function module from SAP (let's say, the very useful START_TIME_DETERMINE), and you use it often. But every time you insert it, half a page of coding is generated, the parameters do not get syntax checked and inline data declarations are not supported.

It would be much more convenient having the same functionality in a method, wouldn't it?

So I create a wrapper method. But where to put it? After a year, I want to find it easily, and I want my colleagues to be able to find it either. Here's my approach:

 I created a package dedicated to OO wrappers for SAP function calls.Then, I created classes that put together wrappers of a similar kind. One criterium for "similar" could be the function pool where the SAP function is in.

Actually, my package looks like this:

The hassle with function module calls

The coding of the wrapper itself is quite easy:

The hassle with function module calls

Just create a coherent interface (with non-generic typed parameters) and call the function.

No comments:

Post a Comment