2008 Sep 26 7:05 AM
Hello all,
Please suggest me function module by which i can change infotype 2002.
i have used code below.
CALL FUNCTION 'HR_EMPLOYEE_ENQUEUE'
EXPORTING
NUMBER = empid.
WA_P2002-PERNR = empid.
WA_P2002-INFTY = C_2002.
WA_P2002-SUBTY = wa_it1-subty.
WA_P2002-BEGDA = wa_it1-STARTDATE.
WA_P2002-ENDDA = wa_it1-ENDDATE.
WA_P2002-BEGUZ = wa_it1-ARRTIME.
WA_P2002-ENDUZ = wa_it1-DEPTIME.
CALL FUNCTION 'HR_INFOTYPE_OPERATION'
EXPORTING
INFTY = C_2002
SUBTYPE = wa_it1-subty
NUMBER = empid
RECORD = WA_P2002
OPERATION = 'INSS'
NOCOMMIT = 'X'
IMPORTING
RETURN = RETURN.
if sy-subrc = 0.
APPEND wa_it1 TO temp.
ENDIF.
CLEAR: WA_P2002.
call function 'BAPI_TRANSACTION_COMMIT'.
CALL FUNCTION 'HR_EMPLOYEE_DEQUEUE'
EXPORTING
NUMBER = empid.
i don't wanna change subtype.
i only want to change values of begruz and endruz.
Means only time details of employee.
Regards,
Purvesh.
2008 Sep 26 7:46 AM
hi,
In the same function module instead of using 'INSS' use 'MOD' for modifieng the corresponding fields.
hi,
In the same function module instead of using 'INSS' use 'MOD' for modifieng the corresponding fields.
2008 Sep 26 7:46 AM
hi,
In the same function module instead of using 'INSS' use 'MOD' for modifieng the corresponding fields.
2008 Sep 26 7:53 AM
HI.
Use
OPERATION = 'MOD' for Modify record
instead of
OPERATION = 'INSS'.
Regards
Sumit Agarwal
2008 Sep 26 9:55 AM
hi,
i have tried 'ins' ,'Mod','INSS' all.
But not working you sugesst me that how can i achieve this.
if possible write sample code.
Regards,
Purvesh Patel
2008 Oct 08 5:47 PM
Hi, I use the following and it works. Maybe just try without using 'DEL'??
CALL FUNCTION 'BAPI_EMPLOYEE_ENQUEUE'
EXPORTING
NUMBER = PR_TAB-PERNR
IMPORTING
RETURN = RETURN.
IF RETURN-NUMBER NE '000'. " Employee could not be queued
PERFORM STORE_ERROR USING PR_TAB-PERNR 'T'.
ELSE.
CALL FUNCTION 'HR_INFOTYPE_OPERATION'
EXPORTING
INFTY = '2002'
SUBTYPE = PR_TAB-SUBTY
NUMBER = PR_TAB-PERNR
OPERATION = 'DEL'
RECORD = ATT_RECORD
VALIDITYBEGIN = PR_TAB-BEGDA
VALIDITYEND = PR_TAB-ENDDA
RECORDNUMBER = PR_TAB-SEQNR
IMPORTING
RETURN = RETURN_TB.
IF RETURN_TB-NUMBER NE '000'.
PERFORM STORE_ERROR USING PR_TAB-PERNR 'T'.
ENDIF.
CALL FUNCTION 'BAPI_EMPLOYEE_DEQUEUE'
EXPORTING
NUMBER = PR_TAB-PERNR
IMPORTING
RETURN = RETURN.
ENDIF.
Hope this helps.
SL
| User | Count |
|---|---|
| 6 | |
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |