SAP CBIH_WA30_WA_FIND_BY_HEAD Function Module for EHS: Find Work Areas Using the Work Area Header









CBIH_WA30_WA_FIND_BY_HEAD is a standard cbih wa30 wa find by head SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for EHS: Find Work Areas Using the Work Area Header processing and below is the pattern details for this FM, showing its interface including any import and export parameters, exceptions etc. there is also a full "cut and paste" ABAP pattern code example, along with implementation ABAP coding, documentation and contribution comments specific to this or related objects.


See here to view full function module documentation and code listing for cbih wa30 wa find by head FM, simply by entering the name CBIH_WA30_WA_FIND_BY_HEAD into the relevant SAP transaction such as SE37 or SE38.

Function Group: CBIH_WA30
Program Name: SAPLCBIH_WA30
Main Program: SAPLCBIH_WA30
Appliation area: M
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:



Function CBIH_WA30_WA_FIND_BY_HEAD pattern details

In-order to call this FM within your sap programs, simply using the below ABAP pattern details to trigger the function call...or see the full ABAP code listing at the end of this article. You can simply cut and paste this code into your ABAP progrom as it is, including variable declarations.
CALL FUNCTION 'CBIH_WA30_WA_FIND_BY_HEAD'"EHS: Find Work Areas Using the Work Area Header
EXPORTING
I_WAHREC = "Search criteria for the work area header
* I_SEARCHMODE = ESP1_SEARCHMODE-WEAK "Search mode for historical search
* I_VALDAT = SY-DATUM "Key Date for Validity
* I_DATERANGE = "Period for Historical Search

IMPORTING
E_RECORDS_FOUND = "Number of work areas found

TABLES
* I_RESTRICTION_TAB = "Restriction using record key
* I_SUPORD_WKA_TAB = "Restriction using higher-level work areas
* I_WAID_RANGE_TAB = "EHS: Ranges Table Type for Data Element CCIHE_WAID
* I_WAPLANT_RANGE_TAB = "EHS: Ranges Table Type for Data Element CCIHE_WAPLANT
* I_WATYPE_RANGE_TAB = "EHS: Ranges Table Type for Data Element CCIHE_WATYPE
E_KEY_TAB = "Record numbers of work areas found

EXCEPTIONS
INTERNAL_ERROR = 1
.



IMPORTING Parameters details for CBIH_WA30_WA_FIND_BY_HEAD

I_WAHREC - Search criteria for the work area header

Data type: CIHWA_WAHAPI_WA_TYPE
Optional: No
Call by Reference: No ( called with pass by value option)

I_SEARCHMODE - Search mode for historical search

Data type: CCIHS_WASEL-SEARCHMODE
Default: ESP1_SEARCHMODE-WEAK
Optional: Yes
Call by Reference: No ( called with pass by value option)

I_VALDAT - Key Date for Validity

Data type: RCGUADM-VALTO
Default: SY-DATUM
Optional: Yes
Call by Reference: No ( called with pass by value option)

I_DATERANGE - Period for Historical Search

Data type: RCGDATERANGE
Optional: Yes
Call by Reference: No ( called with pass by value option)

EXPORTING Parameters details for CBIH_WA30_WA_FIND_BY_HEAD

E_RECORDS_FOUND - Number of work areas found

Data type: SY-TABIX
Optional: No
Call by Reference: No ( called with pass by value option)

TABLES Parameters details for CBIH_WA30_WA_FIND_BY_HEAD

I_RESTRICTION_TAB - Restriction using record key

Data type: CIHWA_WAFAPI_KEY_TAB_TYPE
Optional: Yes
Call by Reference: No ( called with pass by value option)

I_SUPORD_WKA_TAB - Restriction using higher-level work areas

Data type: CIHWA_WAFAPI_KEY_TAB_TYPE
Optional: Yes
Call by Reference: No ( called with pass by value option)

I_WAID_RANGE_TAB - EHS: Ranges Table Type for Data Element CCIHE_WAID

Data type: CCIHY_WAID_RANGE
Optional: Yes
Call by Reference: Yes

I_WAPLANT_RANGE_TAB - EHS: Ranges Table Type for Data Element CCIHE_WAPLANT

Data type: CCIHY_WAPLANT_RANGE
Optional: Yes
Call by Reference: Yes

