Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Updating Employee with HR_INFOTYPE_OPERATION

How do I update an employee with HR_INFOTYPE_OPERATION?

This is my code, but it returns error "Fill in all required entry fields"...

DATA: P0002 like p0002 occurs 0 with header line.
DATA: RC1 TYPE BAPIRETURN1.
DATA: RC3 TYPE BAPIRETURN1.

P0002-NACHN = NACHN.
P0002-VORNA = VORNA.
P0002-GESCH = GESCH.
P0002-GBDAT = GBDAT.
P0002-PERID = PERID.

*Lock Employee
*-------------
CALL FUNCTION 'BAPI_EMPLOYEE_ENQUEUE'
  EXPORTING
    number = PERNR
  IMPORTING
    return = RC3.


CALL FUNCTION 'HR_INFOTYPE_OPERATION'
  EXPORTING
    INFTY                  = '0002'
    NUMBER                 = PERNR
*   SUBTYPE                =
*   OBJECTID               =
*   LOCKINDICATOR          =
    VALIDITYEND            = '99991231'
    VALIDITYBEGIN          = '19780625'
*   RECORDNUMBER           =
    RECORD                 = P0002
    OPERATION              = 'MOD'
*   TCLAS                  = 'A'
*   DIALOG_MODE            = '0'
*   NOCOMMIT               =
*   VIEW_IDENTIFIER        =
*   SECONDARY_RECORD       =
 IMPORTING
   RETURN                  = RC1
*   KEY                    =
    .

*Unlock Employee
*---------------
CALL FUNCTION 'BAPI_EMPLOYEE_DEQUEUE'
  EXPORTING
    number = PERNR.

What am I doing wrong?

Thanks in advance.

Former Member
replied

Hi

HR_MAINTAIN_MASTERDATA if you open and see the definiton of this function module then you can observer that all the import parameters are OPTIONAL Either you can send or you may not but what evr the values that you pass those values are considered and its default INFOTYPE ACTION is INSERT all you have to write MOD and coming to the tables part it is mandartory to pass the PROPOSED_VALUES it is of type structure PROP so all you need to pass is the field name(FNAME) and fieldvalue(FVAL)

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question