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
855

hi all,

in selection screen i have 6 fields , 2 push buttons . when i click on first button . first three fields must be enabled and remaining buttons must be disabled . and if i click on second pushbutton first three fields must be disabled and remaining should be enable how can i do that.

thnx in advance

6 REPLIES 6
Read only

Former Member
0 Likes
674

hi Amar,

Put Your Logic at <b>AT SELECTION-SCREEN OUTPUT</b>. event ..

Regards,

Santosh

Read only

0 Likes
674

use AT-SELECTION SCREEN OUTPUT

Read only

Former Member
0 Likes
674

Hi amar,

Check this link, ur requirement is similar to this:

?

It will help u.

Here u can find code also.

Regards,

Kumar

Message was edited by:

kumar kk

Read only

Former Member
0 Likes
674

Hi

In AT SELECTION-SCREEN OUTPUT event.

If OK_CODE eq 'BUT1'.

LOOP AT SCREEN.

IF SCREEN-NAME = 'TEXT1'.

disable it.

ENDIF.

IF = 'TEXT2'

disable

same for text3.

ENDLOOP.

ELSEIF OK_CODE EQ 'BUT2'..

LOOP AT SCREEN.

IF = TEXT4.

disable.

endif.

write other conditions.

ENDLOOP.

ENDIF.

Regards

Surya.

Read only

jayanthi_jayaraman
Active Contributor
0 Likes
674

Hi,

p1(10) modif id Z1,

p2(10) modif id z2,

p3(10) modif id z3,

p4(10) modif id z4,

p5(10) modif id z5,

p6(10) modif id z6.

SELECTION-SCREEN PUSHBUTTON /1(24) name USER-COMMAND Button1.

SELECTION-SCREEN PUSHBUTTON /2(24) name USER-COMMAND Button2.

AT SELECTION-SCREEN output.

LOOP AT SCREEN.

IF ( sscrfields-ucomm = 'BUTTON1' and ( SCREEN-GROUP1 = 'Z1' or

SCREEN-GROUP1 = 'Z2' or SCREEN-GROUP1 = 'Z3' ) ) or

( sscrfields-ucomm = 'BUTTON2' and ( SCREEN-GROUP1 = 'Z4' or

SCREEN-GROUP1 = 'Z5' or SCREEN-GROUP1 = 'Z6' ) ).

SCREEN-input = 1.

ELSE.

SCREEN-input = 0.

ENDIF.

MODIFY SCREEN.

ENDLOOP.

Kindly reward points if it helps.

Read only

Former Member
0 Likes
674

Hi Amar

I hope below code will give you some idea:

parameters: p_fld1(10) type c,
            p_fld2(10) type c,
            p_fld3(10) type c,
            p_fld4(10) type c,
            p_fld5(10) type c,
            p_fld6(10) type c.
selection-screen begin of line.
selection-screen pushbutton:  (5) but1 user-command ABC,
                            15(5) but2 user-command DEF.
selection-screen end of line.

data: f_3 type i value 1,
      l_3 type i.

at selection-screen output.
  loop at screen.
     case screen-name.
     when 'P_FLD1' or 'P_FLD2' or 'P_FLD3'.
          screen-active = f_3.
     when 'P_FLD4' or 'P_FLD5' or 'P_FLD6'.
          screen-active = l_3.
     endcase.
     modify screen.
  endloop.

at selection-screen.
  if sy-ucomm = 'ABC'.
     f_3 = 1.
     l_3 = 0.
  elseif sy-ucomm = 'DEF'.
     f_3 = 0.
     l_3 = 1.
  endif.

initialization.
  move: 'BUT1' to but1,
        'BUT2' to but2.

Kind Regards

Eswar