2014 Jan 18 1:24 PM
Hi,
i have created 2 radio buttons as p_code,p_pono and select-options as s_ccode ,s_pono.
when i am selecting p_pono , s_pono should be deactivated,but in my code s_pono is in activate state and i am able to enter the values.
can any one please give me solution. i am attaching the code.
Thanks
Deepthi.
2014 Jan 18 1:34 PM
Hi Please check
i have done some changes
please check its working or not
2014 Jan 18 1:40 PM
2014 Jan 20 5:01 AM
Hi Deepthi,
please see, if you wants to gets only some fields based on that radio button, and wants to get
other radio button fields disappeared, please change your code as shown below.
Lets say i have two radiobutton rad1 and rad2.
Then i will write my code as shown below
AT SELECTION-SCREEN OUTPUT.
IF rad1 NE 'X' .
LOOP AT SCREEN.
CASE SCREEN-GROUP1.
WHEN 'modif id'.
SCREEN-ACTIVE = 0.
MODIFY SCREEN.
ENDCASE.
ENDLOOP.
CLEAR : fields name.
ENDIF.
IF rad2 NE 'X' .
LOOP AT SCREEN.
CASE SCREEN-GROUP1.
WHEN 'modif id'.
SCREEN-ACTIVE = 0.
MODIFY SCREEN.
ENDCASE.
ENDLOOP.
CLEAR : field name.
ENDIF.
2014 Jan 18 1:42 PM
Hi,
Create the Modif ID for your selection! because
The addition MODIF ID assigns all the screen elements for the selection criterion to the modification group modid that is assigned to column group1 in the system table screen. This means they can be modified with a MODIFY SCREEN statement before the selection screen is displayed. You must specify the name of the modification group modid directly and it can only contain a maximum of three characters.
2014 Jan 19 11:56 PM
Hi Deepthi,
Even though you have specified MODIF ID's in lower case, when you check them within the SCREEN Loop, you should check for Upper Case Values. In your case, you should check for SCREEN-GROUP1 = 'PON' / 'COD'.
At the same time, specify a default radio button and a user command too. Specifying a default radio button will trigger your deactivation logic when you execute your code for the first time. Specifying a user command will trigger the Selection Screen PBO automatically when you select the radio button so that you don't need to press Enter.
2014 Jan 20 4:01 AM
HI,
Selection-Screen : Begin of Block b1 WITH FRAME TITLE TEXT-001.
parameter : p_code Radiobutton Group rdb USER-COMMAND s DEFAULT 'X',
p_pono Radiobutton Group rdb.
Selection-Screen End of block b1.
Selection-Screen : Begin of Block b2 WITH FRAME TITLE TEXT-002.
select-options : s_ccode for sy-datum modif id one,
s_pono for sy-datum modif id two.
selection-screen End of block b2.
At selection-screen output.
if p_code = 'X'.
loop at screen.
if screen-group1 = 'ONE'.
screen-INPUT = '1'.
elseif screen-group1 = 'TWO'.
screen-INPUT = '0'.
endif.
MODIFY SCREEN.
ENDLOOP.
Endif.
if p_pono = 'X'.
LOOP AT SCREEN.
if screen-group1 = 'TWO'.
screen-INPUT = '1'.
elseif screen-group1 = 'ONE'.
screen-INPUT = '0'.
endif.
modify screen.
endloop.
ENDIF.
Try this.
Regards
2014 Jan 20 4:09 AM
2014 Jan 20 4:32 AM
Hi,
I took the liberty to simplify the code.
- I recommend using type on input parameters (so we can get the parameter name when using help )
- I added USER-COMMAND c01 .
- I use perform.
- I use case structure (I think cleaner code).
- I use abap_true NOT 'X' (TYPE-POOLS: abap) .
TYPE-POOLS: abap .
SELECTION-SCREEN : BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
PARAMETER : p_code TYPE radiob RADIOBUTTON GROUP rdb USER-COMMAND c01 DEFAULT 'X' ,
p_pono TYPE radiob RADIOBUTTON GROUP rdb.
SELECTION-SCREEN END OF BLOCK b1.
SELECTION-SCREEN : BEGIN OF BLOCK b2 WITH FRAME TITLE text-002.
SELECT-OPTIONS : s_ccode FOR wa_ekko-bukrs MODIF ID cod ,
s_pono FOR wa_ekko-ebeln MODIF ID pon .
SELECTION-SCREEN END OF BLOCK b2.
AT SELECTION-SCREEN OUTPUT .
PERFORM at_selection_screen_output .
*----------------------------------------------------------------------*
FORM at_selection_screen_output .
LOOP AT SCREEN.
CASE screen-group1 .
WHEN 'COD' .
screen-input = '0'.
IF p_code EQ abap_true .
screen-input = '1'.
ENDIF .
WHEN 'PON' .
screen-input = '0'.
IF p_pono EQ abap_true .
screen-input = '1'.
ENDIF .
ENDCASE .
MODIFY SCREEN.
ENDLOOP.
ENDFORM . "at_selection_screen_output
*----------------------------------------------------------------------*
2014 Jan 20 5:25 AM
Hi,
You have to make a radio button as default and add a user command to it.Please refer the below code for the changes made.
SELECTION-SCREEN : BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
PARAMETER : p_code RADIOBUTTON GROUP rdb DEFAULT 'X' USER-COMMAND cmd,
p_pono RADIOBUTTON GROUP rdb.
SELECTION-SCREEN END OF BLOCK b1.
SELECTION-SCREEN : BEGIN OF BLOCK b2 WITH FRAME TITLE text-002.
SELECT-OPTIONS : s_ccode FOR WA_ekko-bukrs MODIF ID cod,
s_pono FOR WA_ekko-ebeln MODIF ID pon.
SELECTION-SCREEN END OF BLOCK b2.
AT SELECTION-SCREEN OUTPUT.
LOOP AT SCREEN.
IF p_code = 'X'.
IF screen-group1 = 'PON'.
screen-input = '0'.
ENDIF.
ELSEIF p_pono = 'X'.
IF screen-group1 = 'COD'.
screen-input = '0'.
ENDIF.
ENDIF.
MODIFY SCREEN.
ENDLOOP.
Regards,
Jeffin
2014 Jan 20 6:06 AM
Hi, Try this,
LOOP AT SCREEN.
CASE 'X'.
WHEN p_code.
IF screen-group1 = 'PON'.
screen-input = '0'.
ELSEIF screen-group1 = 'COD'.
screen-input = '1'.
ENDIF.
WHEN p_pono.
IF screen-group1 = 'PON'.
screen-input = '1'.
ELSEIF screen-group1 = 'COD'.
screen-input = '0'.
ENDIF.
ENDCASE.
ENDLOOP.