HR_INFOTYPE_OPERATION to Update SAP Hr Infotypes - Function Module - ABAP

4
Function module HR_INFOTYPE_OPERATION to maintain SAP HR infotypes The HR_INFOTYPE_OPERATION function module is used for the Maintenance of HR infotypes, such as inserting, changing, deleting data etc Parameters Explained Here is a list of the fm's parameters and how they are used, obviously not all parameters will be used depending on what function you are performing i.e. insert, change, delet etc infty - Infotype being updated objectid - object id from infotype number - Personnel number validityend - validity end date validitybegin - validity begin date record - infotype record values to be updated, inserted etc (will be structure of infortyoe you are updating) recordnumber - sequence nunber from infotype record you are updating Operation - describes what operation is to be performed COP = Copy DEL = Delete DIS = Display EDQ = Lock/unlock INS = Create LIS9 = Delimit MOD = Change INSS = Create for Actions is not converted to Change nocommit - commit yes('X') / no(' ') dialog_mode - dialog mode or not, default is '0' Example coding for MOD operation CONSTANTS: change TYPE pspar-actio VALUE 'MOD'. "This code is requred and locks the record ready for modification CALL FUNCTION 'HR_EMPLOYEE_ENQUEUE' EXPORTING number = p_pernr. "loop at p0071 into p_p0071. "added to put code in context validitybegin = p_record-begda. validityend = p_record-endda. p_record-endda = pn-begda - 1. CALL FUNCTION 'HR_INFOTYPE_OPERATION' EXPORTING infty = '0071' subtype = p_record-subty objectid = P_record-objps number = p_record-pernr "employeenumber validityend = validityend validitybegin = validitybegin record = p_record recordnumber = p_record-SEQNR operation = change nocommit = nocommit dialog_mode = '0' IMPORTING return = return_struct key = personaldatakey EXCEPTIONS OTHERS = 0.

description

HR_INFOTYPE_OPERATION to Update SAP Hr Infotypes - Function Module - ABAP

Transcript of HR_INFOTYPE_OPERATION to Update SAP Hr Infotypes - Function Module - ABAP

Page 1: HR_INFOTYPE_OPERATION to Update SAP Hr Infotypes - Function Module - ABAP

Join the Mailing List

Enter your name and email

address below:

Name:

Email:

Subscribe Unsubscribe

GO

Get your Free Mailing Listby Bravenet.com

Comments (1)

Function module HR_INFOTYPE_OPERATION to maintain SAP HR infotypes

The HR_INFOTYPE_OPERATION function module is usedfor the Maintenance of HR infotypes, such as inserting,changing, deleting data etc

Parameters ExplainedHere is a list of the fm's parameters and how they areused, obviously not all parameters will be used dependingon what function you are performing i.e. insert, change,delet etc

infty - Infotype being updated

objectid - object id from infotype

number - Personnel number

validityend - validity end date

validitybegin - validity begin date

record - infotype record values to be updated, inserted etc (will be structure of infortyoe you areupdating)

recordnumber - sequence nunber from infotype record you are updating

Operation - describes what operation is to be performed COP = Copy DEL = Delete DIS = Display EDQ = Lock/unlock INS = Create LIS9 = Delimit MOD = Change INSS = Create for Actions is not converted to Change

nocommit - commit yes('X') / no(' ')

dialog_mode - dialog mode or not, default is '0'

Example coding for MOD operation

CONSTANTS: change TYPE pspar-actio VALUE 'MOD'.

"This code is requred and locks the record ready for modification CALL FUNCTION 'HR_EMPLOYEE_ENQUEUE' EXPORTING number = p_pernr.

"loop at p0071 into p_p0071. "added to put code in context validitybegin = p_record-begda. validityend = p_record-endda. p_record-endda = pn-begda - 1.

CALL FUNCTION 'HR_INFOTYPE_OPERATION' EXPORTING infty = '0071' subtype = p_record-subty objectid = P_record-objps number = p_record-pernr "employeenumber validityend = validityend validitybegin = validitybegin record = p_record recordnumber = p_record-SEQNR operation = change nocommit = nocommit dialog_mode = '0' IMPORTING return = return_struct key = personaldatakey EXCEPTIONS OTHERS = 0.

Page 2: HR_INFOTYPE_OPERATION to Update SAP Hr Infotypes - Function Module - ABAP

"endloop.

