Posted: Fri Sep 14, 2007 3:41 pm Post subject: Search Help
F4_DATE - displays a calendar in a popup window and allows user to choose a date, or it can be displayed read only.
F4_IF_FIELD_VALUE_REQUEST - Use values from a DDIC table to provide a list of possible values. TABNAME and FIELDNAME are required fields, and when MULTIPLE_CHOICE is selected, more than one value can be returned.
HELP_VALUES_GET - F4 help
Code:
PARAMETERS p_grund TYPE t157d-grund.
CALL FUNCTION 'HELP_VALUES_GET'
EXPORTING
fieldname = 'GRUND'
tabname = 'T157D'
IMPORTING
select_value = p_grund.
F4IF_INT_TABLE_VALUE_REQUEST - F4 help that returns the values selected in an internal table. Very handy when programming your very own F4 help for a field.
Code:
data:
begin of t_values occurs 2,
value like kna1-begru,
end of t_values,
t_return like ddshretval occurs 0 with header line.
append o_begru to s_begru.
else.
o_begru = i_begru.
endif.
F4IF_SHLP_EXIT_EXAMPLE - documents the different reasons to use a search help exit, and shows how it is done.
HELP_START - Display help for a field. Useful for doing AT SELECTION SCREEN ON VALUE REQUEST for those fields that do not provide F4 help at the DDIC level.
HELP_VALUES_GET_WITH_TABLE - Show a list of possible values for F4 popup help on selection screens. This function module pops up a screen that is just like all the other F4 helps, so it looks like the rest of the SAP system. Very useful for providing dropdowns on fields that do not have them predefined.
Code:
tables: t001w.
DATA: lc_werks LIKE t001w-werks,
ltab_fields LIKE help_value OCCURS 0 with header line,
BEGIN OF ltab_values OCCURS 0,
feld(40) TYPE c,
END OF ltab_values.
*-- Set up fields to retrieve data
ltab_fields-tabname = 'T001W'.
ltab_fields-fieldname = 'WERKS'.
ltab_fields-selectflag = 'X'.
APPEND ltab_fields.
HELP_START - при настройках как ниже, позволяет вызвать search help не только при нажатии F4, но и enter
Code:
CONSTANTS: lc_dynprofld_street TYPE help_info-dynprofld VALUE 'ZPRU_KLADR_SCREEN-KNAME_STREET',
lc_dynpprog TYPE help_info-dynpprog VALUE 'SAPLZDBM_KLADR'.
DATA: ftab_dynpselect TYPE TABLE OF dselc WITH HEADER LINE,
ftab_dynpvaluetab TYPE TABLE OF dval WITH HEADER LINE.
DATA: ls_help_info LIKE help_info.
DATA: lc_selection_value LIKE help_info-fldvalue.
DATA: lc_selection(1) TYPE c.
*-- Fill in fields required for help function call
ls_help_info-call = 'V'.
ls_help_info-object = 'F'.
ls_help_info-mcobj = 'ZHRPADRU_KLADR_STREET'.
ls_help_info-menufunct = 'HC'.
ls_help_info-spras = sy-langu.
ls_help_info-program = 'SAPLZDBM_KLADR'.
* ls_help_info-dynpro = sy-dynnr. " remark is important
ls_help_info-tabname = 'ZPRU_KLADR_SCREEN'.
DATA: ltab_fields LIKE dynpread OCCURS 0 WITH HEADER LINE.
DATA: lc_dyname LIKE sy-repid.
DATA: lc_dynumb LIKE sy-dynnr.
DATA: lc_dummy(1) TYPE c.
*-- Read the screen to see if the user has entered a value for WERKS
ltab_fields-fieldname = f_fieldname_in.
APPEND ltab_fields.
lc_dyname = f_repid.
lc_dynumb = f_dynnr.
CALL FUNCTION 'DYNP_VALUES_READ'
EXPORTING
dyname = lc_dyname
dynumb = lc_dynumb
TABLES
dynpfields = ltab_fields
EXCEPTIONS
OTHERS = 01.
READ TABLE ltab_fields INDEX 1.
*-- Return the value from the screen
IF sy-subrc EQ 0.
SPLIT ltab_fields-fieldname AT '-'
INTO lc_dummy
f_fieldname_out.
f_fieldvalue = ltab_fields-fieldvalue.
ENDIF.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum
All product names are trademarks of their respective companies. SAPNET.RU websites are in no way affiliated with SAP AG. SAP, SAP R/3, R/3 software, mySAP, ABAP, BAPI, xApps, SAP NetWeaver and any other are registered trademarks of SAP AG. Every effort is made to ensure content integrity. Use information on this site at your own risk.