Application Development 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: 

Logic in S E L E C T I O N S C R E E N

Former Member
0 Kudos

Hello Experts,

I want logic for ,if i want in S E L E C T I O N S C R E E N ,at least one select option must be fill by user or both can be filled.

Plz tell me how can i proceed.

Definitely rwds pts,

Savita

11 REPLIES 11

Former Member
0 Kudos

hi savita..

if u use select option or parameter, selection screen is created under the screen number 1000

Former Member
0 Kudos

hiiii

you can put validation for select option like below

CHECK s_matnr IS NOT INITIAL.

  SELECT matnr
    INTO w_matnr
    FROM mara
    UP TO 1 ROWS
    WHERE matnr IN s_matnr.
  ENDSELECT.

  CHECK sy-subrc NE 0.

  SET CURSOR FIELD 'S_MATNR'.
  MESSAGE e210(zmsg).                  " Invalid Material

here if you want to use for only one option then you can use with s_matnr-low IS NOT INITIAL..

regards

twinkal

bpawanchand
Active Contributor
0 Kudos

Hi

Even if you don't fill any of the input boxes the result is evaluated,but if you want to filter the data then you are suppose to fill based on the required data.

Regards

pavan

Former Member
0 Kudos

hi,

Put both the select option in one block.

And AT SELECTION-SCREEN on <BLOCK> Event

Check the condition of any one of them are blank.

If Yes than Raise the Error Message.

Else Proceed with your code.

Regards

Sumit Agarwal

former_member761936
Active Participant
0 Kudos

Hi,

It is not advicable to put Manadatory for selct option, As seelct option means if you do n't select any thing it will give all the values from Database.

If you want to put some restriction then Try like thin At selection-screen.

If Select-option is initial.

Raise a error message.

ENDIF.

Former Member
0 Kudos

Hi Savita,

i guess u can check by doing something like:

AT SELECTION-SCREEN.

IF s_1 IS INITIAL and s_2 IS INITIAL.

message '..........

ENDIF.

With luck,

Pritam.

Former Member
0 Kudos

Hi Savita,

If you have suppose two select-options S_vbeln and S_posnr then if atleast one of them is Initial then if you have to give an error message; Just try the code below to validate the user :

TABLES :
  vbap.

SELECT-OPTIONS:
  s_vbeln FOR vbap-vbeln,
  s_posnr FOR vbap-posnr.

AT SELECTION-SCREEN.

  IF s_vbeln IS INITIAL
  AND s_posnr IS INITIAL.

    MESSAGE e439(bc_global) WITH 'Enter atleast one value'.

  ENDIF.

START-OF-SELECTION.

  WRITE 😕 s_vbeln,
           s_posnr.

Regards,

Swapna.

Former Member
0 Kudos

HIII....

YOU CAN USE THE AT SELECTION-SCREEN EVENT.whatever conditions you want to give for your select options you can give under this event.

at selection-screen.

if s_field is intial.........

Former Member
0 Kudos

Hello Savita,

You can try this..

at selection-screen.

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

Message 'entry required ' type 'I'.

endif.

Hope it helps you

Indu.

Former Member
0 Kudos

hi,

let say your select option name is s_value then you can code like this,

AT SELECTION-SCREEN.

if s_value-low = '' and s_value-high = ''.

message 'Enter atleast one value' type 'E'.

endif.

Former Member
0 Kudos

You need not fill both the values but, if you want to filter your data then you have to fill appropriate values.

The process flow can be understood from the below link....

http://help.sap.com/saphelp_nw04s/helpdata/en/9f/dba66935c111d1829f0000e829fbfe/frameset.htm

hope his would help you.

Regards,

Sinu.