Function module BAPI_EMPLCOMM_CREATE to maintain the SAP HR communication infotype 0105

The BAPI_EMPLCOMM_CREATE function module is used for the Maintenance of the HR communication infotype 0105. So if you add a new entry it will automatically delimit the previous entry.

Function Module parameters

employeenumber - Emplyee number you want to update
subtype - Subtype you want to update in table pa0105
validitybegin - Start date of new record. Fm will use previous day (validitybegin - 1) to delimit existing record
validityend - End date of new record
communicationid - Value of new record to be added to table pa0105
return - Return values


Other details
In-order to execute this function module you also need to have locked the user using BAPI_EMPLOYEE_ENQUEUE, also remember to unlock them after processing using BAPI_EMPLOYEE_DEQUEUE.


Example coding for adding a new entry to info type 0105 with subtype value of '0001'

* return data
  DATA: BEGIN OF 0105_return OCCURS 0.
          INCLUDE STRUCTURE bapiret1.
  DATA: END OF 0105_return.
  data: ld_value type ad_smtpadr,
        ld_pernr type pernr-pernr,
        ld_date  type datum.
  ld_value = 'NEW VALUE'.
  ld_pernr = '111111'.  "enter pernr value here
  ld_date  = sy-datum.  "start date
  CALL FUNCTION 'BAPI_EMPLOYEE_ENQUEUE'
    EXPORTING
      number = ld_pernr.
  CALL FUNCTION 'BAPI_EMPLCOMM_CREATE'
    EXPORTING
      employeenumber  = ld_pernr
      subtype         = '0001'
      validitybegin   = ld_date
      validityend     = '99991231'
      communicationid = ld_value
    IMPORTING
      return          = 0105_return.
  read table 0105_return with key type = 'E'.
  if sy-subrc ne 0.
    write:/ 'Infotype 0105 updated to new Username'.
  endif.
  CALL FUNCTION 'BAPI_EMPLOYEE_DEQUEUE'
    EXPORTING
      number = ld_pernr.

Also see Copy SAP user ABAP program for another example of how to use this function module


Related Articles

ABAP4_CALL_TRANSACTION sap function module
BAPI_ALM_ORDER_MAINTAIN sap BAPI / Function Module to create a work order
CLPB_EXPORT sap function module
CLPB_IMPORT sap function module
CONVERT_DATE_TO_EXTERNAL sap function module
CREATE_TEXT sap function module
CURRENCY_AMOUNT_DISPLAY_TO_SAP sap function module to Convert currency value from display to SAP
CURRENCY_AMOUNT_SAP_TO_DISPLAY FM to Convert currency value from SAP to display
DATE_COMPUTE_DAY sap function module
DATE_TO_DAY sap function module
DOCU_READ sap function module
ENQUEUE_READ sap function module
F4IF_INT_TABLE_VALUE_REQUEST sap function module
FILE_GET_NAME sap function module
SAP Application specific function modules
SAP Custom function modules
SAP field conversion function modules
SAP HR specific function modules
SAP development function modules
Retrieve employees address details (own data)
Function Module DYNP_VALUES_UPDATE to Change screen field contents
sxpg_command_execute FM to Execute external commands (FTP Scripts)
DETERMINE_PERIOD FM to Retrieve fiscal year and period
Function module HR_INFOTYPE_OPERATION to maintain SAP HR infotypes
RH_PM_GET_STRUCTURE FM to retrieve HR Organisation Structure
Validate WBS (code used in ME21)
HR_READ_INFOTYPE SAP FM to Read infotype data
READ_TEXT FM to Read SAP texts
ADDR_PERS_COMP_COMM_MAINTAIN to Update sap users email address plus other details (own data)
HR_PERSONAL_WORK_SCHEDULE to Retrieve employees work schedule
NUMBER_GET_NEXT to get next number in number range sap function module
Generate random number using QF05_RANDOM_INTEGER SAP function module within your ABAP code
RSEC_GENERATE_PASSWORD SAP FM to generate user password
The SAP internet user functionality and Password BAPIs
SAPGUI_SET_FUNCTIONCODE sap function module to execute function code
SX_INTERNET_ADDRESS_TO_NORMAL SAP function module to check email format is correct