12-13-2007 11:36 AM
The following is the program that should add two numbers when pushbutton is clicked. how to disable the input fields..pls fill the at selection-screen output part
REPORT ZR6.
SELECTION-SCREEN BEGIN OF BLOCK b1.
PARAMETERS : P1 TYPE I,
P2 TYPE I,
P3 TYPE I.
SELECTION-SCREEN END OF BLOCK b1.
selection-screen: pushbutton /1(6) text-010 user-command cli1.
AT SELECTION-SCREEN OUTPUT.
LOOP AT SCREEN.
ENDLOOP.
AT SELECTION-SCREEN.
CASE SY-UCOMM.
WHEN 'CLI1'.
P3 = P1 + P2.
ENDCASE.
thanks
12-13-2007 11:42 AM
hi,
try this
SELECTION-SCREEN BEGIN OF BLOCK b1.
PARAMETERS : p1 TYPE i,
p2 TYPE i,
p3 TYPE i.
SELECTION-SCREEN END OF BLOCK b1.
SELECTION-SCREEN: PUSHBUTTON /1(6) text-010 USER-COMMAND cli1.
AT SELECTION-SCREEN OUTPUT.
<b> LOOP AT SCREEN.
IF p3 IS NOT INITIAL.
IF screen-name = 'P1' or screen-name = 'P2'.
screen-input = 0.
MODIFY SCREEN.
ENDIF.
ENDIF.
ENDLOOP.</b>
AT SELECTION-SCREEN.
CASE sy-ucomm.
WHEN 'CLI1'.
p3 = p1 + p2.
ENDCASE.
12-13-2007 11:40 AM
AT SELECTION-SCREEN OUTPUT.
LOOP AT SCREEN.
IF SCREEN-NAME EQ 'P1' OR SCREEN-NAME EQ 'P2'
SCREEN-INPUT = 0.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
Reward if answered
12-13-2007 11:42 AM
SELECTION-SCREEN BEGIN OF BLOCK b1.
PARAMETERS : p1 TYPE i DEFAULT '100' MODIF ID r1,
p2 TYPE i DEFAULT '200' MODIF ID r1,
p3 TYPE i.
SELECTION-SCREEN END OF BLOCK b1.
SELECTION-SCREEN: PUSHBUTTON /1(6) text-010 USER-COMMAND cli1.
AT SELECTION-SCREEN OUTPUT.
LOOP AT SCREEN.
IF screen-group1 = 'R1'.
screen-input = '0'.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
AT SELECTION-SCREEN.
CASE sy-ucomm.
WHEN 'CLI1'.
p3 = p1 + p2.
ENDCASE.
12-13-2007 11:42 AM
hi,
try this
SELECTION-SCREEN BEGIN OF BLOCK b1.
PARAMETERS : p1 TYPE i,
p2 TYPE i,
p3 TYPE i.
SELECTION-SCREEN END OF BLOCK b1.
SELECTION-SCREEN: PUSHBUTTON /1(6) text-010 USER-COMMAND cli1.
AT SELECTION-SCREEN OUTPUT.
<b> LOOP AT SCREEN.
IF p3 IS NOT INITIAL.
IF screen-name = 'P1' or screen-name = 'P2'.
screen-input = 0.
MODIFY SCREEN.
ENDIF.
ENDIF.
ENDLOOP.</b>
AT SELECTION-SCREEN.
CASE sy-ucomm.
WHEN 'CLI1'.
p3 = p1 + p2.
ENDCASE.
12-13-2007 11:42 AM
Hi,
Just do like this.
AT SELECTION-SCREEN OUTPUT.
LOOP AT SCREEN.
IF SCREEN-NAME EQ 'P1' OR SCREEN-NAME EQ 'P2'
SCREEN-INPUT = 0.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
Regards,
Nagaraj
12-13-2007 11:48 AM
SELECTION-SCREEN BEGIN OF BLOCK b1.
PARAMETERS : P1 TYPE I modif id r1,
P2 TYPE I modif id r1,
P3 TYPE I.
SELECTION-SCREEN END OF BLOCK b1.
selection-screen: pushbutton /1(6) text-010 user-command cli1.
AT SELECTION-SCREEN OUTPUT.
IF NOT P3 IS INITIAL.
LOOP AT SCREEN.
IF screen-group1 = 'R1'.
screen-input = '0'.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
endif.
AT SELECTION-SCREEN.
CASE SY-UCOMM.
WHEN 'CLI1'.
P3 = P1 + P2.
ENDCASE.
12-13-2007 11:54 AM
Thanks a lot...I would be greatful if you explain the following line by line..
LOOP AT SCREEN.
IF p3 IS NOT INITIAL.
IF screen-name = 'P1' or screen-name = 'P2'.
screen-input = 0.
MODIFY SCREEN.
ENDIF.
ENDIF.
12-13-2007 12:02 PM
hi,
<b>IF p3 is not initial</b> :- if p3 is not calculated u dont want to disable that two fields so i put that condition that if p3 is calculated than only parameter field should b disable.
<b>IF screen-name = 'P1' or screen-name = 'P2'.</b> :- here ur parameter name is P1 and P2 ...
whenever u create parameter or select-option, by deefault one screen created and parameters or select-options becomes its element and u can check each element name with screen name.......
so here i check screen element name.
<b>screen-input = 0</b> :- it will disable that two parameter as condition matches.
<b>MODIFY SCREEN.</b> :- to get modification which we made...
More precisely ....
Here one screen will create with four element ( P1,P2,P3 and Push button), and u want to check each element
so u need <b>loop at screen---endloop.</b>
hope it is useful