‎2010 Jun 03 4:40 PM
Hi,
i'm trying to populate the list of relevant values during value request based on the radiobutton entry in the selection screen
Based on the radiobutton selected i need to display the possible values in the select options.
here is the code structure im using. I'm getting inconsistent results and unable to see the acutal radio button selected almost always when executing in background. Let me know where i'm going wrong.
Thanks,
GK.
parameters : p_but1 type c radiobutton group rb1,
p_but2 type c radiobutton group rb1,
p_but3 type c radiobutton group rb1.
select-options : s_selop for table-field.
at selection-screen on value-request for s_selop.
populate values into t_var based on the radio button.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
retfield = 'VARIANT'
dynpprog = sy-repid
dynprofield = 'S_VAR-LOW'
value_org = 'S'
TABLES
value_tab = t_var
EXCEPTIONS
parameter_error = 1
no_values_found = 2
OTHERS = 3.
‎2010 Jun 03 8:58 PM
Leandro ,
Thanks for the quick response. here are the issues im having
1. when i do an F4 the values doesn't showup and i have to hit bottom right corner of the window to see the actual values..Not sure if this is an GUI related issue
2. how to clear t_var entries when i select a radio button.
Thanks.
‎2010 Jun 03 6:31 PM
Hi,
You have to execute the populate subroutine in "at selection-screen on value-request for s_selop" and in start-of-selection.
parameters : p_but1 type c radiobutton group rb1,
p_but2 type c radiobutton group rb1,
p_but3 type c radiobutton group rb1.
select-options : s_selop for table-field.
at selection-screen on value-request for s_selop.
* populate values into t_var based on the radio button.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
retfield = 'VARIANT'
* dynpprog = sy-repid
dynprofield = 'S_VAR-LOW'
value_org = 'S'
TABLES
value_tab = t_var
EXCEPTIONS
parameter_error = 1
no_values_found = 2
OTHERS = 3.
start-of-selection.
if sy-batch = 'X'.
* populate values into t_var based on the radio button.
endif.Best regards,
Leandro Mengue
‎2010 Jun 03 8:58 PM
Leandro ,
Thanks for the quick response. here are the issues im having
1. when i do an F4 the values doesn't showup and i have to hit bottom right corner of the window to see the actual values..Not sure if this is an GUI related issue
2. how to clear t_var entries when i select a radio button.
Thanks.
‎2010 Jun 04 12:26 AM
Hi,
I hope this helps you,
TABLES: sflight.
TYPES:
BEGIN OF tp_sflight,
carrid TYPE sflight-carrid,
connid TYPE sflight-connid,
fldate TYPE sflight-fldate,
END OF tp_sflight.
DATA: t_var TYPE STANDARD TABLE OF tp_sflight.
PARAMETERS : p_but1 TYPE c RADIOBUTTON GROUP rb1 DEFAULT 'X' USER-COMMAND c1,
p_but2 TYPE c RADIOBUTTON GROUP rb1,
p_but3 TYPE c RADIOBUTTON GROUP rb1.
SELECT-OPTIONS : s_fldate for sflight-fldate.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR s_fldate-low.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
retfield = 'FLDATE'
dynpprog = sy-repid
dynpnr = sy-dynnr
dynprofield = 'S_VAR-LOW'
value_org = 'S'
window_title = 'Flight date'
TABLES
value_tab = t_var
EXCEPTIONS
parameter_error = 1
no_values_found = 2
OTHERS = 3.
AT SELECTION-SCREEN OUTPUT.
CASE 'X'.
WHEN p_but1.
SELECT carrid connid fldate
INTO TABLE t_var
FROM sflight
WHERE fldate BETWEEN '20100101' AND '20100131'.
WHEN p_but2.
SELECT carrid connid fldate
INTO TABLE t_var
FROM sflight
WHERE fldate BETWEEN '20100201' AND '20100228'.
WHEN p_but3.
SELECT carrid connid fldate
INTO TABLE t_var
FROM sflight
WHERE fldate BETWEEN '20100301' AND '20100331'.
ENDCASE.regards,
Paulo Carvalho
‎2010 Jun 04 11:57 AM
Paulo,
Appreciate your quick response. i'm still trying to figure out on how to clear the existing values in the selection options when the user selects another radiobutton.
This is necessary when the user selects radiobutton 1 and input multiple values in the select options and selects radiobutton 2 later.
Let me know if you have any inputs.
Thanks.
‎2010 Jun 04 12:44 PM
hi gopal,
Kindly do it in this way refresh the select option under at selection -screen output.
IF r1 = 'X'.
refresh: select_1.
ELSEIF r2 = 'X'.
refresh: select_2.
ENDIF.
‎2010 Jun 04 1:14 PM
Hi,
when the user selects another radiobutton with a USER COMMAND defined, the event AT SELECTION-SCREEN OUTPUT is triggered, you can clear the existing values in this moment
AT SELECTION-SCREEN OUTPUT.
CASE 'X'.
WHEN p_but1.
SELECT carrid connid fldate
INTO TABLE t_var
FROM sflight
WHERE fldate BETWEEN '20100101' AND '20100131'.
DELETE s_fldate WHERE low NOT BETWEEN '20100101' AND '20100131'.
WHEN p_but2.
SELECT carrid connid fldate
INTO TABLE t_var
FROM sflight
WHERE fldate BETWEEN '20100201' AND '20100228'.
DELETE s_fldate WHERE low NOT BETWEEN '20100201' AND '20100228'.
WHEN p_but3.
SELECT carrid connid fldate
INTO TABLE t_var
FROM sflight
WHERE fldate BETWEEN '20100301' AND '20100331'.
DELETE s_fldate WHERE low NOT BETWEEN '20100301' AND '20100331'.
ENDCASE.regards,
Paulo Carvalho
‎2010 Jun 04 1:16 PM
SELECT-OPTIONS : selop1 FOR sy-datum.
AT SELECTION-SCREEN OUTPUT.
Put if condition for the radio button selection
REFRESH: selop1.
CLEAR : selop1.
regards
Walter D'souza
‎2010 Jun 04 1:18 PM
HI ..
Use the FM DYNP_VALUES_READ to get the runtime value at event at selection-screen on value-request. Then check the radio button which is checked and do your own processing.
Thanks
Subhankar