SAP® Documentation

Single view

/TDAG/SAPLRCS_PRP_C1H0 - EHS: Search/Display Modules for Substance

CPI1466 during Backup   Fill RESBD Structure from EBP Component Structure  
This documentation is copyright by SAP AG.
SAP E-Book

Description

The function group contains the extended search modules for the initial screen of specification management and the specification information system, plus the output functions in the specification information system.

The following is a description of the structure and interfaces of the respective components.

An extended search module consists of three function modules:

  • The parameter function for the user to enter parameters
  • The command function for manipulating parameters and changing the behavior of the search module
  • The actual search function for carrying out the search

In order for an extended search module to appear in the initial screen, the following conditions must be fulfilled:

  • The actual search function must be registered in Customizing for Basic Data and Tools in the IMG activity Manage User Exits as the category SUB_QUERY.
  • The search function and parameter function must be active and available.
  • A command function must be implemented so that you can use all the functions in the extended search.

Parameter Function

The parameter function in an extended search module is used for the user to enter search parameters. It is called whenever the user presses the @1F@ pushbutton for the appropriate search function in the initial screen.
You must adhere to the following naming convention: Name of the function module = name of actual search function + _PARA.
Example: Name of actual search function = C1H0_SUB_FIND_EXMPL, name of parameter function = C1H0_SUB_FIND_EXMPL_PARA.

The parameter function interface must be defined as follows:
FUNCTION C1H0_SUB_FIND_EXMPL_PARA
IMPORTING
VALUE(I_VALDAT) LIKE ESTRH-VALFR DEFAULT SY-DATUM
VALUE(I_FLG_SHOW_ONLY) TYPE ESP1_BOOLEAN
EXPORTING
VALUE(E_FLG_PARA_EXIST) TYPE ESP1_BOOLEAN
VALUE(E_FLG_CANCEL) TYPE ESP1_BOOLEAN
CHANGING
REFERENCE(X_ADDITIONAL_PARAMS) TYPE ESP12_EXTSEA_PARAFUNC_TYPE
OPTIONAL

The function receives the following control information from the calling program:

  • I_VALDAT is passed the key date from the initial screen. This date is required within the parameter screen if, for example, a foreign key check has to be carried out, as a key date always has to be specified when accessing the specification database, since all data has a certain validity period.
  • The I_FLG_SHOW_ONLY indicator can accept values ESP1_TRUE or TRUE (from the include CBUI09) and ESP1_FALSE or FALSE and indicates whether the parameter screen is to be shown in display mode (TRUE) or change mode (FALSE), thus determining whether the user can or cannot make changes to the parameters.
  • Additional control parameters can be passed in the parameter X_ADDITIONAL_PARAMS. This parameter is meant for future enhancements and is not in use at the moment (and is therefore initial).

The function has two indicators as output parameters:

  • E_FLG_PARA_EXIST = TRUE indicates to the calling program that the user has entered valid parameter values or that the corresponding parameters are available from a previous step. The calling program uses this information to change the appropriate pushbutton.
  • E_FLG_CANCEL = TRUE indicates that the user has left the screen using cancel and therefore any changes that may have been made have been lost. In this case, the calling program does not evaluate the above-mentioned indicator and leaves the display of the pushbutton unchanged.

Command Function

The command function in an extended search module enables the program that integrates the user exit to modify the internal data of the extended search module or to carry out certain activities (commands) on this data.
You must adhere to the following naming convention: Name of function module = name of actual search function + _CMD.
Example: Name of actual search function = C1H0_SUB_FIND_EXMPL, name of parameter function = C1H0_SUB_FIND_EXMPL_CMD.

The command function interface must be defined in the following way:
FUNCTION C1H0_SUB_FIND_EXMPL_CMD.
IMPORTING
VALUE(I_COMMAND) TYPE ESP12_EXTSEA_CMDFUNC_CMD_TYPE
EXPORTING
VALUE(E_FLG_PARA_EXIST) TYPE ESP1_BOOLEAN
TABLES
X_PARAMETER_TAB STRUCTURE TCGSGP
CHANGING
REFERENCE(X_ADDITIONAL_PARAMS) TYPE ESP12_EXTSEA_CMDFUNC_TYPE
OPTIONAL
EXCEPTIONS
UNKNOWN_COMMAND

Meaning of parameters:

  • In I_COMMAND the function is passed the command to be carried out from the calling program. The commands to be supported are defined in the type group ESP12 in the constant structure ESP12_EXTSEA_CMDFUNC_CMD.
  • E_FLG_PARA_EXIST = TRUE indicates to the calling program that (for example, after a SET_PARA command) parameter values are available. The calling program uses this information to change the corresponding pushbutton.
  • In table X_PARAMETER_TAB the command function is passed a number of parameters, or the function passes a number of parameters to the calling program (depending on the command SET_PARA or GET_PARA). See also type group ESP12 for more information.
  • Additional control parameters can be passed in the parameter X_ADDITIONAL_PARAMS. This parameter is to be used for future enhancements and is not in use at the moment (and is therefore initial).

