12-01-2005 10:59 AM
Hi All
Can anybody please give me an idea about how to handle the radiobuttons in selection-screen .Based on the radiobutton selected I need the different input value fields.
This I have done with the addition USER-COMMAND
while defining the radiobutton field and by using MODIF ID extension and writing the code in AT SELECTION-SCREEN OUTPUT event. It is working fine in 4.7 version but not in 4.5B version.
Can anybody please suggest me on this
Thanks in advance
Satya
12-01-2005 11:10 AM
Hi Satya,
Use the event AT SELECTION-SCREEN,
So, if you click on a particular radio button on selection screen, this event will be triggered and then inside this,
do LOOP AT SCREEN.
Inside this loop, for whatever fields you want, you can input enable and disable them using SCREEN-INPUT and SCREEN-OUTPUT fields of the table SCREEN.
Hope this solves your problem.
Thanks and Regards,
Arshad
12-01-2005 11:10 AM
Hi Satya,
Use the event AT SELECTION-SCREEN,
So, if you click on a particular radio button on selection screen, this event will be triggered and then inside this,
do LOOP AT SCREEN.
Inside this loop, for whatever fields you want, you can input enable and disable them using SCREEN-INPUT and SCREEN-OUTPUT fields of the table SCREEN.
Hope this solves your problem.
Thanks and Regards,
Arshad
12-01-2005 11:12 AM
SELECTION-SCREEN BEGIN OF BLOCK B2 WITH FRAME ."TITLE text-000.
PARAMETERS: R_SHIP RADIOBUTTON GROUP G1 DEFAULT 'X' USER-COMMAND ABC,
R_HU RADIOBUTTON GROUP G1 .
SELECTION-SCREEN END OF BLOCK B2.
*----------------------------------------------------------------------*
* AT SELECTION-SCREEN -OUTPUT
*----------------------------------------------------------------------*
AT SELECTION-SCREEN OUTPUT.
IF R_SHIP = 'X'.
PERFORM DISABLE_HU.
ENDIF.
IF R_HU = 'X'.
PERFORM DISABLE_SHIP.
ENDIF.
*&---------------------------------------------------------------------*
*& Form disable_Hu
*&---------------------------------------------------------------------*
* Disable HU screen
*----------------------------------------------------------------------*
FORM DISABLE_HU .
LOOP AT SCREEN.
CASE SCREEN-NAME.
WHEN 'S_EXIDV-LOW'.
SCREEN-INPUT = 0.
CLEAR S_EXIDV-LOW.
MODIFY SCREEN.
WHEN 'S_EXIDV-HIGH'.
SCREEN-INPUT = 0.
CLEAR S_EXIDV-HIGH.
MODIFY SCREEN.
WHEN 'P_BUKRS'.
SCREEN-INPUT = 0.
CLEAR P_BUKRS.
MODIFY SCREEN.
WHEN 'P_TKNO'.
SCREEN-INPUT = 0.
CLEAR P_TKNO.
MODIFY SCREEN.
WHEN 'P_ENTRY'.
SCREEN-INPUT = 0.
CLEAR P_ENTRY.
MODIFY SCREEN.
WHEN 'P_EXIT'.
SCREEN-INPUT = 0.
CLEAR P_EXIT.
MODIFY SCREEN.
WHEN 'P_ROUTE'.
SCREEN-INPUT = 0.
CLEAR P_ROUTE.
MODIFY SCREEN.
WHEN 'P_TRAIL'.
SCREEN-INPUT = 0.
CLEAR P_TRAIL.
MODIFY SCREEN.
ENDCASE.
ENDLOOP.
ENDFORM. " disable_Hu
*&---------------------------------------------------------------------*
*& Form disable_ship
*&---------------------------------------------------------------------*
* Disable Shipment Screen
*----------------------------------------------------------------------*
FORM DISABLE_SHIP .
LOOP AT SCREEN.
CASE SCREEN-NAME.
WHEN 'P_TKNUM'.
SCREEN-INPUT = 0.
CLEAR P_TKNUM.
MODIFY SCREEN.
ENDCASE.
ENDLOOP.
ENDFORM. " disable_ship
check this....
Message was edited by: Vijay Babu Dudla
12-01-2005 11:13 AM
Hi,
Refer the following code, this might help,
-
report ztest.
types: begin of line_type_sflight,
carrid like scarr-carrid,
connid like spfli-connid,
fldate like sflight-fldate,
price like sflight-price,
currency like sflight-currency,
end of line_type_sflight.
data: wa_sflight type line_type_sflight.
data: itab_sflight type table of line_type_sflight.
tables: scarr.
include <icon>.
parameters: pa_carr like sflight-carrid default 'AA',
pa_name as checkbox default 'X',
pa_curr as checkbox default 'X',
pa_lim_1 radiobutton group lim,
pa_lim_2 radiobutton group lim,
pa_lim_3 radiobutton group lim .
constants mark value 'X'.
Check, if any checkbox has been selected
if pa_name eq mark.
select single carrname from scarr into (scarr-carrname)
where carrid = pa_carr.
write: / text-001, scarr-carrname.
endif.
if pa_curr eq mark.
select single currcode from scarr into (scarr-currcode)
where carrid = pa_carr.
write: / text-002, scarr-currcode.
endif.
Check, which radiobutton has been selected
case mark.
when pa_lim_1.
select carrid connid fldate price currency from sflight
into table itab_sflight
where carrid = pa_carr
and price le '500'.
perform data_output.
when pa_lim_2.
select carrid connid fldate price currency from sflight
into table itab_sflight
where carrid = pa_carr
and price between '500' and '1000'.
perform data_output.
when pa_lim_3.
select carrid connid fldate price currency from sflight
into table itab_sflight
where carrid = pa_carr
and price between '1000' and '1500'.
perform data_output.
endcase.
if sy-subrc <> 0.
write: / icon_red_light as icon, text-003.
endif.
----
FORM DATA_OUTPUT *
----
........ *
----
form data_output.
loop at itab_sflight into wa_sflight.
write: / wa_sflight-carrid,
wa_sflight-connid,
wa_sflight-fldate,
(8) wa_sflight-price currency wa_sflight-currency,
wa_sflight-currency.
endloop.
endform.
-
Regds,
12-01-2005 11:14 AM
12-01-2005 11:25 AM
Hi,
1.If you want to change the input fields on some user input then use 'user-command ac' after the field on which you want the action.
2.Specify the modif id 'xxx' for each screen object.
3.Then in the event 'AT SELECTION-SCREEN ON OUTPUT' loop at screen. check the screen-group1(modif id ) of screen objects and change the status of the object.
4.You can view all the screen attribute from se11.
The following example may help you:
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 G1 FOR <field> MODIF ID MRU.
SELECTION-SCREEN END OF BLOCK 001.
AT SELECTION-SCREEN OUTPUT.
LOOP AT SCREEN.
IF P_MRU = 'X'.
IF SCREEN-GROUP1 = 'PRT'.
SCREEN-INPUT = '0'.
ENDIF.
IF SCREEN-GROUP1 = 'MRU'.
SCREEN-INPUT = '1'.
ENDIF.
ELSEIF P_PART = 'X'.
IF SCREEN-GROUP1 = 'MRU'.
SCREEN-INPUT = '0'.
ENDIF.
IF SCREEN-GROUP1 = 'PRT'.
SCREEN-INPUT = '1'.
ENDIF.
ENDIF.
MODIFY SCREEN.
ENDLOOP.
Regards
Sudheer