"unlock record after modification CALL FUNCTION 'HR_EMPLOYEE_DEQUEUE' EXPORTING number = p_pernr.

Example coding for INS operation

CONSTANTS: insert TYPE pspar-actio VALUE 'INS'.

"This code is requred and locks the record ready for modification CALL FUNCTION 'HR_EMPLOYEE_ENQUEUE' EXPORTING number = p_pernr.

validitybegin = p_record-begda. validityend = p_record-endda. p_record-pernr = p_pernr p_record-begda = pn-begda. p_record-endda = validityend. p_record-subty = p_SUBTY. "subtype of new entry p_record-SCREF = p_SUBTY. "subtype of new entry "plus populate any other fields you need to update

CALL FUNCTION 'HR_INFOTYPE_OPERATION' EXPORTING infty = '0071' subtype = p_record-subty number = p_record-pernr "employeenumber validityend = validityend validitybegin = validitybegin record = p_record operation = insert nocommit = nocommit dialog_mode = '0' IMPORTING return = return_struct key = personaldatakey EXCEPTIONS OTHERS = 0.

"unlock record after modification CALL FUNCTION 'HR_EMPLOYEE_DEQUEUE' EXPORTING number = p_pernr.

INS operation example coding for infotype 0105

Also see BAPI_EMPLCOMM_CREATE for updating infotype 0105

CALL FUNCTION 'HR_EMPLOYEE_ENQUEUE' EXPORTING number = p_pernr.

p_record-subty = p_subtype. "subtype of new entry p_record-pernr = p_pernr. p_record-SEQNR = '000'. validityend = '99991231'. validitybegin = sy-datum. p_record-begda = sy-datum. p_record-endda = '99991231'. p_record-usrid = 'TESTUSR'.

CALL FUNCTION 'HR_INFOTYPE_OPERATION' EXPORTING infty = '0105' subtype = p_record-subty objectid = P_record-objps number = p_record-pernr "employeenumber validityend = validityend validitybegin = validitybegin record = p_record operation = 'INS' nocommit = nocommit dialog_mode = '0' IMPORTING return = return_struct

Page 3: HR_INFOTYPE_OPERATION to Update SAP Hr Infotypes - Function Module - ABAP

SAP Development ABAP Useful FM's HR FM's Field Conversion ALV App FM's Bespoke FM's

Login

sudhakar 0

Reply

Enter text right here!

Name Email Website (optional)

Comment as a Guest, or login:

Displayed next to your comments. Not displayed publicly. If you have a website, link to it here.

Submit Comment

Comment (1)Sort by: Date Rating Last Activity

· 23 weeks ago

it helps me second time

Post a new comment

Subscribe to None

?

key = personaldatakey EXCEPTIONS OTHERS = 0. if sy-subrc eq 0.* success endif.

CALL FUNCTION 'HR_EMPLOYEE_DEQUEUE' EXPORTING number = p_pernr.

see BAPI_EMPLCOMM_CREATE if updating infotype 0105!!

Check out sap documentation and pattern details for function module hr_infotype_operation on website se80.co.uk

Page 4: HR_INFOTYPE_OPERATION to Update SAP Hr Infotypes - Function Module - ABAP

Latest jobs from ERPJobboard.com

Mitarbeiter/in Human ResourcesUnternehmensbereich: WESSLING Holding GmbH & Co. KG, Einsatzort: Altenberge,

Einstellungstermin: 01.06.2014, ...Sun, 06 Apr 2014 17:00:00 -0700Fachberater Service / Support Separatoren Service (m/w)GEA Westfalia Separator ist ein Unternehmen der GEA Group Aktiengesellschaft, einer

der größten Systemanbieter für die ...Sat, 05 Apr 2014 17:00:00 -0700Global SAP Release Manager (m/w) ITIL

In dieser Funktion übernehmen Sie die Verantwortung für die Konzeption, Umsetzung undkontinuierliche Verbesserung der Release ...Sat, 05 Apr 2014 17:00:00 -0700

Business Intelligence Development Consultant m/wIhre Aufgaben Konzeption, Customizing, Implementierung und permanente

Weiterentwicklung internationaler SAP BW Systeme unserer ...Sat, 05 Apr 201417:00:00 -0700Referent Kundenbeziehungen (m/w)

Contact Us Partners Terms of Service Privacy Policy Advertise

0Like 1 Tweet 0 0Share