RE:[sap-hr] Delimit Old Record and Create New Record Using hr_infotype_operation

Reply from richard.bassett on Mar 16 at 9:22 AM
You may need to check the settings for Infotype 0002. Some systems have this set to only allow one of these to exist.

---------------Original Message---------------
From: srini
Sent: Thursday, March 15, 2012 10:51 AM
Subject: Delimit Old Record and Create New Record Using hr_infotype_operation

Hi ,

I am working on inbound interface for HR module. I am getting the .txt file from application server(chnage data) and i need update the infotypes with file data.

I am uploading the data using FM HR_infotype_operation.

the scenario is i need to delimit the previous record and create the new record valide from date( when we are updated ) enddate is 31/12/9999.

EX : 11/03/1976 12/31/9999 fernando robert fernando Single

Result should be :

11/03/1976 14/03/2012 fernando robert fernando Single

15/03/2012 31/12/9999 rahim robert rahim married

I am using the code like this.

select single * from pa0002 into CORRESPONDING FIELDS OF WA_INFY_P0002 where pernr = WA_MOD-EMP_ID.

CLEAR : RETURN.

call function 'BAPI_EMPLOYEE_ENQUEUE'

EXPORTING

number = WA_MOD-EMP_ID

IMPORTING

return = RETURN.

IF RETURN-NUMBER IS INITIAL.

WA_INFY_p0002-PERNR = WA_MOD-EMP_ID.

WA_INFY_p0002-NACHN = WA_MOD-last_name.

WA_INFY_p0002-NACH2 = WA_MOD-middle_name.

WA_INFY_p0002-VORNA = WA_MOD-first_name.

WA_INFY_p0002-FAMST = WA_MOD-MARR_STATUS.

WA_INFY_p0002-FAMDT = WA_MOD-MARR_DATE.

CALL FUNCTION 'HR_INFOTYPE_OPERATION'

EXPORTING

INFTY = '0002'

NUMBER = WA_INFY_P0002-PERNR

VALIDITYEND = '99991231'

VALIDITYBEGIN = SY-DATUM

RECORD = WA_INFY_P0002

OPERATION = 'INS'

DIALOG_MODE = '1'

IMPORTING

RETURN = RETURN

KEY = PERSONALDATAKEY.

COMMIT WORK.

I am able to modify, but I need delimit and create the new record.

please help me .

Thanks,

Srinivas.

 
Reply to this email to post your response.
 
__.____._
Manage Settings | Unsubscribe | Create FAQ | Send Feedback
  
Copyright © 2012 Toolbox.com and message author.
Toolbox.com 4343 N. Scottsdale Road Suite 280, Scottsdale, AZ 85251
richard.bassett  

achievement
 
Mark as helpful
View this online
Ask a new question
 
In the Spotlight
Become a blogger at Toolbox.com and share your expertise with the community. Start today.

_.____.__