‎2006 Jun 17 8:55 AM
Hi All,
Please any of you give me code for the following scenario.
there are two select options on the screen.
s_carrid.
s_connid.
for s_carrid if we enter 'AA'.
then f4 help of s_connid should contain only the connid values which are present for AA .
I have used the function module in the event
At selection screen on value-request for field s_connid.
I am not getting the desired out put.
Thanks in advance.
Vani.
‎2006 Jun 17 9:47 AM
REPORT Z_TEST.
SELECT-OPTIONS: S_CARRID FOR SFLIGHT-CARRID,
S_CONNID FOR SFLIGHT-CONNID.
DATA: BEGIN OF HELP_ITEM OCCURS 0,
CONNID TYPE SFLIGHT-CONNID,
END OF HELP_ITEM.
DATA: DYNFIELDS TYPE TABLE OF DYNPREAD WITH HEADER LINE.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR S_CONNID.
DYNFIELDS-FIELDNAME = 'S_CARRID'.
APPEND DYNFIELDS.
CALL FUNCTION 'DYNP_VALUES_READ'
EXPORTING
DYNAME = SY-CPROG
DYNUMB = SY-DYNNR
TRANSLATE_TO_UPPER = 'X'
TABLES
DYNPFIELDS = DYNFIELDS
EXCEPTIONS
INVALID_ABAPWORKAREA = 1
INVALID_DYNPROFIELD = 2
INVALID_DYNPRONAME = 3
INVALID_DYNPRONUMMER = 4
INVALID_REQUEST = 5
NO_FIELDDESCRIPTION = 6
INVALID_PARAMETER = 7
UNDEFIND_ERROR = 8
DOUBLE_CONVERSION = 9
STEPL_NOT_FOUND = 10
OTHERS = 11.
READ TABLE DYNFIELDS WITH KEY FIELDNAME = 'S_CARRID'.
S_CARRID = DYNFIELDS-FIELDVALUE.
SELECT S_CONNID INTO TABLE HELP_ITEM FROM SFLIGHT WHERE CARRID IN S_CARRID .
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
RETFIELD = 'CONNID'
DYNPROFIELD = 'S_CONNID'
DYNPPROG = SY-CPROG
DYNPNR = SY-DYNNR
TABLES
VALUE_TAB = HELP_ITEM.
‎2006 Jun 17 8:58 AM
‎2006 Jun 17 9:02 AM
Also refer to this program (Rich courtesy)
report zrich_0002 .
parameters: p_vbeln type vbak-vbeln,
p_posnr type vbap-posnr.
at selection-screen on value-request for p_posnr.
data: begin of help_item occurs 0,
posnr type vbap-posnr,
matnr type vbap-matnr,
arktx type vbap-arktx,
end of help_item.
data: dynfields type table of dynpread with header line.
dynfields-fieldname = 'P_VBELN'.
append dynfields.
call function 'DYNP_VALUES_READ'
exporting
dyname = sy-cprog
dynumb = sy-dynnr
translate_to_upper = 'X'
tables
dynpfields = dynfields
exceptions
invalid_abapworkarea = 1
invalid_dynprofield = 2
invalid_dynproname = 3
invalid_dynpronummer = 4
invalid_request = 5
no_fielddescription = 6
invalid_parameter = 7
undefind_error = 8
double_conversion = 9
stepl_not_found = 10
others = 11.
read table dynfields with key fieldname = 'P_VBELN'.
p_vbeln = dynfields-fieldvalue.
call function 'CONVERSION_EXIT_ALPHA_INPUT'
exporting
input = p_vbeln
importing
output = p_vbeln.
select posnr matnr arktx into table help_item
from vbap
where vbeln = p_vbeln.
call function 'F4IF_INT_TABLE_VALUE_REQUEST'
exporting
retfield = 'POSNR'
dynprofield = 'P_POSNR'
dynpprog = sy-cprog
dynpnr = sy-dynnr
value_org = 'S'
tables
value_tab = help_item.Regds
Manohar
‎2006 Jun 17 9:47 AM
REPORT Z_TEST.
SELECT-OPTIONS: S_CARRID FOR SFLIGHT-CARRID,
S_CONNID FOR SFLIGHT-CONNID.
DATA: BEGIN OF HELP_ITEM OCCURS 0,
CONNID TYPE SFLIGHT-CONNID,
END OF HELP_ITEM.
DATA: DYNFIELDS TYPE TABLE OF DYNPREAD WITH HEADER LINE.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR S_CONNID.
DYNFIELDS-FIELDNAME = 'S_CARRID'.
APPEND DYNFIELDS.
CALL FUNCTION 'DYNP_VALUES_READ'
EXPORTING
DYNAME = SY-CPROG
DYNUMB = SY-DYNNR
TRANSLATE_TO_UPPER = 'X'
TABLES
DYNPFIELDS = DYNFIELDS
EXCEPTIONS
INVALID_ABAPWORKAREA = 1
INVALID_DYNPROFIELD = 2
INVALID_DYNPRONAME = 3
INVALID_DYNPRONUMMER = 4
INVALID_REQUEST = 5
NO_FIELDDESCRIPTION = 6
INVALID_PARAMETER = 7
UNDEFIND_ERROR = 8
DOUBLE_CONVERSION = 9
STEPL_NOT_FOUND = 10
OTHERS = 11.
READ TABLE DYNFIELDS WITH KEY FIELDNAME = 'S_CARRID'.
S_CARRID = DYNFIELDS-FIELDVALUE.
SELECT S_CONNID INTO TABLE HELP_ITEM FROM SFLIGHT WHERE CARRID IN S_CARRID .
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
RETFIELD = 'CONNID'
DYNPROFIELD = 'S_CONNID'
DYNPPROG = SY-CPROG
DYNPNR = SY-DYNNR
TABLES
VALUE_TAB = HELP_ITEM.
‎2006 Jun 17 10:59 AM
hi
use the select query to fill first internal table which will popup for first select option using this:
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
retfield = wf_field
dynpprog = sy-repid
dynpnr = sy-dynnr
dynprofield = 'P0015-PREAS'
window_title = 'Reason for Change'
value_org = 'S'
TABLES
value_tab = int_value_tab5
FIELD_TAB = int_field
RETURN_TAB = int_RETURNTAB
EXCEPTIONS
parameter_error = 1
no_values_found = 2
OTHERS = 3.
and then second select query will contain the where clause as the value u entered on first select option:
select * from dbtab where caarid = p_carrid( which will be first select option)
Reward points if it helps
Regards
Gunjan
‎2006 Jun 17 10:57 AM
Hi
You will have to use the function module
DYNP_VALUES_READ to read the values entered in any parameter/select-options
and then use
F4IF_INT_TABLE_VALUE_REQUEST function for customized selection
Regards
Navneeth
PS: Award points for all useful answers