Code: Alles auswählen.
TABLE sflight.
PARAMETERS pa_carri TYPE sflight-carrid.
SELECT-OPTIONS so_conni FOR sflight-connid.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR so_conni-low.
PERFORM own_connid_f4.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR so_conni-high.
PERFORM own_connid_f4.
FORM own_connid_f4.
DATA:
ld_field TYPE dynfnam,
ld_program TYPE syrepid.
ld_program = sy-repid.
GET CURSOR FIELD ld_field .
CALL FUNCTION 'F4IF_FIELD_VALUE_REQUEST'
EXPORTING
tabname = 'SFLIGHT'
fieldname = 'CONNID'
searchhelp = 'ZSEARCH_CONNID_VIA_CARRID'
shlpparam = 'CONNID'
dynpprog = ld_program
dynpnr = sy-dynnr
dynprofield = ld_field
stepl = sy-stepl
* VALUE = ' '
* MULTIPLE_CHOICE = ' '
* DISPLAY = ' '
* SUPPRESS_RECORDLIST = ' '
callback_program = ld_program
callback_form = 'OWN_CALLBACK_CONNID_F4'
* CALLBACK_METHOD = CALLBACK_METHOD
selection_screen = abap_true
* IMPORTING
* USER_RESET = USER_RESET
* TABLES
* RETURN_TAB = RETURN_TAB
EXCEPTIONS
field_not_found = 1
no_help_for_field = 2
inconsistent_help = 3
no_values_found = 4
OTHERS = 5.
ENDFORM.
FORM own_callback_connid_f4 TABLES tt_record TYPE ddshreslts
CHANGING cs_shlp TYPE shlp_descr
cs_call TYPE ddshf4ctrl.
FIELD-SYMBOLS:
<ls_interface> TYPE ddshiface.
READ TABLE cs_shlp-interface ASSIGNING <ls_interface>
WITH KEY shlpfield = 'CARRID'.
IF sy-subrc EQ 0.
* Name des Feldes auf dem Selection-Screen
<ls_interface>-value = PA_CARRI. "Einmal der Wert
<ls_interface>-internal = 'X'.
<ls_interface>-valfield = 'PA_CARRI'. "Einmal der Name (für DYNP_READ_VALUES)
ENDIF.
ENDFORM.
Sicher? Ich könnt schwören, dass ich das schon mal versucht hab und es hat nicht geklappt.ewx hat geschrieben:Vorteil2: Es funktioniert ohne Probleme auch mit abhängigen Werten bei PARAMETERS!