Example of the basic structure of a command function:
FUNCTION C1H0_SUB_FIND_EXMPL_CMD.
*"----------------------------------------------------------------------
*"*"Local interface:
*" IMPORTING
*" VALUE(I_COMMAND) TYPE ESP12_EXTSEA_CMDFUNC_CMD_TYPE
*" EXPORTING
*" VALUE(E_FLG_PARA_EXIST) TYPE ESP1_BOOLEAN
*" TABLES
*" X_PARAMETER_TAB STRUCTURE TCGSGP
*" CHANGING
*" REFERENCE(X_ADDITIONAL_PARAMS)
*" TYPE ESP12_EXTSEA_CMDFUNC_TYPE
*" OPTIONAL
*" EXCEPTIONS
*" UNKNOWN_COMMAND
*"----------------------------------------------------------------------

* Local data ----------------------------------------------------------


* Function body -------------------------------------------------------

CASE I_COMMAND.
* clear parameter
WHEN ESP12_EXTSEA_CMDFUNC_CMD-CLEAR_PARA.
CLEAR ...


* get parameter
WHEN ESP12_EXTSEA_CMDFUNC_CMD-GET_PARA.
if ( not ... is initial ).
x_parameter_tab-tablename = ...
x_parameter_tab-fieldname = ...
x_parameter_tab-value = ...
append x_parameter_tab.
endif.


* more ...
WHEN ESP12_EXTSEA_CMDFUNC_CMD-...


* others => raise exception
WHEN OTHERS.
RAISE UNKNOWN_COMMAND.

ENDCASE.

* fill export parameter
E_FLG_PARA_EXIST = LG_FIND_DATA-FLG_PARA_EXIST

ENDFUNCTION.

Actual Search Function

The actual search function of an extended search module actually carries out the specification search. The function is called by the calling program after the user has left the initial screen. The name of the function is registered in Customizing for Basic Data and Tools in the IMG activity Manage User Exits as the category SUB_QUERY.

The search function interface must be defined in the following way:
FUNCTION C1H0_SUB_FIND_EXMPL.
IMPORTING
VALUE(I_VALDAT) LIKE ESTRH-VALFR DEFAULT SY-DATUM
TABLES
I_SUBSTANCE_TAB STRUCTURE RCGSTDRECN
E_SUBSTANCE_TAB STRUCTURE RCGSTDRECN
E_HITINFO_TAB STRUCTURE RCGHITINFO OPTIONAL
CHANGING
REFERENCE(X_ADDITIONAL_PARAMS)
TYPE ESP12_EXTSEA_FUNC_TYPE OPTIONAL
EXCEPTIONS
...

Meaning of input parameters:

  • I_VALDAT: Key date for which the specification data is to be searched. The user specifies this date in the initial screen.
  • I_SUBSTANCE_TAB: Set of specifications already found. The search function must only search for specifications in this set that fulfill its criteria. This means that the function has to combine its search results with the I_SUBSTANCE_TAB set using a logic AND operation. If I_SUBSTANCE_TAB is empty, the system has to search through the whole specification database.
  • X_ADDITIONAL_PARAMS: Additional parameters for future enhancements. Not used at the moment and thus initial.

Meaning of output parameters:

  • E_SUBSTANCE_TAB: Results of the search, in other words, the set of specifications that have fulfilled the search criteria specified by the user and that are already contained in I_SUBSTANCE_TAB.
  • E_HITINFO_TAB: Additional data concerning the specifications found. These details give a small indication for each specification of why it was found, that is, why it appears in the hit list. This parameter is not evaluated further by the calling program at that moment and can thus remain empty.

Output Functions in the Specification Information System

An output function consists of two function modules:

  • A parameter function for modifying internal parameters used for the output
  • The actual output function for data output

Example

As an example of an extended search module, you can compare the search via specification header data that consists of the following three functions:

  • C1H0_SUB_FIND_BY_HEAD
  • C1H0_SUB_FIND_BY_HEAD_CMD
  • C1H0_SUB_FIND_BY_HEAD_PARA

As an example of an output function, you can compare the output of properties as an APAB/4 list that consists of the following two functions:

  • C1H0_SUB_SHOW_VALUAT
  • C1H0_SUB_SHOW_VALUAT_CMD
  • C1H0_SUB_SHOW_VALUAT_PARA

Further information

  • Type group ESP12





Fill RESBD Structure from EBP Component Structure   RFUMSV00 - Advance Return for Tax on Sales/Purchases  
This documentation is copyright by SAP AG.

Length: 11139 Date: 20191014 Time: 195315     sap01-206 ( 52 ms )

Our Service

Looking for Support? Questions?

The

Consolut

Callback-Service

Leave us your contact details and we will call you back. Panels marked with * are mandatory.