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

Selection Screen options

Former Member
0 Likes
1,027

HI,

I am having a selection screen on which along with other options there are two options:

1. Select-Options: s_matnr FOR rc29l-matnr NO INTERVALS OBLIGATORY.

2. Parameters: p_ecm TYPE aenr-aennr.

Now here if p_ecm is not entered then s_matnr is obligatory and it should not proceed without that.

If p_ecm is entered then s_matnr should not be mandatory and the program should procedd without s_matnr. But currently its not happening.

Please let me know how can i achieve this.

Thanks,

Sunanda.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
993

Hi Sunanda,

IF this is the Scenario Don't give the statement Obligatory in select-options.

just check in the code itself like below,

if p_ecm is not initial and s_matnr is initial.

proceed with p_ecm logic

elseif s_matnr is not initial and p_ecm is initial.

proceed with logic

elseif s_matnr is inital and p_ecm is initial.

give error message.

7 REPLIES 7
Read only

Former Member
0 Likes
993

Here you have two requirement .

one s_matnr is mandatory other one is should not be mandatory.

By using MODIFY ID you can able to acheive this.

Read only

Former Member
0 Likes
994

Hi Sunanda,

IF this is the Scenario Don't give the statement Obligatory in select-options.

just check in the code itself like below,

if p_ecm is not initial and s_matnr is initial.

proceed with p_ecm logic

elseif s_matnr is not initial and p_ecm is initial.

proceed with logic

elseif s_matnr is inital and p_ecm is initial.

give error message.

Read only

Former Member
0 Likes
993

Hi,

U can introduce a condition in the event 'AT SELECTION SCREEN'.

Here you can introduce a condition to check whether parameter is populated.

AT SELECTION-SCREEN.

If parameter is populated.

Allow select-option even if its is not populated.

Else.

Check whether the sel-option is populated and throw error.

Endif.

Edited by: Rajesh VS on May 8, 2009 7:34 AM

Read only

Former Member
0 Likes
993

Hi,

Try this...Hope it would be useful.

TABLES : RC29L , aenr.

Select-Options: s_matnr FOR rc29l-matnr NO INTERVALS OBLIGATORY.

Parameters: p_ecm TYPE aenr-aennr.

*

AT SELECTION-SCREEN .

IF s_matnr is not INITIAL.

IF p_ecm is INITIAL.

MESSAGE e001 WITH text-oo1.

ENDIF. .

ENDIF.

Regards,

Malathi.

Read only

Former Member
0 Likes
993

Hi Sunanda,

Try this code,


SELECT-OPTIONS: S_MATNR FOR RC29L-MATNR NO INTERVALS .
PARAMETERS: P_ECM TYPE AENR-AENNR.

AT SELECTION-SCREEN.
  IF S_MATNR IS INITIAL.
    IF P_ECM IS INITIAL.
      MESSAGE 'Error' TYPE 'E'.
    ENDIF.
  ENDIF.

Thanks & regards,

Dileep .C

Read only

Former Member
0 Likes
993

try it this way:

Parameters: p_ecm TYPE aenr-aennr.

Select-Options: 
  s_matnr FOR rc29l-matnr. " NO INTERVALS OBLIGATORY.


At Selection-screen on s_matnr. " use At Selection-screen on s_matnr instead of At Selection-screen 

if p_ecm is initial and s_matnr is initial..
  messages 'enter a value in s_matnr' type 'E'.
endif.

  • for your requirement use 'At Selection-screen on s_matnr' as if both are initial then it will make the field * s_matnr as input enabled and all other will be input disable as ur requirement

Edited by: Pritam Ghosh on May 8, 2009 8:24 AM

Read only

Former Member
0 Likes
993

Hi,

Please use the following code.

PARAMETERS c type i.

SELECT-OPTIONS: B FOR VBAK-ERDAT .

AT SELECTION-SCREEN.

if c is INITIAL.

if b is INITIAL.

MESSAGE e000(ooo) with 'error'.

ENDIF.

ENDIF.

at selection-screen outpur.

loop at screen.

if screen-name = 'B'.

screen-required = '2'.

endif.

modify screen.

endloop.