2007 Jan 23 11:16 AM
I am facing some problems while using the fm HR_INFOTYPE_OPERATION. I have uploaded the data for a particular infotype (say 0009) from the flat file. Now, I am looping through this internal table and calling this function module inside the loop after assigning the required values.
In the first iteration of the loop the function works fine and updates 1st records, but it doesnt update rest of the records. Also, I tried using dialog_mode = '2' which is used to show the screens while it updates the infotypes using pa30, but this also works only for the first record.
While looking for the same problem on SDN, the suggested solutions are "Wait upto 10 seconds" as there may be some time constraint before uploading the second record, but I dont think so. Someone else suggested the use of some buffer of PA30... here is the link Also tell me the significance of return as the importing parameter of this fm. I am also attaching the source code with this mail for you reference.
2007 Jan 23 11:22 AM
instead of using this FM..
use BAPI - BAPI_BANKDETAIL_CREATE
1) do a loop at ur internal table.
2) lock personnel number via FM BAPI_EMPLOYEE_ENQUEUE
3) call BAPI BAPI_BANKDETAIL_CREATE "u can also call Fm Commit_bapi after this.
4) unlock Employee number -
BAPI_EMPLOYEET_DEQUEUE
5) endloop.
instead of using this FM..
use BAPI - BAPI_BANKDETAIL_CREATE
1) do a loop at ur internal table.
2) lock personnel number via FM BAPI_EMPLOYEE_ENQUEUE
3) call BAPI BAPI_BANKDETAIL_CREATE "u can also call Fm Commit_bapi after this.
4) unlock Employee number -
BAPI_EMPLOYEET_DEQUEUE
5) endloop.
2007 Jan 23 11:22 AM
instead of using this FM..
use BAPI - BAPI_BANKDETAIL_CREATE
1) do a loop at ur internal table.
2) lock personnel number via FM BAPI_EMPLOYEE_ENQUEUE
3) call BAPI BAPI_BANKDETAIL_CREATE "u can also call Fm Commit_bapi after this.
4) unlock Employee number -
BAPI_EMPLOYEET_DEQUEUE
5) endloop.
2007 Jan 23 11:47 AM
Hi aeroshil,
1. tell me the significance of return as the importing parameter of this fm.
RETURN
If there are any errors while posting data to infotype,
this RETURN structure will contain the message.
2. While looping, we can put many records.
Make sure u are putting correct values in the FM.
3. Also make sure,
u are ENQUEING the employee , before using this FM.
4. Sample code - Just copy paste
5. U can change the pernr and amount values as per requirement.
6.
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
.
regards,
amit m.
2007 Jan 24 5:54 AM
thanks guys,
it worked out. now i have to pupulate data in infotypes
1) pa0008- basic pay
2) pa0007- planned working type
3) pa0014-recurring payment deduction
4) pa0015- additional payments
5) pa0045-company loans
6) pa0185- personal id
i fould out a function module for basic pay - " BAPI_BASICPAY_CREATE".
so in this case also do i have to run the enque and deque pernr inside the loop before and after this function module "bapi_basicpay_create".
what about the other infotype ? i want to know about the above mentioned infotypes .
regards ,
aeroshil
2007 Jan 24 6:28 AM
Hi again,
1. pa0008- basic pay
2) pa0007- planned working type
3) pa0014-recurring payment deduction
4) pa0015- additional payments
5) pa0045-company loans
6) pa0185- personal
For all these infotypes, u can use the same FM HR_INFOTYPE_OPERATIONS
(0008 will also work)
2. But normally, its easier for 0008 to use BAPI_BASICPAY_CREATE
3. In all cases,
before using any of the FM, for any pern,
its necessary to ENQUEU the pernr,
otherwise it will not work.
regards,
amit m.
2007 Jan 24 6:18 AM
hi ,
the updatation of infotype pa0008- basicpay requires the filling of table control wage type and amount.how do i upload the data for wage type and amount..
regards,
aeroshil nameirakpam
2007 Jan 24 6:55 AM
hi mittal,
thanks for the suggestion. i will look into it. presently i am working on the "basicpay-pa0008". in my project i have to load data in wage type table control .I have to insert 10 wage type and their respective amount..how can i load the data in the table control for 10 wage types using bapi- " BAPI_BASICPAY_CREATE".
because in the function module there is only one field "WAGETYPES" under tables.
regards,
aeroshil
2007 Jan 24 7:01 AM
Hi again,
1. In the FM, there is on TABLES parameter,
WAGETYPES LIKE BAPIP0008P
2. In that,
populate 10 records for 10 wage types.
3. This internal table is nothing but
mirror representation of the
table control in infotype 0008 screen.
regards,
amit m.
2007 Jan 25 5:49 AM
hi all,
i want to know any special function module is used for "planned working time"
or can i use the same "HR_INFOTYPE_OPERATIONS" with enque and deque pernr operation.
another thing can i modify the data already uploaded using any of the function module just giving "MOD" in "operation" of HR_INFOTYPE_OPERATIONS.
regards,
aeroshil
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |