SAP ABAP SELECT-OPTIONS restricting entry to single fields
In the selection screen if the entry is to be restricted to single field then the following Syntax can be used.
SELECT-OPTIONS s_vbeln FOR VBAK-VBELN NO INTERVALS
If the above statement is used in the program then only one field appears in the Selection-Screen. You can also use NO-EXTENSION in case you want to suppress the push button for multiple selection. In that case the syntax would be as follows.
SELECT-OPTIONS: s_vbeln for vbak-vbeln NO-EXTENSION NO INTERVALS
Find the code below.
REPORT ZEX_SELECTOPTIONS.
Tables: VBAK, VBAP.
Data: int_vbak type vbak occurs 0 with header line.
Select-options: s_vbeln for vbak-vbeln NO-EXTENSION NO INTERVALS.
Select * INTO int_VBAK from VBAK where VBELN in s_vbeln. APPEND int_VBAK. CLEAR int_VBAK. ENDSELECT.
Always use Pretty Printer and Extended Program Check before releasing the code.
Do not leave unused code in the program. Comment the code thoroughly. Align the comments and the Code. Follow the SAP Standards and SAP Best Practices guidelines. It’s a good practice to take a dump of the code on your local drive.
No comments:
Post a Comment