SAP Function Modules

HRPDV_POSITION_SEARCH SAP Function module - Search on Position attributes







HRPDV_POSITION_SEARCH is a standard SAP function module available within R/3 SAP systems depending on your version and release level. Below is the pattern details for this FM showing its interface including any import and export parameters, exceptions etc as well as any documentation contributions (Comments) specific to the object.

See here to view full function module documentation and code listing, simply by entering the name HRPDV_POSITION_SEARCH into the relevant SAP transaction such as SE37 or SE80.

Associated Function Group: HRPDV_SERVICES
Released Date: Not Released
Processing type: Remote-Enabled
remote enabled module settings


Pattern for FM HRPDV_POSITION_SEARCH - HRPDV POSITION SEARCH





CALL FUNCTION 'HRPDV_POSITION_SEARCH' "Search on Position attributes
  EXPORTING
    objsel =                    " hrwpc_objsel  Object Selection
*   xadvancedsearch = SPACE     " boole_d       Data element for domain BOOLE: TRUE (='X') and FALSE (=' ')
    dataview =                  " hrwpc_dataview  Data View
    begin_date =                " begda         Start Date
    end_date =                  " endda         End Date
*   user = SY-UNAME             " sy-uname      User Name
*   langu = SY-LANGU            " sy-langu      Language Key of Current Text Environment
*   hitpackagesize = 0          " sy-index      Loop Index
*   hitpackagestartindex = 1    " sy-index      Loop Index
*   cachemaxage = -1            " hrwpc_to_struc-cachevalid  Natural Number
  IMPORTING
    totalhits =                 " sy-index      Loop Index
    readdate =                  " sy-datum      Current Date of Application Server
    readtime =                  " sy-uzeit      Current Time of Application Server
  TABLES
    t_searchvalues =            " hrwpc_s_oadp_searchvalue  Search Field Name and Value
    t_searchresults =           " hrwpc_s_allcont_erp  Column Contents + Link Info for all Columns
    t_colmetadata =             " hrwpc_s_oadp_colmetadata  Column Metadata
  EXCEPTIONS
    OBJSEL_NOT_FOUND = 1        "               Object selection not found
    OBJECTSELECTION_INVALID = 2  "              Object Selection is invalid
    DATAVIEW_NOT_FOUND = 3      "               Data View not found
    OBJECTS_NOT_FOUND = 4       "               Objects not found
    .  "  HRPDV_POSITION_SEARCH

ABAP code example for Function Module HRPDV_POSITION_SEARCH





The ABAP code below is a full code listing to execute function module HRPDV_POSITION_SEARCH including all data declarations. The code uses the latest in-line data DECLARATION SYNTAX but I have included an ABAP code snippet at the end to show how declarations would look using the original method of declaring data variables up front. This will allow you to compare and fully understand the new inline method. Please note some of the newer syntax such as the @DATA is not available until a later 4.70 service pack (SP8).

DATA:
ld_totalhits  TYPE SY-INDEX ,
ld_readdate  TYPE SY-DATUM ,
ld_readtime  TYPE SY-UZEIT ,
it_t_searchvalues  TYPE STANDARD TABLE OF HRWPC_S_OADP_SEARCHVALUE,"TABLES PARAM
wa_t_searchvalues  LIKE LINE OF it_t_searchvalues ,
it_t_searchresults  TYPE STANDARD TABLE OF HRWPC_S_ALLCONT_ERP,"TABLES PARAM
wa_t_searchresults  LIKE LINE OF it_t_searchresults ,
it_t_colmetadata  TYPE STANDARD TABLE OF HRWPC_S_OADP_COLMETADATA,"TABLES PARAM
wa_t_colmetadata  LIKE LINE OF it_t_colmetadata .

DATA(ld_objsel) = 'Check type of data required'.
DATA(ld_xadvancedsearch) = 'Check type of data required'.
DATA(ld_dataview) = 'Check type of data required'.
DATA(ld_begin_date) = 'Check type of data required'.
DATA(ld_end_date) = 'Check type of data required'.
DATA(ld_user) = 'some text here'.
DATA(ld_langu) = 'Check type of data required'.
DATA(ld_hitpackagesize) = '123 '.
DATA(ld_hitpackagestartindex) = '123 '.

