There is a very important time-saving ABAP Editor setting that enables data declaration of actual parameters when calling a function module (FM) or class method. The setting should work fine on ABAP release 731 and above.
After enabling the setting, call pattern for FM would look like this:
Call pattern of class method would look like this:
The settings can be found in ABAP Editor > Utilities > Settings > ABAP Editor > Editor > Pattern
I had seen the setting about 1 year ago on 701 release but the meaning was not so obvious. Enabling the setting did nothing on that release.
The text ( Name Actual Parameter Same as Name Formal Param. ) does not suggest that the actual parameters will be declared automatically.
F1 help or verbatim Google search returned 0 hits.
This 4 years old blog explains how to insert custom pattern (FM and data declarations) using ABAP Editor exit.
Call a function module in the ABAP Editor: Stop Crying - Start Laughing.
This ready-made solution was luckily present in my work environment. Excited by the thought of saving so much time, I started using the editor exit.
My work environment changed some time back ( different system having 731 release ) and the custom pattern was no longer with me.
I missed the functionality but didn't install the code due to:
Couple of days ago I finally installed the editor exit. Nowadays I am trying to use methods instead of forms. As an exercise, I thought of understanding how the code works so that some day I'll replace all forms with methods and probably improve the code using newer ABAP features.
The custom code reads FM's formal parameters, determines the types, generates code for data declaration and then generates code for FM call. I thought to see how the standard generates FM call and reuse that code if possible. While debugging standard Call Pattern > Call Function, I found that there is an FM to generate the FM call. After generating the FM call code, there was additional code enclosed in IF condition. It really looked like the code is present for data declaration but it is not getting called.
The IF condition was on field of table RSEUMOD, which stores user specific ABAP workbench settings. This meant the setting can be activated somewhere in ABAP Editor settings. Added bonus was that similar setting is present for class methods too, which my custom editor exit didn't do. I tried out same thing on 701 release ABAP trial and found that even though the setting is present in options, there is no corresponding code to do something with it.
This is how I came to know about the setting while debugging standard code.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
4 | |
2 | |
2 | |
2 | |
2 | |
2 | |
1 | |
1 | |
1 | |
1 |