I_WATYPE_RANGE_TAB - EHS: Ranges Table Type for Data Element CCIHE_WATYPE

Data type: CCIHY_WATYPE_RANGE
Optional: Yes
Call by Reference: Yes

E_KEY_TAB - Record numbers of work areas found

Data type: CIHWA_WAFAPI_KEY_TAB_TYPE
Optional: No
Call by Reference: No ( called with pass by value option)

EXCEPTIONS details

INTERNAL_ERROR - Internal program error

Data type:
Optional: No
Call by Reference: No ( called with pass by value option)

Copy and paste ABAP code example for CBIH_WA30_WA_FIND_BY_HEAD Function Module

The ABAP code below is a full code listing to execute function module POPUP_TO_CONFIRM including all data declarations. The code uses the original data declarations rather than 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 newer method of declaring data variables on the fly. 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), which i why i have stuck to the origianl for this example.

DATA:
lv_i_wahrec  TYPE CIHWA_WAHAPI_WA_TYPE, "   
lv_internal_error  TYPE CIHWA_WAHAPI_WA_TYPE, "   
lv_e_records_found  TYPE SY-TABIX, "   
lt_i_restriction_tab  TYPE STANDARD TABLE OF CIHWA_WAFAPI_KEY_TAB_TYPE, "   
lv_i_searchmode  TYPE CCIHS_WASEL-SEARCHMODE, "   ESP1_SEARCHMODE-WEAK
lt_i_supord_wka_tab  TYPE STANDARD TABLE OF CIHWA_WAFAPI_KEY_TAB_TYPE, "   
lv_i_valdat  TYPE RCGUADM-VALTO, "   SY-DATUM
lt_i_waid_range_tab  TYPE STANDARD TABLE OF CCIHY_WAID_RANGE, "   
lv_i_daterange  TYPE RCGDATERANGE, "   
lt_i_waplant_range_tab  TYPE STANDARD TABLE OF CCIHY_WAPLANT_RANGE, "   
lt_i_watype_range_tab  TYPE STANDARD TABLE OF CCIHY_WATYPE_RANGE, "   
lt_e_key_tab  TYPE STANDARD TABLE OF CIHWA_WAFAPI_KEY_TAB_TYPE. "   

  CALL FUNCTION 'CBIH_WA30_WA_FIND_BY_HEAD'  "EHS: Find Work Areas Using the Work Area Header
    EXPORTING
         I_WAHREC = lv_i_wahrec
         I_SEARCHMODE = lv_i_searchmode
         I_VALDAT = lv_i_valdat
         I_DATERANGE = lv_i_daterange
    IMPORTING
         E_RECORDS_FOUND = lv_e_records_found
    TABLES
         I_RESTRICTION_TAB = lt_i_restriction_tab
         I_SUPORD_WKA_TAB = lt_i_supord_wka_tab
         I_WAID_RANGE_TAB = lt_i_waid_range_tab
         I_WAPLANT_RANGE_TAB = lt_i_waplant_range_tab
         I_WATYPE_RANGE_TAB = lt_i_watype_range_tab
         E_KEY_TAB = lt_e_key_tab
    EXCEPTIONS
        INTERNAL_ERROR = 1
. " CBIH_WA30_WA_FIND_BY_HEAD




ABAP code using 7.40 inline data declarations to call FM CBIH_WA30_WA_FIND_BY_HEAD

The below ABAP code uses the newer in-line data declarations. This allows you to see the coding differences/benefits of the later inline syntax. Please note some of the newer syntax below, such as the @DATA is not available until 4.70 EHP 8.

 
 
"SELECT single TABIX FROM SY INTO @DATA(ld_e_records_found).
 
 
"SELECT single SEARCHMODE FROM CCIHS_WASEL INTO @DATA(ld_i_searchmode).
DATA(ld_i_searchmode) = ESP1_SEARCHMODE-WEAK.
 
 
"SELECT single VALTO FROM RCGUADM INTO @DATA(ld_i_valdat).
DATA(ld_i_valdat) = SY-DATUM.
 
 
 
 
 
 


Search for further information about these or an SAP related objects



Comments on this SAP object

What made you want to lookup this SAP object? Please tell us what you were looking for and anything you would like to be included on this page!