2006 Aug 21 6:07 AM
Hi friends,
I need to display two pushbuttons and two parameters on the selection screen, when I click one push button I have to display one parameter and hide the another parameter,same with the second pushbutton.Please give me some sample code.
sathish.
2006 Aug 21 8:17 AM
Hi,
check this report it is doing the same.
<b>REPORT zwa_test2.
TABLES : SSCRFIELDS.
DATA: comm(1).
PARAMETERS : P LIKE MARA-MATNR MODIF ID P.
PARAMETERS : P1 LIKE MARC-WERKS MODIF ID p1.
SELECTION-SCREEN : begin of line,
PUSHBUTTON 2(10) PB1 USER-COMMAND A,
PUSHBUTTON 20(10) PB2 USER-COMMAND B,
end of line.
INITIALIZATION.
LOOP AT SCREEN.
IF SCREEN-group1 = 'P' OR
SCREEN-group1 = 'P1'.
SCREEN-active = '0'.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
AT SELECTION-SCREEN.
IF sy-ucomm = 'A'.
comm = 'A'.
elseif sy-ucomm = 'B'.
comm = 'B'.
ENDIF.
AT SELECTION-SCREEN output.
LOOP AT SCREEN.
IF SCREEN-group1 = 'P'.
if comm = 'A'.
SCREEN-active = '1'.
else.
SCREEN-active = '0'.
endif.
MODIFY SCREEN.
ENDIF.
IF SCREEN-group1 = 'P1'.
if comm = 'B'.
SCREEN-active = '1'.
else.
SCREEN-active = '0'.
endif.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
clear: comm.</b>Regards,
HRA
Hi friends,
I need to display two pushbuttons and two parameters on the selection screen, when I click one push button I have to display one parameter and hide the another parameter,same with the second pushbutton.Please give me some sample code.
sathish.
2006 Aug 21 6:15 AM
Hi sathish,
do this in the pai block.
if v_ucomm = 'DISPLAY'.
loop at screen.
if screen-name = 'v_matnr'.
screen-input = 0.
modify screen.
endif.
endloop.
else.
loop at screen.
if screen-name = 'v_werks'.
screen-input = 0.
modify screen.
endif.
endloop.
endif.
reward if helpful
keerthi.
2006 Aug 21 6:26 AM
hi satish,
case sy-ucomm.
when 1.
loop at screen.
if screen-name = 'field1'.
screen-invisible = '1'.
modify screen.
endif.
endloop.
when 2.
loop at screen.
if screen-name = 'field2'.
screen-invisible = '1'.
modify screen.
endif.
endloop.
endcase.
hope this helps,
do reward if it helps,
priya.
2006 Aug 21 6:37 AM
Priya,
I tried with these methods till now. But I havn't got the answer. If you have time please try it once and send me the total code.
2006 Aug 21 7:21 AM
TRY THIS:
REPORT znrw_pbut .
SELECTION-SCREEN PUSHBUTTON 15(5) pbut_1 USER-COMMAND pb1.
SELECTION-SCREEN PUSHBUTTON 35(5) pbut_2 USER-COMMAND pb2.
parameters: pbut1a type matnr MODIF ID pb1,
pbut1b type sydatum MODIF ID pb1.
parameters: pbut2a type vbeln MODIF ID pb2.
TABLES: sscrfields.
data l_button like sy-ucomm.
INITIALIZATION.
MOVE 'PB 1' TO pbut_1.
MOVE 'PB 2' TO pbut_2.
l_button = 'PB1'
...
AT SELECTION-SCREEN.
IF sscrfields-ucomm = 'PB1'
OR sscrfields-ucomm = 'PB2'.
l_button = sscrfields-ucomm.
ENDIF.
AT SELECTION-SCREEN OUTPUT.
loop at screen.
IF SCREEN-GROUP1 = 'PB1'
OR SCREEN-GROUP1 = 'PB2'.
IF SCREEN-GROUP1 <> L_BUTTON.
SCREEN-ACTIVE = '0'.
MODIFY SCREEN.
ENDIF.
ENDIF.
2006 Aug 21 8:14 AM
TRY LIKE THIS IT MAY WORK...
SELECTION-SCREEN PUSHBUTTON 15(15) KIS1 USER-COMMAND ID1.
SELECTION-SCREEN PUSHBUTTON 35(15) KIS2 USER-COMMAND ID2.
parameters: KISHAN1(15) MODIF ID ID1.
parameters: KISHAN2(15) MODIF ID ID2.
TABLES: sscrfields.
data l_button like sy-ucomm.
INITIALIZATION.
KIS1 = 'Pushbutton1'.
KIS2 = 'Pushbutton2'.
l_button = 'ID1'.
AT SELECTION-SCREEN.
IF sscrfields-ucomm = 'ID1'
OR sscrfields-ucomm = 'ID2'.
l_button = sscrfields-ucomm.
ENDIF.
AT SELECTION-SCREEN OUTPUT.
loop at screen.
IF SCREEN-GROUP1 = 'ID1'.
IF SCREEN-GROUP1 <> L_BUTTON.
SCREEN-INPUT = '0'.
MODIFY SCREEN.
ENDIF.
ENDIF.
ENDLOOP.
loop at screen.
IF SCREEN-GROUP1 = 'ID2'.
IF SCREEN-GROUP1 <> L_BUTTON.
SCREEN-INPUT = '0'.
MODIFY SCREEN.
ENDIF.
ENDIF.
ENDLOOP.
2006 Aug 21 8:17 AM
Hi,
check this report it is doing the same.
<b>REPORT zwa_test2.
TABLES : SSCRFIELDS.
DATA: comm(1).
PARAMETERS : P LIKE MARA-MATNR MODIF ID P.
PARAMETERS : P1 LIKE MARC-WERKS MODIF ID p1.
SELECTION-SCREEN : begin of line,
PUSHBUTTON 2(10) PB1 USER-COMMAND A,
PUSHBUTTON 20(10) PB2 USER-COMMAND B,
end of line.
INITIALIZATION.
LOOP AT SCREEN.
IF SCREEN-group1 = 'P' OR
SCREEN-group1 = 'P1'.
SCREEN-active = '0'.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
AT SELECTION-SCREEN.
IF sy-ucomm = 'A'.
comm = 'A'.
elseif sy-ucomm = 'B'.
comm = 'B'.
ENDIF.
AT SELECTION-SCREEN output.
LOOP AT SCREEN.
IF SCREEN-group1 = 'P'.
if comm = 'A'.
SCREEN-active = '1'.
else.
SCREEN-active = '0'.
endif.
MODIFY SCREEN.
ENDIF.
IF SCREEN-group1 = 'P1'.
if comm = 'B'.
SCREEN-active = '1'.
else.
SCREEN-active = '0'.
endif.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
clear: comm.</b>Regards,
HRA