SAP HR_BE_SET_COMPANY_SECTOR Function Module for Set Company Sector: Private or Public
HR_BE_SET_COMPANY_SECTOR is a standard hr be set company sector SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for Set Company Sector: Private or Public 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 hr be set company sector FM, simply by entering the name HR_BE_SET_COMPANY_SECTOR into the relevant SAP transaction such as SE37 or SE38.
Function Group: HRPAYBE_REDUCTIONS
Program Name: SAPLHRPAYBE_REDUCTIONS
Main Program: SAPLHRPAYBE_REDUCTIONS
Appliation area:
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:

Function HR_BE_SET_COMPANY_SECTOR 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 'HR_BE_SET_COMPANY_SECTOR'"Set Company Sector: Private or Public.
EXPORTING
IM_PERNR = "Standard Selections for HR Master Data Reporting
IM_DATE = "Created on
* IM_LANG = "Language Key
IMPORTING
EX_COMPANY_CLASS = "Institution tables: company class
EXCEPTIONS
NO_RECORD_P0001 = 1 ERROR_READING_COMPANY = 2
IMPORTING Parameters details for HR_BE_SET_COMPANY_SECTOR
IM_PERNR - Standard Selections for HR Master Data Reporting
Data type: P_PERNROptional: No
Call by Reference: Yes
IM_DATE - Created on
Data type: CDATEOptional: No
Call by Reference: Yes
IM_LANG - Language Key
Data type: SPRSLOptional: Yes
Call by Reference: Yes
EXPORTING Parameters details for HR_BE_SET_COMPANY_SECTOR
EX_COMPANY_CLASS - Institution tables: company class
Data type: CL_HRPADBE_COMPANYOptional: No
Call by Reference: Yes
EXCEPTIONS details
NO_RECORD_P0001 -
Data type:Optional: No
Call by Reference: Yes
ERROR_READING_COMPANY -
Data type:Optional: No
Call by Reference: Yes
Copy and paste ABAP code example for HR_BE_SET_COMPANY_SECTOR 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_im_pernr | TYPE P_PERNR, " | |||
| lv_no_record_p0001 | TYPE P_PERNR, " | |||
| lv_ex_company_class | TYPE CL_HRPADBE_COMPANY, " | |||
| lv_im_date | TYPE CDATE, " | |||
| lv_error_reading_company | TYPE CDATE, " | |||
| lv_im_lang | TYPE SPRSL. " |
|   CALL FUNCTION 'HR_BE_SET_COMPANY_SECTOR' "Set Company Sector: Private or Public |
| EXPORTING | ||
| IM_PERNR | = lv_im_pernr | |
| IM_DATE | = lv_im_date | |
| IM_LANG | = lv_im_lang | |
| IMPORTING | ||
| EX_COMPANY_CLASS | = lv_ex_company_class | |
| EXCEPTIONS | ||
| NO_RECORD_P0001 = 1 | ||
| ERROR_READING_COMPANY = 2 | ||
| . " HR_BE_SET_COMPANY_SECTOR | ||
ABAP code using 7.40 inline data declarations to call FM HR_BE_SET_COMPANY_SECTOR
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.Search for further information about these or an SAP related objects