Help me on fm : 'HR_MAINTAIN_MASTERDATA'
My Requirement is to dynamically create a record in Infotypes 0032 while hiring an employee.
For which i am writing a subroutine, In that subroutine i am calling 'HR_MAINTAIN_MASTERDATA'.
The function module is getting triggered and after executing this function module i am getting V_RETURN-LOG_MSG_NO = 0 & sy-subrc = 0. <b>But record not getting saved.</b> I am unable to find why it is not updating.
Can any one of you plz help me.
Suggestions will be rewarded.
>>>My Requirement is to dynamically create a record in Infotypes 0032 while hiring an employee.
For which i am writing a subroutine, In that subroutine i am calling 'HR_MAINTAIN_MASTERDATA'.
Put this subroutine in a report Program & SUBMIT that report from the subroutine. This way, the two COMMIT WORKs get isolated into separate work processes & the Update will be as expected.
~Suresh
Similar Messages
-
ABAP Sample code for HR_MAINTAIN_MASTERDATA
Hi folks,
I want to delimit a record in the HR master Table wi the help of Function Module HR_MAINTAIN_MASTERDATA, but its not updating HR master table correctly so please send me some sample code for that function module.
usefull points will rewarded.
Reg,
Hariharanhi
good
check with this code
Call update function module:
CALL FUNCTION 'HR_MAINTAIN_MASTERDATA'
EXPORTING
PERNR = SS300_0001T-PERNR
ACTIO = OPERATION
BEGDA = VALIDITYBEGIN
ENDDA = '99991231'
SUBTY = SPACE
NO_ENQUEUE = SPACE
IMPORTING
RETURN1 = RETURN
TABLES
PROPOSED_VALUES = VALUES
MODIFIED_KEYS =
EXCEPTIONS
OTHERS = 1.
IF RETURN IS INITIAL.
CONCATENATE SS300_0002-VORNA SS300_0002-NACHN
INTO ENAME SEPARATED BY SPACE.
CONDENSE ENAME.
MESSAGE S006 WITH ENAME SPACE.
ELSE.
MESSAGE ID RETURN-ID
TYPE 'S'
NUMBER RETURN-NUMBER
WITH RETURN-MESSAGE_V1 RETURN-MESSAGE_V2
RETURN-MESSAGE_V3 RETURN-MESSAGE_V4.
ENDIF.
http://help.sap.com/saphelp_nw04/helpdata/en/f1/0ce464dc8b11d2803800c04f99fbf0/content.htm
reward point if helpful.
thanks
mrutyun^ -
How to upload data into an infotype?
hi all,
I have upload the data from an text file into infotye IT0169. for this i have to i have used HR_Maintain_Masterdata. Here im able to insert the data but not able to modify the existing records. how can i achieve this. does HR_Maintain_Masterdata not modify or update the existing records if no then is there any other FM?
another issure is
In case of insert i have fields like Pernr. begda, endda, subtype , BEN_PCT.
after the function call all data gets inserted into the fileds of infotype except theBEN_PCT field.
Can u please provide pointers on this too
TIAhi
You can modify data using HR_MAINTAIN_MASTERDATA
Just check the below code. It might help.
CALL FUNCTION 'HR_MAINTAIN_MASTERDATA'
EXPORTING
PERNR = NUMBER
ACTIO = OPERATION
TCLAS = TCLAS
BEGDA = VALIDITYBEGIN
ENDDA = VALIDITYEND
OBJPS = OBJECTID
SEQNR = RECORDNUMBER
SPRPS = LOCKINDICATOR
SUBTY = SUBTYPE
WERKS = WERKS
PERSG = PERSG
PERSK = PERSK
LUW_MODE = LUW_MODE
DIALOG_MODE = DIALOG_MODE
NO_EXISTENCE_CHECK = 'X'
NO_ENQUEUE = 'X'
IMPORTING
RETURN1 = RETURN
TABLES
PROPOSED_VALUES = PROPOSED_VALUES
MODIFIED_KEYS = MODIFIED_KEYS
EXCEPTIONS
OTHERS = 0.
It has additional import parameters:
WERKS = WERKS
PERSG = PERSG
PERSK = PERSK
regards
Nishant Malhotra -
Help on HR_MAINTAIN_MASTERDATA
Hi,
My Requirement is to dynamically create a record in Infotypes 0032 & 0105 while hiring an employee.
For which i am writing a subroutine, In that subroutine i am calling 'HR_MAINTAIN_MASTERDATA', the function module is getting triggered while hiring and even it is hitting infotype 0032 & 0105, but the record is not getting saved.
Can any one of you plz help us.
Suggestions will be rewarded.
Thanks,
SharathTry this:
call FM 'BAPI_TRANSACTION_COMMIT' after you call FM 'HR_MAINTAIN_MASTERDATA'
Thanks,
Santosh -
How to know "pernr" after creation of employee with HR_MAINTAIN_MASTERDATA
Hello,
Anybody any idea how you can know the pernr of the employee you created with HR_MAINTAIN_MASTERDATA?
Problem I am facing:
I create a new employee using HR_MAINTAIN_MASTERDATA.
As I do not have all information required yet, I only update/insert IT0000.
(otherwise the program asks me to "Fill in all required fields")
Then I want to fill up the other IT with HR_INFOTYPE_OPERATION, but I don't know the number that was created.
Can anybody help me?
Thanks.Have you checked the exporting parameter from the fm call?
EXPORTING
*" VALUE(RETURN) LIKE BAPIRETURN STRUCTURE BAPIRETURN
*" VALUE(RETURN1) LIKE BAPIRETURN1 STRUCTURE BAPIRETURN1
*" VALUE(HR_RETURN) LIKE HRHRMM_MSG STRUCTURE HRHRMM_MSG
a® -
Hiring action with reference Pernr via HR_MAINTAIN_MASTERDATA
Ciao,
I need some help to solve the following problem:
I get all needed data for an hiring action via external interface and need to perform the hiring action with HR_MAINTAIN_MASTERDATA by passing a reference personel number to the function.
my problem: theres no chance to pass the parameter RFPNR to HR_MAINTAIN_MASTERDATA and so the function does not link the new PERNR to the CP of the RFPNR
therefore, the function creates a new employee with a new central person (CP) instead of linking the new employee to the central person of the passed RFPNR and copying the relevant infotypes
my question: does somebody know how to make HR_MAINTAIN_MASTERDATA work with the reference Pernr (RFPNR) ?!
alternatively I could delete the link between the new employee and it's (new) central person, insert a new link between the central person of the referenced employee and the new employee and delete the crfeated central person of the new employee.
as result I would have correct links to the CP BUT I'm facing the problem, that the infotypedata of the CP was not taken over to the new linked employee ...
is there any function or report, that copys relevant data (infotypes) from a central person to it's linked employees (PERNRs) ?!
would be nice if anyboday could help me or give me a small hint
thanks,
MarkusI found the solution by myself ....
Problem: hr_maintain_masterdata crashes with shortdump while writing an hiring action.
Cause: we implemented infotype enhancements via userexit where parameter VIEKN is queried. The parameter VIEKN is saved in infotype 3. In LUW-mode 3 theres no existent IT0003 when hiring a person (because nothing is written to database) that causes the shortdump ...
solution (workaround): First I have to call maintain_masterdate just with infotype 0000 (without reference pernr!) ... that triggers the creation of it0003 by the system itself ... then I have to call a second maintain_masterdata with all the other infotypes of the action and everything works fine! Now the new person is in the system and while creating the person, the system also created a new central person and a link between the new CP and the new person.
after doing this (and did'nt get any failure!) I have to determine the central person (CP) of the referenced person, making a new link between the new person and the referenced persons CP, deleting the link between the new person an d the new CP, deleting the new cp and every thing works fine!!!! the reason for this is: infotype 31 just shows the "links" that are defined in OM
if anybody is interested in more details, just contact me
Edited by: Raabiat on Apr 4, 2011 11:35 AM -
HR_MAINTAIN_MASTERDATA
hi,
can you plz explain me how to use this function module in detail.
any code snipet wil be of great help.
is it possible to generate a PERNR for a new hire using this function module?
regards,
BalajiHere is the code..
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.
I don't think we can generate PERNR using this. Use PA40 to create the PERNR -
HR_MAINTAIN_MASTERDATA, buffer gives old data
Hi All,
We are using a module pool program that facilitates hiring of employees. A user who performs hiring action, uses this program and updates records that get updated in R3 PA tables.
The problem is when the user tries to update a batch of records. It works fine for the first record but for the second, it displays the details of the first. (if my 2nd employee is Y, the details of emp X still get displayed)
We are using HR_INFOTYPE_OPERATION for this. I debugged and found that HR_MAINTAIN_MASTERDATA is used inside. A perform called GET_INFOTYP_BUFFER in mainitain_masterdata gets the data from buffer (which is of the old record and not the new one)..Why is the buffer still having the old record details? How to refresh the buffer?
Regards,
Aruna Nivetha.RHi Shrinivas,
That dint help much. Even when I used HR_INITIALIZE_BUFFER, the problem still persists....
Any other clue?
Regards,
Aruna Nivetha.R -
HR_MAINTAIN_MASTERDATA substitutions
Hi Gurus,
we are facing a problem using the FM HR_MAINTAIN_MASTERDATA to save substitutions. The problem is the FM doesn't delimit the substituion if we enter a new one.
For example, a substitution from 07.02.2011 to 13.02.2011, we try to book a new subtitution for the 09.02.2011. The FM delete the substitution from 07 to 13 and just matain the 09.02.2011.
I have tried with the operation LIS9, MOD and INS. INS works as I have described before, MOD and LIS9 doesn't work (error: Complex error ...)
This is very weird becuase sometime works, (10% of the times), but I didn't find anything different.
In addition, I have tried to use the FM HR_INFOTYPE_OPERATION, but I dind't find the proper values to make it works.
The same tests have been done for absences with op=INS, and they are delimited.
Do you know a way to delimit the IT2003?
Thank you and regards,
RodolfoA behaviour that has been observed was that, after infotype 0185 was saved, the function module throws me back to infotype 0000, citing, "No authorization to maintain XYZ exists". Data that I had populated to the screen, either via the FM or by manual input were cleared. If I skip the next 4 screens, I'll arrive at the Infotype after XYZ, with the data populated. Subsequent infotypes also have their data filled in.
Once I complete the sequence, the personnel record will be created. Upon examination, the frist 4 screens that were skipped in the 2nd pass contains data that were entered in the 1st pass.
My question, as posted in the original post, is why infotype XYZ is triggered by the function module, as the staffing account does not hae access for it. If I repeat the process using PA40, the infotype is skipped accordingly.
Any help would be appreciated.
Thank you,
James Wong, -
HR_MAINTAIN_MASTERDATA leaving lingering locks on a personnel number
Has anybody who has used HR_MAINTAIN_MASTERDATA before noticed a locking problem?
(Actually, I have read other messages posted that identify the same issue but I have not seen a solution posted.)
To summarize, I have an interface that hires EE's using HR_MAINTAIN_MASTERDATA and I place a lock on the personnel # before hand with HR_EMPLOYEE_ENQUEUE. After the call to HR_EMPLOYEE_DEQUEUE the lock still exists. This is causing an major issue when doing mass hires as the lock entry table reaches its maximum limit.
The other way that I've tried to fix this problem is to use the parameter "no_enqueue = space" and allow the HR_MAINTAIN_MASTERDATA to do the locking itself but the same problem exists. The function module creates the lock internally and it is not deleted after the call and it cannot be delete using HR_EMPLOYEE_DEQUEUE.
Thanks in advance for any help.
Cheers,-tomShane,
You can see the lock entries by using transaction SM12. If your program outputs some messages to the list screen you can rum SM12 in another session while you are still sitting on the list screen. You should see all the EE #'s you updated listed there.
Cheers,-tom -
Hr_maintain_masterdata showing an infotype that the user does not have auth
subject: hr_maintain_masterdata showing an infotype that the user does not have authorisation for
Hi all,
I've a user account that's meant to perform staffing, based on the actual HR role. The system is also set up with an infogroup that contains infotypes 0000, 0001, 0006, 0185, XYZ and other infotypes; XYZ representing an actual infotype. The HR role is not supposed to have this infotype XYZ.
When PA40 is used, infotype XYZ will be skipped, as the user account do not have authorisation for it. I could then proceed to create the record.
When the fm: hr_maintain_masterdata is used, I was prompted that I do not have authorisation for infotype XYZ.
I have setup my fm with the mininum amount of values, as indicated below.
I did not populate a table for "proposed_values" so the infotypes called were due to the actions of the infogroup.
fm: hr_maintain_masterdata
pernr = 01234567
massn = 01 (new staff)
actio = INS (insert record)
tclas = A (master record)
begda = 01.09.2010
endda = 31.12.9999
werks = myCompanyPlant
dialog_mode = 2 (online)
luw_mode = 1 (commit, if no errors encountered)
no_existance_check = X
Q. Is there any way to let the function module call the infotypes, with authorisation checks, as what PA40 is doing?
Your guidance would be appreciated.
Thank you,
James WongA behaviour that has been observed was that, after infotype 0185 was saved, the function module throws me back to infotype 0000, citing, "No authorization to maintain XYZ exists". Data that I had populated to the screen, either via the FM or by manual input were cleared. If I skip the next 4 screens, I'll arrive at the Infotype after XYZ, with the data populated. Subsequent infotypes also have their data filled in.
Once I complete the sequence, the personnel record will be created. Upon examination, the frist 4 screens that were skipped in the 2nd pass contains data that were entered in the 1st pass.
My question, as posted in the original post, is why infotype XYZ is triggered by the function module, as the staffing account does not hae access for it. If I repeat the process using PA40, the infotype is skipped accordingly.
Any help would be appreciated.
Thank you,
James Wong, -
HR_MAINTAIN_MASTERDATA - Missing Action Reason (MASSG)
Hi Developers,
I have a bit of an issue. I'm trying to create a new employee using FM HR_MAINTAIN_MASTERDATA. Unfortunately, when I call the FM and enter the below listed imports, I receive the following error
IMPORTS:
PERNR ==> 00000000
MASSN ==> Z1
ACTIO ==> INS
TCLAS ==> A
BEGDA ==> 13.06.2008
ENDDA ==> 31.12.9999
OBJPS ==> Z8
SEQNR ==> 000
SPRPS
SUBTY
WERKS ==> 0001
PERSG ==> 1
PERSK ==> HH
PLANS ==> 99999999
DIALOG_MODE ==> 0
LUW_MODE ==> 1
NO_EXISTENCE_CHECK
NO_ENQUEUE
Export parameters Value
ERROR
RETURN EPG316Invalid combination of action type Z1/action reason
RETURN1 EPG 316Invalid combination of action type Z1/action reason
HR_RETURN 00000000A0000Z1 INS 00PG E316Z1
I'm confused by this because there is no where in the function module where it asks you to enter the Action Reason. When I switch dialog_mode on I am brought to the create actions screen where all of my data has been read in. The only blank field is Action Reason. When I put it in, it creates the Employee and the Number is provided. We need this number to utilize the FM HR_INFOTYPE_OPERATION to continue the process of creating a new Employee (in this case, Contractor).
Question 1: Can/does HR_MAINTAIN_MASTERDATA pass the MASSG paramater?
Question 2: If not, how hard would it be to create a custom HR_MAINTAIN_MASTERDATA to pass the value of MASSG?
Will reward points accordingly. Thanks in advance for your help.Hi Suresh,
Thank you for your fast response. I actually figured that out after doing some more research. It turns out that when i had initially tried to use it before I wasn't referencing the screen field value with the prefix (i.e P000-MASSG). It works fine now, and I will reward points accordingly as I said.
My new dilemma is, now that the FM is working, how do we enable the function Module in a Web Dynpro for ABAP application. I'm not sure how to pass the fields into the Node and Attributes that are generated from the service call to the function modules. In other words, how do we specificy all of the infotypes, fnames, fvalues and seq nos so that the pernr number is returned. We need this number in order to utilize the FM HR_INFOTYPE_OPERATION. -
Employee hire via HR_MAINTAIN_MASTERDATA
Hi,
I am trying to create employee via FM using HR_MAINTAIN_MASTERDATA, unfortunately I am facing some issues when I am creating IT0001(Organizational Assignment) , I get an error stating that IT0003 is not creating for the given ID. What i would like to know is if there is a way to create IT0003 via a FM, since it does not seem to work with HR_MAINTAIN_MASTERDATA.
Regards,
Leandro FonsecaHI,
Refer to the link.
How to hire new employee (BAPI, BDC, IDoc/ALE...???)
This might help.
Regards
Sumit Agarwal -
HR_MAINTAIN_MASTERDATA writes inconsistent data to DB
Dear experts,
I'm filling IT0000 with actions coming from an interface (using HR_MAINTAIN_MASTERDATA, Infogroup always contains 0000 and 0001 only; additional actions are 'ON' ). Changes from the interface can be of all different kinds, i.e. deletion of entries from the past, changing begin and end dates dates (even entry/leaving dates), employee groups, personnel areas etc. So in some cases, e.g. when a termination has already been entered and and an action should be inserted before, I have to destroy the history down to the record where the change was entered.
As I do not want to leave the action history in an inconsistent state in case I cannot enter the new/changed action, I call HR_MAINTAIN_MASTERDATA with luw_mode = 0 and commit only if no error was returned for all preceeding operations.
Now it seems as if the FM has got a buffer problem here. If I just delete an old termination action and enter a new one (via COP) everthing's fine. But when I delete the termination action and previous actions to enter a new action at a certain point and re-enter the old actions, the FM fails and forgets to enter the action in PA0000, but enters it in PA0302 (all actions are configured to be stored in PA0000 and PA0302). This leads to an inconsistent state. The effect does not show if I add a COMMIT after deleting (parts of) the history.
Do you have any ideas or explanations? Is it a known issue?
Thanks in advance..
DanielHI All,
But I would like to create entries only for the new employee and not for the entire data till date. I tried to run that report but it took the entire data. So how to run that thing for the currently created employee only. Please help.....
Thanks,
Shailesh S. Malkar.
Edited by: Shailesh Malkar on Mar 2, 2012 10:04 AM -
Hi All,
I'm going to need to use the fm hr_maintain_masterdata to create a new employee. I've done up a test program just to get it working before i begin. When i run the code below i keep getting the error 'Personnel number has not yet been assigned'. Can anyone tell me what i'm doing wrong? Or can anyone tell me where i can find info on how to use this FM.
data: t_prop_vals type table of pprop,
modified_keys type table of pskey,
return type bapireturn,
return1 type BAPIRET1.
data: wa_prop_vals type pprop.
move '0000' to wa_prop_vals-infty.
move 'massn' to wa_prop_vals-fname.
move 'A1' to wa_prop_vals-fval.
append wa_prop_vals to t_prop_vals.
move '0000' to wa_prop_vals-infty.
move 'massg' to wa_prop_vals-fname.
move '01' to wa_prop_vals-fval.
append wa_prop_vals to t_prop_vals.
move '0001' to wa_prop_vals-infty.
move 'werks' to wa_prop_vals-fname.
move '1101' to wa_prop_vals-fval.
append wa_prop_vals to t_prop_vals.
move '0001' to wa_prop_vals-infty.
move 'persg' to wa_prop_vals-fname.
move 'F' to wa_prop_vals-fval.
append wa_prop_vals to t_prop_vals.
move '0001' to wa_prop_vals-infty.
move 'persk' to wa_prop_vals-fname.
move '01' to wa_prop_vals-fval.
append wa_prop_vals to t_prop_vals.
call function 'HR_MAINTAIN_MASTERDATA'
exporting
pernr = '02000511'
MASSN = 'A1'
actio = 'INS'
tclas = 'A'
begda = '20081204'
endda = '99991231'
importing
return = return
return1 = return1
tables
proposed_values = t_prop_vals
modified_keys = modified_keys
exceptions
others = 1.
if not return1 is initial.
write: return1-number.
write: return1-message.
else.
message s054(hrwpc_pcr).
endif.
Many Thanks,
Liz.Hey,
Thanks for the response to you too. Can you explain a little more what you mean by ' it is interfearing with number ranges'. I've checked the documentation on se37 and didn't find it much help to be honest.
Regards,
Liz.
Maybe you are looking for
-
Cannot sign in to Skype on Desktop after upgrade - cannot fill in user id and password boxes
My Skype forced me to upgrade right before a phone call today (7/12/2015) (why can't you let me go about my business first and upgrade later?). After the upgrade, Skype failed to aunch, and I received the blank screen at login. I terminated the proce
-
You've Been Signed Out Error - Can't login to Desktop App
I cannot sign in to my CC desktop app, so I can't sink with typekit or update any of the applications. Every time I enter my credentials, I get a screen that says you've been signed out, see below. I attempted to delete the opm.db file, no change. I
-
Master data loading - Dimension Property value incorrect
Hi, I have a dimension in BPC which has an attribute amount. When am trying to load the master data from BW, the number is truncated and displayed with a * if the number has more than 6 digits. If this is a problem with the delimited - comma - then i
-
KI235 Error Message During F110 Payment Run.
Dear Gurus, When we run transaction automatic payments F110, we get the message that our gain / loss in exchange rate account requires assignment to CO object. Error message "KI235". I did search on google and all forums, but am unable to find an ans
-
Getting program name by process id
Hi, I need to get the name of the program running a session using as parameter the process id, what views do I have to join to get this information. I've tried to use SELECT * FROM V$SESSION WHERE PROCESS = '10574' but it doesn't work. Thanks.