Adding TABSTRIP in ABAP Selection Screen - SAP


How to add Tabstrips in Selection Screen using ABAP programming?

SAP ABAP Programming


Define a selection screen 100 as the subscreen. Within the subscreen, define a parameter according to your requirement.




Define a selection screen 101 as the subscreen. Within the subscreen, define a parameter according to your requirement.




Now assign the Tabs to the subscreen 100 and 101.



Name the Tabstrips as per your requirement.



Press F8 to execute the program and you will see the result as below.





Adding Push Buttons in Selection Screen Toolbars - SAP ABAP


Adding Push Buttons in Toolbars

SAP ABAP

The screen fields in the selection screen are controlled by the structure SSCRFIELDS.


You have at max of 5 push buttons to be used in the selection screen.


Push buttons are declared in the selection screen using FUNCTION KEY.


Each FUNCTION KEY is assigned to the SSCRFIELDS structure and the text label for the push buttons can be labelled in the structure elements. See the program below.


In the initialization event, the respective texts for the buttons are assigned to the functxt_01 to functxt_05.


In the AT SELECTION-SCREEN event, the function code is automatically assigned in the
SSCRFIELDS-UCOMM.




Output










ABAP REGEX Statement usage in STRING


ABAP REGEX statement to remove special characters from a STRING

ABAP Tips and Tricks

To remove the special characters from the string, use replace all and regex statement to do so.
Let's see the process with an example.
The replace all occurrences is added having the regular expression [^\d].




Enter the value for the string with special characters




Press F8 to execute the program.
After executing the program, you will get the output without special characters.













REGEX Statement instead of IF statement in SAP ABAP



Usage of REGEX Statement instead of IF statement with multiple Conditions

Tips and Tricks:

Code a program with if statement that will check if the value of a parameter variable field has the value equal to ABC, DEF, or CDE. In case the value is equal to any of the three, the message Field Value is Valid is displayed. We will then see the equivalent regex.




Instead of IF statement, write a find REGEX statement along with the regex '[ABC|CDE|DEF]'.


We have used an OR (|) operator within the find statement. A match is found if the value of the three-character field is equal to any of the three values specified. In this case, sy-subrc is equal to zero, and the success message is then displayed.
In case, you need to ignore the CASE, add IGNORING CASE in the FIND REGEX statement.