2009 Feb 28 10:08 AM
Hi Gurus,
My requirement as follows...
Block 1 contains 2 radio buttons.
Block 2 contains couple of select options.
Block 3 contains couple of different select options.
First radio button is set as default. so Block 2 should appear below block 1 as default.
If second radio button is selected Block 2 should be hidden and Block 3 should appear in the place of
Block 2.
Depending upon the Select options the report continues.
Please Help me out on this issue.
(I found few questions same as this previously posted but didnt exactly the same).
Awaiting for early replies.
regards,
deep.
2009 Feb 28 11:13 AM
Hi,
Check this code.
SELECTION-SCREEN BEGIN OF BLOCK 001.
PARAMETERS: P_MRU RADIOBUTTON GROUP SEL DEFAULT 'X' USER-COMMAND AC,
P_PART RADIOBUTTON GROUP SEL.
SELECT-OPTIONS P1 FOR <field> MODIF ID PRT.
SELECT-OPTIONS P2 FOR <field> MODIF ID PRT.
SELECT-OPTIONS G1 FOR <field> MODIF ID MRU.
SELECT-OPTIONS G2 FOR <field> MODIF ID MRU.
SELECTION-SCREEN END OF BLOCK 001.
AT SELECTION-SCREEN OUTPUT.
IF P_MRU = 'X'.
LOOP AT SCREEN.
IF SCREEN-GROUP1 = 'PRT'.
SCREEN-INPUT = '0'.
ENDIF.
IF SCREEN-GROUP1 = 'MRU'.
SCREEN-INPUT = '1'.
ENDIF.
MODIFY SCREEN.
ENDLOOP.
ELSEIF P_PART = 'X'.
LOOP AT SCREEN.
IF SCREEN-GROUP1 = 'MRU'.
SCREEN-INPUT = '0'.
ENDIF.
IF SCREEN-GROUP1 = 'PRT'.
SCREEN-INPUT = '1'.
ENDIF.
MODIFY SCREEN.
ENDLOOP.
ENDIF.
Regards,
Bharat Kalagara.
2009 Feb 28 10:26 AM
Plz try this code...
REPORT ZTEST_CHECK .
parameters: p_sale radiobutton group g1 user-command ABC default 'X',
p_mate radiobutton group g1 .
selection-screen: begin of block b0 with frame.
parameters: p_vbeln like vbak-vbeln modif id ABC.
selection-screen: end of block b0.
selection-screen: begin of block b1 with frame.
parameters : p_matnr like mara-matnr modif id XYZ.
selection-screen: end of block b1.
at selection-screen output.
if p_sale = 'X'.
loop at screen.
if screen-group1 = 'ABC'.
screen-active = 0.
endif.
modify screen.
endloop.
endif.
if p_mate = 'X'.
loop at screen.
if screen-group1 = 'XYZ'.
screen-active = 0.
endif.
modify screen.
endloop.
endif.
2009 Feb 28 10:29 AM
hi,
at selection-screen output.
" NOTE : Modif ID for all the select-options in the block 2 should have the same value for example BL2
" and all the select-options for block3 should have the same value for example BL3.
if radio1 = 'X'.
loop at screen.
if screen-group1 = 'Modif ID the select options of Block 3'.
screen-active = 0.
modify screen.
endif.
endloop.
else.
loop at screen.
if screen-group1 = 'Modif ID the select options of Block 2'.
screen-active = 0.
modify screen.
endif.
endloop.
endif.
Regards,
Siddarth
2009 Feb 28 10:39 AM
Hi.
Test the following code
TABLES: kna1 , pa0001.
PARAMETERS: rd1 RADIOBUTTON GROUP g1 USER-COMMAND cmd DEFAULT 'X',
rd2 RADIOBUTTON GROUP g1 .
SELECTION-SCREEN: BEGIN OF BLOCK block1 WITH FRAME.
SELECT-OPTIONS:kunnr FOR kna1-kunnr MODIF ID s1.
SELECT-OPTIONS:name1 FOR kna1-name1 MODIF ID s1.
SELECT-OPTIONS:name2 FOR kna1-name2 MODIF ID s1.
SELECTION-SCREEN: END OF BLOCK block1.
SELECTION-SCREEN: BEGIN OF BLOCK block2 WITH FRAME.
SELECT-OPTIONS:pernr FOR pa0001-pernr MODIF ID s2.
SELECT-OPTIONS:begda FOR pa0001-begda MODIF ID s2.
SELECT-OPTIONS:endda FOR pa0001-endda MODIF ID s2.
SELECTION-SCREEN: END OF BLOCK block2.
AT SELECTION-SCREEN OUTPUT.
IF rd1 = 'X'.
LOOP AT SCREEN.
IF screen-group1 = 'S2'.
screen-active = 0.
ENDIF.
MODIFY SCREEN.
ENDLOOP.
ENDIF.
IF rd2 = 'X'.
LOOP AT SCREEN.
IF screen-group1 = 'S1'.
screen-active = 0.
ENDIF.
MODIFY SCREEN.
ENDLOOP.
ENDIF.
2009 Feb 28 11:09 AM
Hi all,
Thanks for all you replies.....The code works well....
But still there is a problem.
In block 2 there is an obligatory field (mandatory), so if i check the second radio button it prompts me to enter a value in that field and doesnt gets changed to block 3.
Note :Block 3 also contains an obligatory field.
(On removing this obligatory field the code works well...)
regards,
deep.
2009 Feb 28 11:13 AM
Hi,
Check this code.
SELECTION-SCREEN BEGIN OF BLOCK 001.
PARAMETERS: P_MRU RADIOBUTTON GROUP SEL DEFAULT 'X' USER-COMMAND AC,
P_PART RADIOBUTTON GROUP SEL.
SELECT-OPTIONS P1 FOR <field> MODIF ID PRT.
SELECT-OPTIONS P2 FOR <field> MODIF ID PRT.
SELECT-OPTIONS G1 FOR <field> MODIF ID MRU.
SELECT-OPTIONS G2 FOR <field> MODIF ID MRU.
SELECTION-SCREEN END OF BLOCK 001.
AT SELECTION-SCREEN OUTPUT.
IF P_MRU = 'X'.
LOOP AT SCREEN.
IF SCREEN-GROUP1 = 'PRT'.
SCREEN-INPUT = '0'.
ENDIF.
IF SCREEN-GROUP1 = 'MRU'.
SCREEN-INPUT = '1'.
ENDIF.
MODIFY SCREEN.
ENDLOOP.
ELSEIF P_PART = 'X'.
LOOP AT SCREEN.
IF SCREEN-GROUP1 = 'MRU'.
SCREEN-INPUT = '0'.
ENDIF.
IF SCREEN-GROUP1 = 'PRT'.
SCREEN-INPUT = '1'.
ENDIF.
MODIFY SCREEN.
ENDLOOP.
ENDIF.
Regards,
Bharat Kalagara.
2009 Feb 28 11:42 AM
Hi Bharat ,
Please check my previous comment....
But still there is a problem.
In block 2 there is an obligatory field (mandatory), so if i check the second radio button it prompts me to enter a value in that field and doesnt gets changed to block 3.
2009 Feb 28 12:10 PM
2009 Feb 28 12:20 PM
Hi tahir naqqash ,
Ya i have checked your code too....
It works fine if there is no mandatory field in the selection screen.but i do have a mandatory field in block 2.Help me sort out this problem.
2009 Feb 28 12:24 PM
" Hi just change the block 2 as
just write obligatory if u want with any field
SELECTION-SCREEN: BEGIN OF BLOCK block2 WITH FRAME.
SELECT-OPTIONS:pernr FOR pa0001-pernr OBLIGATORY MODIF ID s2.
SELECT-OPTIONS:begda FOR pa0001-begda OBLIGATORY MODIF ID s2.
SELECT-OPTIONS:endda FOR pa0001-endda OBLIGATORY MODIF ID s2.
SELECTION-SCREEN: END OF BLOCK block2.
2009 Feb 28 12:30 PM
do one thing when u r looping at screen just assign some value to the mandatory field at once in ur code itself and then later clear it. so that the changing of blocks happen smoothely.
кu03B1ятu03B9к
2009 Feb 28 12:31 PM
Hi tahir....
If it is made obligatory there,While selecting radio button 2 , the block 2 doesnt disappear prompting me to enter something in the obligatory fields...
How to surpass this obligatory check.?
2009 Feb 28 12:44 PM
provide values to the obligatory field thru ur coding itself.
like s_vbeln = '00000000'.
anyways since u wont be using this block so no effect on ur code's working whatever value u give, and later if u want u mat clear it too.
кu03B1ятu03B9к
2009 Feb 28 12:50 PM
Now change it as.
SELECTION-SCREEN: BEGIN OF BLOCK block2 WITH FRAME.
SELECT-OPTIONS:pernr FOR pa0001-pernr DEFAULT '1234' MODIF ID s2.
SELECT-OPTIONS:begda FOR pa0001-begda DEFAULT '20081201' MODIF ID s2.
SELECT-OPTIONS:endda FOR pa0001-endda DEFAULT '20081201' MODIF ID s2.
SELECTION-SCREEN: END OF BLOCK block2.
if it is not so as u required, then please make more clear what actually u want