1.) F4IF_INT_TABLE_VALUE_REQUEST 多值填入
matnr LIKE mara-matnr ,
maktx LIKE makt-maktx ,
END OF itab.
DATA: return_tab TYPE ddshretval OCCURS 0 .
p_maktx LIKE itab-maktx .
INITIALIZATION.
SELECT matnr maktx INTO TABLE itab FROM makt UP TO 20 ROWS
WHERE spras = '1'.
PERFORM f4.
*& Form f4
*&---------------------------------------------------------------------*
FORM f4.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
retfield = 'MATNR'
dynpprog = sy-repid
dynpnr = sy-dynnr
dynprofield = 'P_MATNR'
value_org = 'S'
callback_program = sy-repid
callback_form = 'CB_FORM'
TABLES
value_tab = itab
return_tab = return_tab
EXCEPTIONS
parameter_error = 1
no_values_found = 2
OTHERS = 3.
ENDFORM. "f4
*& Form cb_form
*&---------------------------------------------------------------------*
FORM cb_form TABLES record_tab STRUCTURE seahlpres
CHANGING shlp TYPE shlp_descr_t
callcontrol LIKE ddshf4ctrl.
DATA: interface LIKE LINE OF shlp-interface.
interface-shlpfield+4(1) = '2'.
interface-valfield = 'P_MAKTX'.
APPEND interface TO shlp-interface.
ENDFORM. "bo_callback_form
2.) DYNP_VALUES_READ 单值填入
DATA : lt_dynpread TYPE STANDARD TABLE OF dynpread .
DATA : lw_dynpread TYPE dynpread .
lw_dynpread-fieldname = 'SO_CNTR-LOW' .
APPEND lw_dynpread TO lt_dynpread .
CALL FUNCTION 'DYNP_VALUES_READ'
EXPORTING
dyname = sy-repid
dynumb = sy-dynnr
TABLES
dynpfields = lt_dynpread
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 .
IF sy-subrc <> 0 .
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF .
CLEAR lw_dynpread .
LOOP AT lt_dynpread INTO lw_dynpread .
IF lw_dynpread-fieldname EQ 'SO_CNTR-LOW' .
IF lw_dynpread-fieldvalue NE space OR
lw_dynpread-fieldvalue IS NOT INITIAL .
so_cntr-low = lw_dynpread-fieldvalue .
so_cntr-sign = 'I' .
so_cntr-option = 'EQ' .
APPEND so_cntr.
ENDIF .
ENDIF .
ENDLOOP .
3) Screen Srearch Help
FORM HELP_CHECK.
*-- Set up fields to retrieve data
ltab_fields-tabname = 'ZFI_PMNTADV'.
ltab_fields-fieldname = 'CHECT'.
ltab_fields-selectflag = 'X'.
APPEND ltab_fields.
ltab_fields-tabname = 'ZFI_PMNTADV'.
ltab_fields-fieldname = 'PMNT_ADV'.
ltab_fields-selectflag = 'X'.
APPEND ltab_fields.
SORT ltab_fields.
DELETE ADJACENT DUPLICATES FROM ltab_fields.
*-- Fill values
SELECT chect
INTO TABLE ltab_values
FROM zfi_pmntadv
WHERE pmnt_adv NE space.
SORT ltab_values.
DELETE ADJACENT DUPLICATES FROM ltab_values.
CALL FUNCTION 'HELP_VALUES_GET_WITH_TABLE'
EXPORTING
fieldname = 'chect'
tabname = 'zfi_pmntadv'
title_in_values_list = 'Select a value'
IMPORTING
select_value = so_chect
TABLES
fields = ltab_fields
valuetab = ltab_values
EXCEPTIONS
field_not_in_ddic = 01
more_then_one_selectfield = 02
no_selectfield = 03.
ENDFORM. "fiscal_year