‎2008 Feb 27 4:08 AM
how to provide mandatory field in select-options
plz help me out
‎2008 Feb 27 4:10 AM
HI
Do like this...
SELECT-OPTIONS : so_vstel FOR likp-vstel OBLIGATORY ,
so_lgort FOR t001l-lgort OBLIGATORY .
Hope it helps.
Praveen
‎2008 Feb 27 4:12 AM
Sagar,
at selection-screen. on s_date.
if s_date-low is initial.
error message.
endif.
If you want mandatory for high value you can do same thing..
if s_date-high is initial.
error message.
endif.
‎2008 Feb 27 4:13 AM
‎2008 Feb 27 4:16 AM
hi,
Pass sets of values, which ABAP/4 uses in the report to check whether data base field or report-internal fields are within a certain value range. The result of such a check can be used to control the program flow.
You declare selection variables using the SELECT-OPTIONS statement.
DATA SELECT-OPTIONS field1 FOR field2.
Effect
Declares a selection variable field1 for field2. Field1 may be up to 8 characters long.
This statement defines an internal table field1 with a fixed structure, which consists of the fields field1-SIGN, field1-OPTION, field1-LOW, field1-HIGH. While field1-SIGN, field1-OPTION have a fixed format (type character, length 1 and 2 respectively), field1-LOW, field1-HIGH inherit the type and length of the reference field field2.
If the user enters a selection on the selection screen, the internal table field1 is automatically filled. You can use normal ABAP statements to read and manipulate the internal table field1.
The statements select-options and parameters determine the technical interface and the user interface. The parameters and select options you specify are displayed on the selection screen for the user to enter values.
Under Text elements/Selection texts of GOTO (Menu Bar), you can enter a description for each selection criteria like field1. This description is displayed on the selection screen. If no such text exists, the name field1 of the selection option is displayed instead.
SELECT-OPTIONS s_matnr FOR wa_mara-matnr NO INTERVALS OBLIGATORY
Edited by: p541399 on Feb 27, 2008 9:49 AM
‎2008 Feb 27 4:17 AM
hI
YOU GIVE THE OBLIGATORY FOR THAT FILED
BY DOING LIKE THIS
SELECT-OPTIONS : S_EBELN FOR EKKO-EBELN NO INTERVALS OBLIGATORY .
OR YOU CAN RESTRICT THE USER BY ENTIRING WRONG VALUES BY VALIDATION
LIKE THIS
***************SCREEN VALIDATIONS *****************
at selection-screen.
SELECT SINGLE *
FROM EKKO
INTO EKKO
WHERE EBELN IN S_EBELN.
IF SY-SUBRC <> 0.
SET CURSOR FIELD 'S_EBELN-LOW'.
MESSAGE E999 WITH TEXT-005.
ENDIF.
********end of screen validation*****************
‎2008 Feb 27 4:21 AM
Hi,
SELECT-OPTIONS
Declares selection criteria for a selection screen.
Syntax
SELECT-OPTIONS <sel> FOR <f>
[DEFAULT <g> [to <h>] [OPTION <op>] SIGN <s>]
[MEMORY ID <pid>]
[LOWER CASE]
[OBLIGATORY]
[NO-DISPLAY]
[MODIF ID <key>]
[NO-EXTENSION]
[NO INTERVALS]
[NO DATABASE SELECTION].
Declares a selection table <sel> for the field <f>. For <sel>, places input fields on the corresponding selection screen. The additions allow you to set a default value, accept input in lowercase, define a required field, suppress or modify the display on the selection screen, restrict the selection table to a line or a selection to a single field, or prevent input from being passed to a logical database
Regards,
Priya.
‎2008 Feb 27 4:24 AM
Eg. code
SELECT-OPTIONS: s_matnr for matnr OBLIGATORY.
Hope dis helps..
Reward all helpful ans
‎2008 Feb 27 4:36 AM
HI Sagar,
This is a standrad functionality of SAP.
In order to achiev the requirement you have to code within AT SELECTION-Screen on s_field.
At selection-screen of s_field.
if s_field[] is initial.
message e000 with ' S_field is mandatory'.
endif.
‎2008 Feb 27 5:22 AM
hi,
the mandatory select option can be given like this
select-options: s_ebeln for ekko-ebeln no-extension obligatory.when 'Obligatory' addition is specified , we cant exit the selection screen using F8 , but to exit u need to use either back or canc or exit buttons.
by using this u can specify a single mandatory value on the selection screen.
regards,
sandhya