‎2007 Dec 24 4:46 AM
Hi,
I have 3 select-option fields(production scheduler,MRP Controller,plant) in selection-screen.If I enter values for production scheduler and MRP Controller,the plant field should become mandatory.Can anyone tell me the logic for this?
Regards,
Hema
‎2007 Dec 24 8:51 AM
Hi hema,
1. For this obligatory will not work.
2. we have to keep the field normal,
and check using abap code.
3. like this.
4.
start-of-selection.
if productionscheudler is not initial
and mrp is not initial.
if plant is initial.
message 'Plant is mandatory' type 'I'.
leave list-processing.
endif.
endif.
5. Note : message shouold be of type 'I' and not 'E'.
leave list-processing is important.
regards,
amit m.
‎2007 Dec 24 4:52 AM
Hi Hema,
See this code.
selection-screen output.
if s_production is not initial and s_MRP_con is not initial.
Loop at screen.
screen-name cp 'plant'.
screen-required = 1.
modify screen.
endloop.
endif.
Plzz Reward if useful,
Mahi.
‎2007 Dec 24 4:52 AM
Hi Hema,
You can check this on the at selection screen event.
At Selection-Screen.
if prod_sch is not initial and mrp_contro is not initial.
if plant is initial.
Message 'Plant should contain a value', 'E'.
endif.
endif.
Reward Points,if useful.
Regards
Manoj Kumar
‎2007 Dec 24 4:54 AM
hi,
Provide MODIF-ID for each select option.
M1, M2, M3
in AT SELECTION-SCREEN OUTPUT event
LOOP AT SCREEN.
if SCREEN-GROUP1 = m2 or m3 and SEL_OPT1 is not initial.
SCREEN-REQUIRED = 'X'.
MODIFY SCREEN.
ENDLOOP.
Reward if useful
Regards
ANUPAM
‎2007 Dec 24 5:01 AM
suppose the user press the continue button for processing after he enters the first two values and does not fill the mandatory plant field.
in the PAI module of the screen where you usually do the processing
eg
if ok_code = 'CONTINUE'
add the chk code here
and if the chk is true continue processing else do nothing
*it will automatically go to pbo module by performing nothing
****check statement
if not production_scheduler is initial.
if not MRP_Controller is initial.
if not plant_field is intial.
do the processing call the subroutines ,anything
else.
MESSAGE ID 'Values Missing ' TYPE 'W' NUMBER '001'
WITH 'plant_field cannot be left empty'.
*no more processing
endif.
endif.endif.
endif.
reward if useful
Edited by: Sumesh Nair on Dec 24, 2007 10:32 AM
‎2007 Dec 24 5:01 AM
Hi,
Try as follows:
AT SELECTION-SCREEN ON p_werks.
IF NOT p_fevor IS INITIAL AND NOT p_dispo IS INITIAL.
IF p_werks IS INITIAL.
MESSAGE E()..with 'PLANT is mandatory ......'.
ENDIF.
ENDIF.
‎2007 Dec 24 7:37 AM
Hi Ramesh,
I have used this code in my program. when i enter values in fevor and dispo fields and leave the plant field blank and execute the program,it is not giving any error and it is displaying the o/p.If I enter values for either dispo or fevor fields,and leave the plant field blank,then it is showing error. My requirement is,when the user enters MARC-FEVOR or MARC-DISPO or both, the plant field is mandatory.
‎2007 Dec 24 5:02 AM
Hi Hema,
Try this,
Select-options: field1(10) type c MODIF ID SC1,
field2(5) type c MODIF ID SC1,
field3(15) type p MODIF ID SC3.
if field1 is not initial.
if field2 is not initial
LOOP AT SCREEN.
if SCREEN-GROUP1 = 'SC3'.
SCREEN-REQUIRED = '1'.
MODIFY SCREEN.
ENDLOOP.
Endif.
endif.
<b>reward if useful </b>
Regards,
sunil kairam.
‎2007 Dec 24 7:55 AM
hai hema,
ithink it is better to use OBLIGATORY addition to select option of plant field.
‎2007 Dec 24 8:47 AM
Hi Ramesh,
If I use obligatory for plant field,then if i enter some value for fevor or dispo fields or even if i don't enter values for these 2 fields,it is giving error message.My requirement is,If the user enters MARC-FEVOR or MARC-DISPO or both, the plant field should become mandatory.Can anyone suggest me some correct solution for this?
Regards,
Hema
‎2007 Dec 24 8:51 AM
Hi hema,
1. For this obligatory will not work.
2. we have to keep the field normal,
and check using abap code.
3. like this.
4.
start-of-selection.
if productionscheudler is not initial
and mrp is not initial.
if plant is initial.
message 'Plant is mandatory' type 'I'.
leave list-processing.
endif.
endif.
5. Note : message shouold be of type 'I' and not 'E'.
leave list-processing is important.
regards,
amit m.
‎2007 Dec 24 9:09 AM
Hi Amit,
This solved my problem.Thank you very much.
Regards,
Hema