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 validation

Former Member
0 Likes
817

HI all,

I have one Plant field and 3 radio buttons on the selection screen.

I want validation like if I select the 1 or 2 radibuttons, the input Plant field is mandatory and if I select the 3rd radio button , the input Plant should not be mandatory.

help me in this.

regards,

ajay

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
792

PARAMETERS : p1 RADIOBUTTON GROUP RAD1 DEFAULT 'X' USER-COMMAND ABCD,

p2 RADIOBUTTON GROUP RAD1,

p3 RADIOBUTTON GROUP RAD1,

p_werks like t001w-werks.

constants : C_SELECTED TYPE C VALUE 'X'.

at selection screen on p_werks.

IF p1 = C_SELECTED OR

p2 = C_SELECTED .

IF SY-UCOMM = 'ONLI'.

IF p_werks IS INITIAL.

MESSAGE E007. " 'the message can be please key in Plant'

ENDIF.

ENDIF.

endif.

Edited by: Sujamol Augustine on Apr 29, 2008 8:41 PM

7 REPLIES 7
Read only

Former Member
0 Likes
793

PARAMETERS : p1 RADIOBUTTON GROUP RAD1 DEFAULT 'X' USER-COMMAND ABCD,

p2 RADIOBUTTON GROUP RAD1,

p3 RADIOBUTTON GROUP RAD1,

p_werks like t001w-werks.

constants : C_SELECTED TYPE C VALUE 'X'.

at selection screen on p_werks.

IF p1 = C_SELECTED OR

p2 = C_SELECTED .

IF SY-UCOMM = 'ONLI'.

IF p_werks IS INITIAL.

MESSAGE E007. " 'the message can be please key in Plant'

ENDIF.

ENDIF.

endif.

Edited by: Sujamol Augustine on Apr 29, 2008 8:41 PM

Read only

Former Member
0 Likes
792

hi do this way...


at selection-screen on p_werks.
if p_rad1 = 'X' or p_rad2 = 'X'.
  if p_werks is initial.
   message e000(zz) 'Please enter Plant' .
 endif.
endif.

Read only

Former Member
0 Likes
792

Hi,

Please check this code:

SELECTION-SCREEN BEGIN OF BLOCK b4 WITH FRAME TITLE text-224.

PARAMETER:

p_norm RADIOBUTTON GROUP rg2 DEFAULT 'X' USER-COMMAND p_per,

p_per RADIOBUTTON GROUP rg2.

SELECTION-SCREEN END OF BLOCK b4.

SELECTION-SCREEN BEGIN OF BLOCK b3 WITH FRAME TITLE t2.

SELECT-OPTIONS: p_perio FOR bkpf-bldat MODIF ID np,

p_emp FOR bkpf-bukrs MODIF ID np,

p_belnr FOR bkpf-belnr MODIF ID np.

SELECTION-SCREEN END OF BLOCK b3.

SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME TITLE text-230.

PARAMETER: c_carga AS CHECKBOX DEFAULT ' '

USER-COMMAND p_per MODIF ID ca.

SELECTION-SCREEN END OF BLOCK b2.

SELECTION-SCREEN BEGIN OF BLOCK b5 WITH FRAME TITLE text-231.

PARAMETERS: p_local AS CHECKBOX DEFAULT ' ' MODIF ID rfc,

p_file(110) LOWER CASE MODIF ID rfc,

p_ext(4) LOWER CASE MODIF ID rfc.

SELECTION-SCREEN END OF BLOCK b5.

AT SELECTION-SCREEN OUTPUT.

IF p_per = 'X' .

LOOP AT SCREEN.

IF screen-group1 = 'CA' AND p_per NE 'X'.

screen-active = '1'.

MODIFY SCREEN.

ENDIF.

IF screen-group1 = 'RFC'.

screen-active = '0'.

MODIFY SCREEN.

ENDIF.

IF screen-group1 = 'DBL'.

screen-active = '0'.

MODIFY SCREEN.

ENDIF.

ENDLOOP.

ENDIF.

Regards,

Fernando

Read only

Former Member
0 Likes
792

Hope this helps


REPORT yptc_goof99  MESSAGE-ID zmsg.

PARAMETERS:
  plant TYPE werks_d,
  rb1 RADIOBUTTON GROUP rba DEFAULT 'X',
  rb2 RADIOBUTTON GROUP rba,
  rb3 RADIOBUTTON GROUP rba.

AT SELECTION-SCREEN.
  CASE 'X'.
    WHEN rb1
      OR rb2.
      IF plant IS INITIAL.
        MESSAGE E015 WITH 'Plant is required'.
      ENDIF.
  ENDCASE.

START-OF-SELECTION.
  WRITE:/ 'Done!'.

Read only

0 Likes
792

Hi all,

Small correction in my question , The input field is already mandatory.

if i select the 3rd radiobutton , it should not be mandatory.

regards,

Ajay

Read only

0 Likes
792

Solved .

Thanks for every one.

regards,

Ajay

Read only

Former Member
0 Likes
792

Tables: t001w.

parameter: r1 radiobutton group rad default 'X',

r2 radiobutton group rad,

r3 radiobutton group rad.

parameter: p_plant like t001w-werks.

at selection-screen.

IF R1 = 'X' or R2 = 'X'.

IF p_plant is initial.

Raise an Error message.

ENDIF..

Endif.