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
1,004

Hi All,

I have 2 select-options in my selection-screen.i have to vlaidate if user entered correct value or not for low and high values.

Plese give me the code.

thakns&Regards.

Ramu.

11 REPLIES 11
Read only

Former Member
0 Likes
975

hi,

why dont u try this..

select-options: s_a for csks-kostl .

at selection-screen on s_a .

if s_[]is initial .

  • error message

else .

if s_a-low is initial and s_a-high is initial .

*error message

endif .

endif .

Rewards useful points....

Siva

Read only

Former Member
0 Likes
975

Hi,

Make sure that u are validating against the header table.

say eg if u wnat t validate matnr in marc, then do as below.

SELECT-OPTIONS: s_matnr FOR  marc-matnr.                  "Material No
AT SELECTION-SCREEN.

*Validate material no details
  PERFORM validate_matno.
FORM validate_matno.
DATA: v_matnr LIEK mara-matnr.
IF NOT s_matnr[] IS INITIAL.
LOOP AT s_matnr.
  SELECT SINGLE matnr INTO v_matnr
         FROM <b>mara</b>
         WHERE matnr = s_matnr-low.

  IF sy-subrc NE 0.
    MESSAGE i128.
    LEAVE LIST-PROCESSING.
  ENDIF.
ENDLOOP.
ENDIF.
ENDFORM.

<b>Dont select from marc.</b>

Hope this is clear.

Read only

Former Member
0 Likes
975

Hi,

write the code in AT selection-screen to validate the same

regards

Shiva

Read only

Former Member
0 Likes
975

select-options : s1 for mara-matnr,

s2 for mard-lgort.

at selection-scree.

if s1-low ne '1000'.

message 'error' type 'E'.

endif.

if s1-high ne '1003'.

message 'error' type 'E'.

endif.

like that for s2-low and s2-high...also

start-of-selection.

regards

shiba dutta

Read only

Former Member
0 Likes
975

Hi,

for example you have s_werks as selectoption.

we need to validate this from checktable,because check table contain all possible values of that perticular field.

SELECT WERKS

FROM TOO1W

INTO LV_WERKS

WHERE WERKS IN S_WERKS_LOW.

IF LV_WERKS IS INITIAL.

WRITE: 'ENTER VALID PLANT'.

ENDIF.

For validating high value do as follows.

select werks

from t001w

into lv_werks

where werks in s_werks_high.

if l_werks is initial.

write:'enter valid plant'.

endif.

Thanks,

Sarala.

Message was edited by:

Sarala

Read only

jayanthi_jayaraman
Active Contributor
0 Likes
975

Hi,

at selection-screen output.

if not s_1[] is initial.

loop at s_1.

if s_1-low = value1 .

endif.

if s_1-high = value2.

endif.

endloop.

endif.

Read only

Former Member
0 Likes
975

Hi,

here is the code for one of the select-options field..

select-options:s_phase for QMEL-PHASE .

AT SELECTION-SCREEN ON s_phase.

PERFORM validate_phase_low USING s_phase-low.

PERFORM validate_phase_high USING s_phase-high.

*************************************************************

FORM validate_phase_low USING S_PHASE_LOW.

IF NOT s_phase_low IS INITIAL.

SELECT phase

FROM qmel INTO s_phase_low

WHERE phase EQ s_phase_low.

EXIT.

ENDSELECT.

IF sy-subrc NE 0.

MESSAGE e897(qm) WITH text-002.

ENDIF.

ENDIF.

ENDFORM. " validate_phase_low

*************************************************************

FORM validate_phase_high USING S_PHASE_HIGH.

IF NOT s_phase_high IS INITIAL.

SELECT phase

FROM qmel INTO s_phase_high

WHERE phase EQ s_phase_high.

EXIT.

ENDSELECT.

IF sy-subrc NE 0.

MESSAGE e897(qm) WITH text-002.

ENDIF.

endif.

ENDFORM. " validate_phase_high

thanks,

Manjunath MS

Read only

0 Likes
975

Am Having 2 select-options.i need to validate 2.

Regards.

Ramu.

Read only

0 Likes
975

Hi,

I have given u the code for one say one is MaTNR and the other is userid.

Same way

AT SELECTION-SCREEN ON s_user.
Perform validation_user

.

Let me know the two fields and table names.

Read only

0 Likes
975

Ramu,

say you have the below two Select-options:

SELECT-OPTIONS: s_matnr for mara-matnr,

s_werks for marc-werks.

write check as below:

DATA: p_matnr like mara-matnr,

p_werks like marc-werks.

AT SELECTION-SCREEN.

IF NOT s_matnr[] IS INITIAL.

select single matnr into p_matnr from mara where matnr in s_matnr.

if sy-subrc ne 0.

*ERROR MESSAGE

endif.

ENDIF.

IF NOT s_werks[] IS INITIAL.

select single werks into p_werks from too1w where werks in s_werks.

if sy-subrc ne 0.

*ERROR MESSAGE

endif.

ENDIF.

Read only

Former Member
0 Likes
975

Repeate the same code for second select-option field also.

its same for each and every select-option.

Thanks,

Sarala.