Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

select-options

Former Member
0 Likes
982

how to provide mandatory field in select-options

plz help me out

9 REPLIES 9
Read only

Former Member
0 Likes
955

HI

Do like this...

SELECT-OPTIONS : so_vstel FOR likp-vstel OBLIGATORY ,

so_lgort FOR t001l-lgort OBLIGATORY .

Hope it helps.

Praveen

Read only

Former Member
0 Likes
955

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.

Read only

Former Member
0 Likes
955

hi

SELECT-OPTIONS so_kunnr FOR wa_kna1-kunnr OBLIGATORY.

Read only

Former Member
0 Likes
955

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

Read only

Former Member
0 Likes
955

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*****************

Read only

Former Member
0 Likes
955

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.

Read only

Former Member
0 Likes
955

Eg. code

SELECT-OPTIONS: s_matnr for matnr OBLIGATORY.

Hope dis helps..

Reward all helpful ans

Read only

Former Member
0 Likes
955

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.

Read only

Former Member
0 Likes
955

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