Function to update Infotype 0003
Hi,
I want to update 'Run payroll up to' field of infotype 0003 based on some conditions .
Is there any function module to update Infotype 0003 fields ?
Thanks
I have calle the FM with action 'EDQ' .
It did not uloack the pernr .
I am using this code :
SELECT SINGLE STAT2
INTO LV_STAT2
FROM PA0000
WHERE PERNR = INNNN-PERNR AND
ENDDA >= INNNN-BEGDA AND
BEGDA <= INNNN-ENDDA .
IF SY-SUBRC = 0 AND
LV_STAT2 <> '3' .
CALL FUNCTION 'HR_READ_INFOTYPE'
EXPORTING
PERNR = INNNN-PERNR
INFTY = '0003'
IMPORTING
SUBRC = LV_SUBRC_1
TABLES
INFTY_TAB = IT_PA0003
EXCEPTIONS
INFTY_NOT_FOUND = 1
OTHERS = 2.
IF LV_SUBRC_1 = 0 .
READ TABLE IT_PA0003 INDEX 1 .
CHECK SY-SUBRC = 0 .
WA_PA0003 = IT_PA0003 .
IF INNNN-BEGDA > IT_PA0003-ABWD1 .
Reset the "Run payroll for pers.no. up to" date
WA_PA0003-ABWD1 = INNNN-BEGDA .
CALL FUNCTION 'HR_INFOTYPE_OPERATION'
EXPORTING
INFTY = '0003'
NUMBER = INNNN-PERNR
RECORD = WA_PA0003
OPERATION = 'EDQ'
IMPORTING
RETURN = LV_SUBRC_2 .
CALL FUNCTION 'HR_INFOTYPE_OPERATION'
EXPORTING
INFTY = '0003'
NUMBER = INNNN-PERNR
VALIDITYEND = WA_PA0003-ENDDA
VALIDITYBEGIN = WA_PA0003-BEGDA
RECORD = WA_PA0003
OPERATION = 'MOD'
NOCOMMIT = 'X'
IMPORTING
RETURN = LV_SUBRC_2
Similar Messages
-
Update infotype 0041 in payroll function
Hi,
I have created a payroll function to update infotype 0041 during payroll process, but it seems this is causing some inconsistencies in PCL2 cluster,since I'm having some payroll errors.
Is there anyway to avoid this? Can I create an infotype during the payroll process, or this is not advisable?
Thanks in advance.
Best regards,
Sónia GonçalvesYou have to make the function call a separate unit of work.One other option is to put the function call in a report & SUBMIT it from the User exit.
~Suresh -
HR-ABAP Any BAPI or Function module to update infotypes 167 & 170
Hi,
Can anyone let me know is there any BAPI or Function module to update infotypes 167(Health Plans) & 170(Flexible Spending Accounts).
Thanks,
SandeepHi,
U can use HR_BEN_CREATE_PLANS internally it calls HR infotype operation as specified by suresh.
Suresh : If there are approximately 3000 records to be updated on regular basis do u think is it better to use BAPI's or BDC
regards
Vick -
Need a help to Update Infotype.....
Hi Experts,
*am developing HR-ABAP Report inthat, i have data in 2 internal tables, through these (itabs) i want to*
*insert the data into 2 Ztables(Respective tables) and then i want to Update one Custom Infotype.*
how can i procedure for this? is there any FM to update Infotype....
Thanks in Advance,
sudeer.The best way is to use HR_INFOTYPE_OPERATION function module in your program.
Sample code:
call function 'HR_INFOTYPE_OPERATION'
exporting
infty = p0082-infty
number = p0082-pernr
subtype = p0082-subty
validityend = p0082-endda
validitybegin = p0082-begda
record = p0082
operation = 'INS'
tclas = 'A'
dialog_mode = '0'
importing
return = return
key = key.
capture error messages
if return-type = 'E'.
concatenate 'Sub Type:' p0082-infty into messtab-tcode.
move return-message to messtab-param.
append messtab. clear messtab.
endif.
You can use it for modifying the record also. -
Problem in updating infotype 2001
Hi Experts,
While i am updating infotype 2001 , using HR_INFOTYPE_operation FM it giving a error , because it calling a wrong sceen 2000 , instead of 2001 . can anybody can help on this ?
thanks and regards
Renjith MPHi Dude,
Go through the below code for 2002 infotype :
TYPES BEGIN OF text_version.
TYPES nummer TYPE x.
TYPES END OF text_version.
DATA: PERSONALDATAKEY LIKE BAPIPAKEY.
DATA: RETURN LIKE BAPIRETURN1.
DATA: P2002 LIKE P2002.
DATA: PSKEY TYPE PSKEY.
DATA: IT_TEXT TYPE HRPAD_TEXT_TAB .
DATA: LINE TYPE HRPAD_TEXT.
DATA: version TYPE text_version.
DATA: pcl1 TYPE pcl1.Input Parameters:
PARAMETERS: PERNR LIKE PA2002-PERNR DEFAULT '1004511',
AWART LIKE PA2002-AWART DEFAULT 'LW',
BEGDA LIKE PA2002-BEGDA DEFAULT SY-DATUM,
ENDDA LIKE PA2002-ENDDA DEFAULT SY-DATUM,
BEGUZ LIKE PA2002-BEGUZ,
ENDUZ LIKE PA2002-ENDUZ.
START-OF-SELECTION.
CALL FUNCTION 'HR_EMPLOYEE_ENQUEUE'
EXPORTING
number = PERNR
IMPORTING
RETURN = RETURN.
IF RETURN-NUMBER IS NOT INITIAL.
EXIT.
ENDIF.
* ADD DATA
CLEAR: P2002.
P2002-PERNR = PERNR.
P2002-SUBTY = AWART.
P2002-ENDDA = BEGDA.
P2002-BEGDA = BEGDA.
P2002-BEGUZ = BEGUZ.
P2002-ENDUZ = ENDUZ.
P2002-AWART = AWART.
P2002-ITXEX = 'X'.
* WRITE DATA
CLEAR: RETURN, PERSONALDATAKEY.
CALL FUNCTION 'HR_INFOTYPE_OPERATION'
EXPORTING
INFTY = '2002'
NUMBER = PERNR
SUBTYPE = AWART
VALIDITYEND = BEGDA
VALIDITYBEGIN = BEGDA
RECORD = P2002
OPERATION = 'INS'
NOCOMMIT = ''
TCLAS = 'A'
IMPORTING
RETURN = RETURN
KEY = PERSONALDATAKEY
EXCEPTIONS
OTHERS = 0.
IF RETURN-NUMBER IS INITIAL.
COMMIT WORK AND WAIT.
ELSE.
ROLLBACK WORK.
EXIT.
ENDIF. -
Problem using function module for infotype 21
hi
im uploading the infotype 21 (family details) through function module hr_infotype_operations. i found that infotype 0106 (family/related person)
is a secondary infotype and that a record is created for 0106 ,everytime you create a record in 21. so i upload the family data of an employee using the function module for infotype 21 initially. and then fetch the same record from the table pa0106 and modify the same record with other information.
for example : u have the address details of a dependent(father subtype 11) in infotype 21. this address data is stored in the table pa0106 . im not able to modify the record for infotype 0106 using the function module 0106.
i would like to know the reason for the same. Is it because that infotype 0106 is a secondary infotype and u cannot modify the record using the fn module..?/
thanks
sridharanHi Sir,
I am also facing the same issue...i need to update dependents Information Date Of Birth n Perid(Which is stored in IT0106)...in IT 0021..
Kindly correct my code....
I am using the following code for this...
data: w_return type bapireturn1.
data: p0021_struc TYPE p0021,
p0106_struc TYPE p0106,
p_pskey TYPE pskey.
start-of-selection.
get pernr.
p0021_struc = p0021.
p0021_struc-favor = 'Gaurav'.
p0021_struc-fgbdt = '05/10/1955'.
Move p0021_struc-favor to p0021-favor.
p0106_struc = p0106.
p0106_struc-stras = '2235 BOmbay Road'.
p0106_struc-perid = '123456789'.
MOVE p0106_struc-stras to p0106-stras.
Enqueue personnel number
call function 'BAPI_EMPLOYEE_ENQUEUE'
exporting
number = pernr-pernr
importing
return = w_return.
CALL FUNCTION 'HR_INFOTYPE_OPERATION'
EXPORTING
infty = p_pskey-infty
number = p_pskey-pernr
subtype = p_pskey-subty
objectid = p_pskey-objps
lockindicator = p_pskey-sprps
validityend = p0021-endda " '99991231'
validitybegin = p0021-begda
record = p0021_struc
operation = 'mod'
tclas = 'A'
dialog_mode = '2'
nocommit = p_test
VIEW_IDENTIFIER = '07' "p0003-viekn
secondary_record = p0106_struc
IMPORTING
return = w_return
key = familykey
EXCEPTIONS
OTHERS = 0.
Enqueue personnel number
call function 'BAPI_EMPLOYEE_DEQUEUE'
exporting
number = pernr-pernr
importing
return = w_return. -
Update infotype 0032 in user exit ZXPADU02
Hi All,
I have the following requirement.
Telephone extension number is stored in IT0105 and IT0032. When the extension number is updated through ESS, this is stored in IT0105 but it does not update IT0032 which is displayed in MSS.
I need to update infotype 0032 based on the data in 0105.
I thought I could update infotype 0032 in userexit ZXPADU02 whenever infotype 0105 was saved using the function module HR_INFOTYPE_OPERATION but it is not working for me.
Any help would be appreciated.
ElaineYou have to make the function call a separate unit of work.One other option is to put the function call in a report & SUBMIT it from the User exit.
~Suresh -
Update Infotype 24 with Qualification
Hi Friends,
I have to update infotype 24(qualifications). I am using function module Rh_insert_infty_1001_ext to update but this function only creates a record in hrp1001(i.e. OM side) but does not create any record in PA side i.e. infotype 24.
Is there a different way to update infotype 24?
Thanks
NazishHello Nazish,
check this HR_INFOTYPE_OPERATION with operation = 'COP'
For PD tables,FM - BAPI_HRMASTER-SAVE_REPL_MULT is used and after PD tables are updated , for PA Tables use
FM - HR_INFOTYPE_OPERATION
Check FM - RH_INSERT_INFTY_1001_EXT and also FM - BAPI_HRMASTER-SAVE_REPL_MULT
regards -
I need to update infotype 22, 31 , 68. I am using function module "HR_INFOTYPE_OPERATION". But using this FM i can only upate the fields of infotype which are reflected in the infotype screen. I need to update other fields which are there in the PA table but not reflected in the screen.
Is there any other function module available?Hi,
You can use the Function Module <b>HR_MAINTAIN_MASTERDATA</b>.
This function module enables you to maintain master data for employees and applicants. You can enter field names and contents in the 'proposed values' table. This will then be transferred to the corresponding infotypes. The same validation checks take place as would in the individual maintenance screens for the infotypes. You can enter as much data as you like. You can enter several records or infotypes at once. You are responsible for making sure that the data is consistent. If necessary, the module returns an error message. The error messages are the same as the those which appear in the dialog, in other words, the individual maintenance screen error messages are transferred rather than interpreted by this module.
<u>Exanple</u>
CALL FUNCTION 'HR_MAINTAIN_MASTERDATA'
EXPORTING
pernr = p_0735-pernr
MASSN =
actio = 'MOD'
tclas = 'A'
begda = p_0735-begda
endda = p_0735-endda
objps = p_0735-objps
seqnr = p_0735-seqnr
sprps = p_0735-sprps
subty = p_0735-subty
*Put 0 here when everything is ok. 1 shows dialog on error.
dialog_mode = dialog_mode
luw_mode = luw_mode
NO_EXISTENCE_CHECK = ' '
NO_ENQUEUE = ' '
IMPORTING
return = l_return
RETURN1 =
HR_RETURN =
TABLES
proposed_values = l_value_tab
modified_keys = l_pskey. -
Hi all,
Is there any Function module to update infotype 2051. The FM HR_Maintain_masterdate is not working for this infotype.I've done some more research, basically IT2051 data is calculated when you go into the screen and sickness/subsitutions etc feed into this screen. It may be easier to look at loading data into the Time infotypes that get displayed in this Infotype rather than trying to load data directly into it.
Regards
J -
Updating InfoType 0001 in ABAP
Our parent company is passing different begin and end dates from Infotype 0001 to our HR system. In our system an employee would have a start date of 3/1/2005 but our parent company has the same employee in there system as a start date of 1/1/2008. I was looking at using user exit EXIT_SAPLRHA0_003 to capture these and add the parent companies dates into our Infotype 0001 so that there feed doesnt overwrite our original dates. I have attempted to use HR_INFOTYPE_OPERATION with no luck. Any one have a possible way to update InfoType 0001 without using a BDC?
What exactly is the issue? In any case HR_INFOTYPE_OPERATION in turn calls HR_MAINTAIN_MASTERDATA so you might end up with the same issue with either function call.
~Suresh -
Standard programs to upload / update infotypes
Please provide updates for this question:
What are the standard SAP programs to update infotypes ( Ex: 001 / 002 / 003 ) .
I will be uploading data from legacy system ( Excel / Text file ) and would like to use standard programs
before going ahead with BDC .
Thanks
RohanPlease provide updates for this question:
What are the standard SAP programs to update infotypes ( Ex: 001 / 002 / 003 ) .
I will be uploading data from legacy system ( Excel / Text file ) and would like to use standard programs
before going ahead with BDC .
Thanks
Rohan
Hi Rohan ,
you can update you infotype using 'HR_INFOTYPE_OPERATION' function module .
1) transfer all your excel data into internal table .
2) loop at internal table
3) fill all the required field of that infotype .
4) lock table
5) call that functuion module .
6) unlock table
for this fallow the below code...
DATA: it_p0169 TYPE STANDARD TABLE OF pa0169 WITH HEADER LINE. (make internal table according to your requirment)
DATA: wa_p0169 TYPE p0169.
LOOP AT it_file
v_eeamt = it_file-pct_gross.
*Pre-Tax Contribution Percentage
v_eepct = v_eeamt / 10.
v_begda = it_file-datchngd .
*Appending into header (these all are the required filed in my case )
it_p0169-eeamt = v_eeamt.
it_p0169-begda = v_begda.
it_p0169-eepct = v_eepct.
it_p0169-bplan = v_bplan .
CLEAR wa_p0169.
MOVE-CORRESPONDING it_p0169 TO wa_p0169.
wa_p0169-INFTY = '0169'. (not forget to pass infotype no in the header )
CONSTANTS: c_action_ins TYPE pspar-actio VALUE 'MOD', (it can be also COP for Copy , DEL for Delete , DIS for Display , MOD to Change , LIS9 to Delimit , INS to Create )
c_infty_0169 TYPE prelp-infty VALUE '0169'.
DATA: it_return TYPE bapireturn1. (as it is )
DATA: it_return TYPE bapireturn1.
CALL FUNCTION 'BAPI_EMPLOYEE_ENQUEUE'
EXPORTING
number = p_pernr
EXCEPTIONS
OTHERS = 1.
IF sy-subrc <> 0.
RAISE enqueue_FAILED.
ENDIF.
CALL FUNCTION 'HR_INFOTYPE_OPERATION'
EXPORTING
infty = c_infty_0169
number = p_wa_0169-pernr
SUBTYPE = '401K'
OBJECTID =
LOCKINDICATOR =
validityend = p_wa_0169-endda
validitybegin = v_begda1
RECORDNUMBER =
record = p_wa_0169
operation = c_action_ins
TCLAS = 'A'
DIALOG_MODE = '0'
NOCOMMIT =
VIEW_IDENTIFIER =
SECONDARY_RECORD =
IMPORTING
return = it_return.
if it_return-MESSAGE is not initial .
delete it_file .
endif.
commit work .
CALL FUNCTION 'BAPI_EMPLOYEE_DEQUEUE'
EXPORTING
number = p_pernr
EXCEPTIONS
OTHERS = 1.
IF sy-subrc <> 0.
RAISE DEQUEUE_FAILED.
ENDIF.
Enjoy
Priyank -
Hello,
I want to update infotype 0006.
I tried the things in following way using 'HR_INFOTYPE_OPERATION' function.
CALL FUNCTION 'HR_INFOTYPE_OPERATION'
EXPORTING
INFTY = '0006'
NUMBER = PERNR
SUBTYPE = '1'
VALIDITYEND = IT_PA0006-ENDDA
VALIDITYBEGIN = IT_PA0006-BEGDA
RECORD = ls_p0006
OPERATION = 'CHANGE'
TCLAS = 'A'
nocommit = ''
dialog_mode = '0'
IMPORTING
RETURN = RETURN.
Function was executed successfully but there was no updation in the record.
Thanks in advance.****Data declaration
Return Table for ENQUEUE - DEQUEUE messages
DATA: zreturn TYPE bapireturn1,
user TYPE sy-uname.
DATA: wa_0001 TYPE p0001.
****Lock the pernr for editing
CALL FUNCTION 'HR_EMPLOYEE_ENQUEUE'
EXPORTING
number = pernr
IMPORTING
return = zreturn
locking_user = user.
CALL FUNCTION 'HR_INFOTYPE_OPERATION'
EXPORTING
infty = '9009'
number = wa_0001-pernr
validityend = wa_0001-endda
validitybegin = wa_0001-begda
record = wa_0001
operation = 'MOD' "It can be 'INS' for insert or 'DEL' for delete
IMPORTING
return = zreturn
*******Unlock the Pernr
CALL FUNCTION 'HR_EMPLOYEE_DEQUEUE'
EXPORTING
number = pernr
IMPORTING
return = zreturn.
Hope this will help you.
Regards,
Aniruddha -
Funtion module to update Infotype 14
Hi guys,
Is ther any function modules to update infotype 14 other than
HR_INFOTYPE_OPERATION and HR_MAINTAIN_MASTERDATA......
Thanks,
SatyaThis FM uses BDC in its code, see the code in SE37 and you will get some idea as how to use it in your program.
There is a table of type SPA_PACKAGE_COMPONENT that you have to populate first and then passto this FM. While populating that table you will be providing the information to update the infotype and the operation like insert, update etc. -
Hi Experts
I have one problem in updating infotype using
CALL FUNCTION 'HR_INFOTYPE_OPERATION'
EXPORTING
INFTY = '2001'
NUMBER = pernr
SUBTYPE = subtype
VALIDITYBEGIN = validitybegin
VALIDITYEND = validityend
RECORD = wa_inf_2001
OPERATION = action "INS,MOD
IMPORTING
RETURN = return
KEY = key
EXCEPTIONS
OTHERS = 3.
This is working fine for first time operation but when i want to overwrite it .
Is is displaying as page can not be displayed .
i.e if updating infotype with same veluse for two times
i.e duplicationg the values then it is showing error .How to solve it
Thanks
Prasad1) as suggested by Suresh first check the return table to know exaclty the error mesage.
2) u can update a IT with same values i don think it wil have a problem
3) to me it looks that it is due to PERNR locked ,as when u r updating it first time the pernr is locked and when u r trying to update it again in the same session it must be failing due to pernr looked..
so before using FM to update IT ,use Fm -
CALL FUNCTION 'BAPI_EMPLOYEE_ENQUEUE'
EXPORTING
NUMBER = number .
IMPORTING
RETURN = .
and after tht call FM to update IT and then call below FM to unlock employee-
CALL FUNCTION 'BAPI_EMPLOYEE_DEQUEUE'
EXPORTING
NUMBER = number.
IMPORTING
RETURN = .
this will solve ur probelm .
amit
Maybe you are looking for
-
How to connect MBP to Philips HD ready TV with DVI-I
I've managed to connect my Macbook Pro (bought Jan 2013) to my Philips HD ready TV (model number 37PF5520D/10) with the following cables:- 1) Cables 4 ALL Supreme 2M DVI-I Cable / Dual Link 24+5 Pins / Gold Plated / HDTV 2) Apple Mini DisplayPort to
-
Upgrade iphone 4 from 4.1 to 5.1
Hi, I have iphone 4 runnning on 4.1 IOS. I need to upgrade now, when I go to Itunes and hit update it just shows me latest version of IOS i.e. 6.1.3. I heard it is bit heavy for iphone 4 makes iphone 4 slow. Is there any way to install older version
-
Hi abappers I am using the following code in my program. i m getting a syntax error that i do not understand? can any body help me out with this. Regards Narendiran Rathinavelu *& Report ZTEST_RECUPLOAD REPORT ZTEST_RECUPLOAD. *include bdcrecx1. *
-
Deleting all emails for 1 of 2 email accounts in the Message area
Background: I do not have Blackberry Enterprise ServerI have 2 email accounts setup on my Blackberry Pearl 8130: 1 personal Yahoo account and 1 work account Everything works fine, I receive email for both accounts, all is good. Except that I get 2
-
Interactive button layer orders
when i create a button in indesign, it ignores the layer information i've specified, instead moving the newest button to the top layer no matter where it resides in the layer pallet. it also floats it on top of all other page data - master or individ