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

Problem in AT selection screen validation

Former Member
0 Likes
945

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.

7 REPLIES 7
Read only

Former Member
0 Likes
871

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

Read only

surajarafath
Contributor
0 Likes
871

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.

Read only

Former Member
0 Likes
871

No i need the validation for both radiobtuon for that parameter.

Read only

Former Member
0 Likes
871

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

Read only

0 Likes
871

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'.

Read only

Former Member
0 Likes
871

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

Read only

Former Member
0 Likes
871

<removed by moderator>

Edited by: Thomas Zloch on Nov 24, 2011 4:09 PM