DATA(ld_cachemaxage) = 123

"populate fields of struture and append to itab
append wa_t_searchvalues to it_t_searchvalues.

"populate fields of struture and append to itab
append wa_t_searchresults to it_t_searchresults.

"populate fields of struture and append to itab
append wa_t_colmetadata to it_t_colmetadata. . CALL FUNCTION 'HRPDV_POSITION_SEARCH' EXPORTING objsel = ld_objsel * xadvancedsearch = ld_xadvancedsearch dataview = ld_dataview begin_date = ld_begin_date end_date = ld_end_date * user = ld_user * langu = ld_langu * hitpackagesize = ld_hitpackagesize * hitpackagestartindex = ld_hitpackagestartindex * cachemaxage = ld_cachemaxage IMPORTING totalhits = ld_totalhits readdate = ld_readdate readtime = ld_readtime TABLES t_searchvalues = it_t_searchvalues t_searchresults = it_t_searchresults t_colmetadata = it_t_colmetadata EXCEPTIONS OBJSEL_NOT_FOUND = 1 OBJECTSELECTION_INVALID = 2 DATAVIEW_NOT_FOUND = 3 OBJECTS_NOT_FOUND = 4 . " HRPDV_POSITION_SEARCH
IF SY-SUBRC EQ 0. "All OK ELSEIF SY-SUBRC EQ 1. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 2. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 3. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 4. "Exception "Add code for exception here ENDIF.







ABAP code to compare 7.40 inline data declaration with original syntax

The below ABAP code uses the older none in-line data declarations. This allows you to see the coding differences/benefits of the later inline syntax. It may also be useful if you are using an older version of SAP as some of the newer syntax above, such as the @DATA is not available until 4.70 EHP 8.

DATA:
ld_totalhits  TYPE SY-INDEX ,
ld_objsel  TYPE HRWPC_OBJSEL ,
it_t_searchvalues  TYPE STANDARD TABLE OF HRWPC_S_OADP_SEARCHVALUE ,
wa_t_searchvalues  LIKE LINE OF it_t_searchvalues,
ld_readdate  TYPE SY-DATUM ,
ld_xadvancedsearch  TYPE BOOLE_D ,
it_t_searchresults  TYPE STANDARD TABLE OF HRWPC_S_ALLCONT_ERP ,
wa_t_searchresults  LIKE LINE OF it_t_searchresults,
ld_readtime  TYPE SY-UZEIT ,
ld_dataview  TYPE HRWPC_DATAVIEW ,
it_t_colmetadata  TYPE STANDARD TABLE OF HRWPC_S_OADP_COLMETADATA ,
wa_t_colmetadata  LIKE LINE OF it_t_colmetadata,
ld_begin_date  TYPE BEGDA ,
ld_end_date  TYPE ENDDA ,
ld_user  TYPE SY-UNAME ,
ld_langu  TYPE SY-LANGU ,
ld_hitpackagesize  TYPE SY-INDEX ,
ld_hitpackagestartindex  TYPE SY-INDEX ,
ld_cachemaxage  TYPE HRWPC_TO_STRUC-CACHEVALID .

ld_objsel = '123 '.

"populate fields of struture and append to itab
append wa_t_searchvalues to it_t_searchvalues.
ld_xadvancedsearch = '123 '.

"populate fields of struture and append to itab
append wa_t_searchresults to it_t_searchresults.
ld_dataview = '123 '.

"populate fields of struture and append to itab
append wa_t_colmetadata to it_t_colmetadata.
ld_begin_date = '123 '.
ld_end_date = '123 '.
ld_user = 'some text here'.
ld_langu = 'Check type of data required'.
ld_hitpackagesize = '123 '.
ld_hitpackagestartindex = '123 '.

ld_cachemaxage = 123

Contribute (Add Comments)

Please help keep this info upto date and use the comments section below to add useful hints, tips and information specific to this SAP function. This will then be available for you and other users to easily find by simply searching on the object name HRPDV_POSITION_SEARCH or its description.