‎2009 May 08 6:25 AM
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.
‎2009 May 08 6:33 AM
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.
‎2009 May 08 6:31 AM
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.
‎2009 May 08 6:33 AM
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.
‎2009 May 08 6:34 AM
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
‎2009 May 08 6:51 AM
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.
‎2009 May 08 6:56 AM
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
‎2009 May 08 7:01 AM
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
‎2009 May 08 7:58 AM
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.