ABAP Editor/Workbench Custom Dynamic Patterns
In my last post ABAP Editor dynamic patterns, We saw how we can
use the patterns to our advantage.
Today, I wanted to expand upon further features of dynamic patterns, which is the ability to write and add your own dynamic patterns.
Let's say you want to define a template for the generation of DB validation code and provide your table name as input.
Select Utilities > More Utilities > Edit Pattern > Create Pattern and enter a name for your pattern.
You will be presented with a text editor screen, Add the following code:
*$&$MUSTER
The above code tells the runtime to call a function module with the naming convention:
<pattern_name>_editor_exit. >
The next obvious step is to create the FM with the above-discussed name.
The FM has a defined interface of a TABLES parameter BUFFER of type RSWSOURCET.
The table is used to pass back the code to the editor.
Insert Below code in the source code tab.
Offcourse, You can expand upon it or create your own pattern with extra functionalities.
As always, Hope you like the post and use the information in your day-to-day work.
Today, I wanted to expand upon further features of dynamic patterns, which is the ability to write and add your own dynamic patterns.
Let's say you want to define a template for the generation of DB validation code and provide your table name as input.
Creating the Pattern.
From the ABAP editor,Select Utilities > More Utilities > Edit Pattern > Create Pattern and enter a name for your pattern.
Type name for the pattern:
You will be presented with a text editor screen, Add the following code:
*$&$MUSTER
The above code tells the runtime to call a function module with the naming convention:
<pattern_name>_editor_exit. >
The next obvious step is to create the FM with the above-discussed name.
The FM has a defined interface of a TABLES parameter BUFFER of type RSWSOURCET.
The table is used to pass back the code to the editor.
Insert Below code in the source code tab.
Call the new pattern:
Input table name:
Generated Code:
So there you have it, Your own Dynamic pattern to help you out with writing DB
Existence check.
Offcourse, You can expand upon it or create your own pattern with extra functionalities.
As always, Hope you like the post and use the information in your day-to-day work.