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: 

function module by which i can change infotype 2002.

Former Member
0 Kudos

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.

1 ACCEPTED SOLUTION

KK07
Contributor
0 Kudos

hi,

In the same function module instead of using 'INSS' use 'MOD' for modifieng the corresponding fields.

4 REPLIES 4

KK07
Contributor
0 Kudos

hi,

In the same function module instead of using 'INSS' use 'MOD' for modifieng the corresponding fields.

Former Member
0 Kudos

HI.

Use

OPERATION = 'MOD' for Modify record

instead of

OPERATION = 'INSS'.

Regards

Sumit Agarwal

0 Kudos

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

Former Member
0 Kudos

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