Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

HR_INFOTYPE_OPERATION

Former Member
0 Kudos

HI,

COULD U PLEASE TELL ME HOW THIS FUNCTION MODULE WORKS. AND IN WHICH DATABASE TABLE WILL THE RESULTS BE STORED?

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Functionality

This function module enables you to maintain master data for employees and applicants. You can transfer one data record. All validation checks take place that would take place in the individual maintenance screens in the dialog. If necessary, the module returns an error message. The error messages are the same as the error messages in the dialog, that is, the individual maintenance screen error messages are transferred rather than interpreted by this module.

Notes

The update takes place using a 'Call dialog' from the module pool infotypes. For this reason, some restrictions apply for the infotypes that are to be handled in this way.

The screens for individual infotypes can not overwrite the transferred data for PBO.

No essential checks that are programmed 'on request' will be included in the module, as these will not run.

No messages can be processed for PBO. This will lead to error message 428(PG).

No 'leave screens' may be programmed, unless 'set screen 0' has been set previously. This also leads to error message 428(PG).

If you receive error messages of type 'Required field not filled...', you can not specify the field any more precisely. In this case, you must try to transfer the data into the system using the dialog transaction.

Parameters

INFTY

NUMBER

SUBTYPE

OBJECTID

LOCKINDICATOR

VALIDITYEND

VALIDITYBEGIN

RECORDNUMBER

RECORD

OPERATION

TCLAS

DIALOG_MODE

NOCOMMIT

VIEW_IDENTIFIER

SECONDARY_RECORD

RETURN

KEY

1. this is the full coding.

2. just copy paste in new program.

3. U can change the infotype, pernr and other values as per requirement.

4.

Report abc.

Data

DATA : P0015 LIKE P0015.

DATA : RETURN LIKE BAPIRETURN1.

DATA : KEY LIKE BAPIPAKEY.

DATA : RETURNE LIKE BAPIRETURN1 .

Values (Change as per Requirement)

P0015-PERNR = '1'.

P0015-BEGDA = '2061101'.

P0015-ENDDA = '2061101'.

P0015-LGART = '3075'.

P0015-PREAS = '01'.

P0015-WAERS = 'INR'.

P0015-BETRG = '2500'.

First Enqu

CALL FUNCTION 'BAPI_EMPLOYEE_ENQUEUE'

EXPORTING

NUMBER = p0015-pernr

IMPORTING

RETURN = RETURNE.

Update

CALL FUNCTION 'HR_INFOTYPE_OPERATION'

EXPORTING

INFTY = '0015'

NUMBER = P0015-PERNR

SUBTYPE = P0015-SUBTY

OBJECTID = P0015-OBJPS

LOCKINDICATOR = P0015-SPRPS

VALIDITYEND = P0015-ENDDA

VALIDITYBEGIN = P0015-BEGDA

RECORDNUMBER = P0015-SEQNR

RECORD = P0015

OPERATION = 'INS'

TCLAS = 'A'

DIALOG_MODE = '0'

IMPORTING

RETURN = RETURN

KEY = KEY.

IF RETURN IS NOT INITIAL.

WRITE 😕 'Error Occurred'.

ENDIF.

Dequeue

CALL FUNCTION 'BAPI_EMPLOYEE_DEQUEUE'

EXPORTING

NUMBER = P0015-PERNR

Check this also.

https://forums.sdn.sap.com/click.jspa?searchID=5379322&messageID=3258061

Reward if useful.

3 REPLIES 3

Former Member
0 Kudos

Functionality

This function module enables you to maintain master data for employees and applicants. You can transfer one data record. All validation checks take place that would take place in the individual maintenance screens in the dialog. If necessary, the module returns an error message. The error messages are the same as the error messages in the dialog, that is, the individual maintenance screen error messages are transferred rather than interpreted by this module.

Notes

The update takes place using a 'Call dialog' from the module pool infotypes. For this reason, some restrictions apply for the infotypes that are to be handled in this way.

The screens for individual infotypes can not overwrite the transferred data for PBO.

No essential checks that are programmed 'on request' will be included in the module, as these will not run.

No messages can be processed for PBO. This will lead to error message 428(PG).

No 'leave screens' may be programmed, unless 'set screen 0' has been set previously. This also leads to error message 428(PG).

If you receive error messages of type 'Required field not filled...', you can not specify the field any more precisely. In this case, you must try to transfer the data into the system using the dialog transaction.

Parameters

INFTY

NUMBER

SUBTYPE

OBJECTID

LOCKINDICATOR

VALIDITYEND

VALIDITYBEGIN

RECORDNUMBER

RECORD

OPERATION

TCLAS

DIALOG_MODE

NOCOMMIT

VIEW_IDENTIFIER

SECONDARY_RECORD

RETURN

KEY

1. this is the full coding.

2. just copy paste in new program.

3. U can change the infotype, pernr and other values as per requirement.

4.

Report abc.

Data

DATA : P0015 LIKE P0015.

DATA : RETURN LIKE BAPIRETURN1.

DATA : KEY LIKE BAPIPAKEY.

DATA : RETURNE LIKE BAPIRETURN1 .

Values (Change as per Requirement)

P0015-PERNR = '1'.

P0015-BEGDA = '2061101'.

P0015-ENDDA = '2061101'.

P0015-LGART = '3075'.

P0015-PREAS = '01'.

P0015-WAERS = 'INR'.

P0015-BETRG = '2500'.

First Enqu

CALL FUNCTION 'BAPI_EMPLOYEE_ENQUEUE'

EXPORTING

NUMBER = p0015-pernr

IMPORTING

RETURN = RETURNE.

Update

CALL FUNCTION 'HR_INFOTYPE_OPERATION'

EXPORTING

INFTY = '0015'

NUMBER = P0015-PERNR

SUBTYPE = P0015-SUBTY

OBJECTID = P0015-OBJPS

LOCKINDICATOR = P0015-SPRPS

VALIDITYEND = P0015-ENDDA

VALIDITYBEGIN = P0015-BEGDA

RECORDNUMBER = P0015-SEQNR

RECORD = P0015

OPERATION = 'INS'

TCLAS = 'A'

DIALOG_MODE = '0'

IMPORTING

RETURN = RETURN

KEY = KEY.

IF RETURN IS NOT INITIAL.

WRITE 😕 'Error Occurred'.

ENDIF.

Dequeue

CALL FUNCTION 'BAPI_EMPLOYEE_DEQUEUE'

EXPORTING

NUMBER = P0015-PERNR

Check this also.

https://forums.sdn.sap.com/click.jspa?searchID=5379322&messageID=3258061

Reward if useful.

0 Kudos

can we use this function module without enqueue and dequeue?

and which database table will it get saved in?

0 Kudos

Hi you cannot use hrinfotype operations with out en &deque

since the function module reqires lock before insert and release after insertion which is basically the DB LUW

Regards

Riyaz