‎2011 Nov 24 8:10 AM
Hi,
I am having problem in AT SELECTION SCREEN Validation.
I have 2 radiobutton and 6 parameter. if i click first radio button all the 6 radiobutton should enable and take the user input, that is working fine for me.
if i click second radiobutton , out of 6 , 3 parameter should disable and remaining 3 should enable. thats also working fine.
My problem is program has written the validation for this 3 parameter in the AT SELECTION SCREEN.
For first radioutton all the validation working fine, for second validation as soon as i press the radiobutton it will display error message. Based on 2 parameter user is filling value for 3 rd parameter.
I want the same validation to be done for second radio button after user pressing enter.
PARAMETER: p_single RADIOBUTTON GROUP rad1 DEFAULT 'X' USER-COMMAND f1,
p_multi RADIOBUTTON GROUP rad1.
PARAMETERS: s_pwwrk LIKE plaf-pwwrk.
PARAMETERS: p_lgort LIKE plaf-lgort.
PARAMETERS: p_kostl LIKE cobl-kostl.
here is my code:
AT SELECTION SCREEN.
CLEAR t001w.
CLEAR t001k.
CLEAR marv.
SELECT SINGLE * FROM t001w WHERE werks EQ s_pwwrk.
IF sy-subrc NE 0.
MESSAGE e999 WITH 'Plant' s_pwwrk 'does not exist'.
ELSE.
SELECT SINGLE * FROM t001k WHERE bwkey EQ t001w-bwkey.
SELECT SINGLE * FROM marv WHERE bukrs EQ t001k-bukrs.
IF p_budat0(4) NE marv-lfgja OR p_budat4(2) NE marv-lfmon
IF marv-xruem IS NOT INITIAL.
IF p_budat0(4) NE marv-vmgja OR p_budat4(2) NE marv-vmmon.
MESSAGE e999 WITH p_budat4(2) p_budat0(4)
'is closed.
Please try again.'.
ENDIF.
ELSE.
MESSAGE e999 WITH p_budat4(2) p_budat0(4)
'is closed.
Please try again.'.
ENDIF.
ENDIF.
ENDIF.
‎2011 Nov 24 8:30 AM
Hi,
Try using the function module "DYNP_VALUES_READ" to get he values entered in 2nd parameter and carry on with validations.
Hope this may be helpful.
Regards,
Sharin
‎2011 Nov 24 8:32 AM
For your Case ,
If i understand clearly,You can do the validation when you want on AT SELECTION SCREEN ON WP_FIELD.
If you say your validation to be done only for Selection of Second Radio Button, then..
AT SELECTION SCREEN.
if p_multi eq 'X'. "<- Make Validation to be done only if user select Second Button
CLEAR t001w.
CLEAR t001k.
CLEAR marv.
SELECT SINGLE * FROM t001w WHERE werks EQ s_pwwrk.
IF sy-subrc NE 0.
MESSAGE e999 WITH 'Plant' s_pwwrk 'does not exist'.
ELSE.
SELECT SINGLE * FROM t001k WHERE bwkey EQ t001w-bwkey.
SELECT SINGLE * FROM marv WHERE bukrs EQ t001k-bukrs.
IF p_budat+0(4) NE marv-lfgja OR p_budat+4(2) NE marv-lfmon
IF marv-xruem IS NOT INITIAL.
IF p_budat+0(4) NE marv-vmgja OR p_budat+4(2) NE marv-vmmon.
MESSAGE e999 WITH p_budat+4(2) p_budat+0(4)
'is closed.
Please try again.'.
ENDIF.
ELSE.
MESSAGE e999 WITH p_budat+4(2) p_budat+0(4)
'is closed.
Please try again.'.
ENDIF.
ENDIF.
ENDIF.
endif.
‎2011 Nov 24 9:05 AM
No i need the validation for both radiobtuon for that parameter.
‎2011 Nov 24 9:57 AM
Hey,
start debugging on by presiing /h on address book and check wats the value of sy-ucomm when u change radiobuttons.
I guess its ONLI.
Now make a check that if sy-ucomm is not equal to ONLI, only then you will make validations for both radiobuttons
I hope this solves ur query
‎2011 Nov 24 10:15 AM
Hi,
Check the sy-ucomm value for 'Enter' pressed on the key board. And write the entire validation logic under 'AT SELECTION' event but inside the if block that you would be defining for 'Enter'.
‎2011 Nov 24 11:33 AM
Problem solved.
IF p_single = 'X'
OR p_muliti = 'X'.
if sy-ucomm NE 'X'. (User Command)
Validate.
endif.
endif.
it will validate both radiobutton, only after press.
Thanks for all support
Regds,
Udupi
‎2011 Nov 24 11:36 AM
<removed by moderator>
Edited by: Thomas Zloch on Nov 24, 2011 4:09 PM