04-02-2006 5:37 AM
Hi All,
Is there a function module that I can use to delimit a postion assignment for an employee?
I am trying to end the assignment of an employee to a position on a certain date through a function call.
I would really appreciate any help.
Thanks,
~Mark
04-02-2006 9:51 AM
I think I havent understood the issue.
Regards
Vick
Message was edited by: vick vennav
Message was edited by: vick vennav
04-02-2006 12:16 PM
What Mark likes to know is a function to edit in the organizational model where a position (type S) is occupied by a person/user-id (link type A003).
Mark, I do not no of a function module and I wouldn't recommend to do the appropriate table entries by yourself. Maybe you should have a look at the <b>transaction PP01</b>. With that one you can pick a single position and edit the dependencies. Maybe this one is batch-inputable or you run a trace to find out for a function module.
Best wishes,
Florin
04-02-2006 3:16 PM
Thanks for your replies.
Florin I think the link type is A008 which is the holder relationship of the position.
What I am trying to achieve is to transfer one employee from one position to another. I can assign the employee to a new position by using the function Module RH_RELATION_MAINTAIN using FCODE = INSE.
However, the employee remains assigned to the old position as well and I cannot delimit it with any function modules that I know.
Thanks,
~Mark
04-02-2006 4:39 PM
I unable to comprehend some things over here that why you u r not using hr_infoype_operation to change the position but other infotypes would get affected, when you create a new record for infotype 1 with new position the old record would get delimited because usually it is set to time constraint 1, but when you change the position we need to take care of infotype 8 too.Any comments on this would be appreciated.
Regards
vick
04-02-2006 5:57 PM
Hi Vick,
Thanks for your reply. All I am trying to achieve is to transfer an employee from one position to another. The issue is that when I assign the ee to a new position he is still assigned to the old position and I am trying to figure a way out how to delimit the old position for this ee with a function call.
Any help would be appreciated.
~Mark
P.S. I am pretty new to SAP and ABAP programming.
04-03-2006 4:15 AM
Isn't there any BAPI or function module available to delimit a A008 relationship?
There has to be a way to achieve this.
Please help!
~Mark
04-03-2006 8:26 PM
Hi,
This is the sample code posted by suresh datti some time back in this forum follow this procedure, it might help u,create a new record for infotype 1 and populate all the neccessary fields (use hrp tables to get the pay scale groups and levels ).
tables:
pernr.
infotypes:0021,0106.
data: rec_p0021 type p0021,
rec_q0106 type q0106,
rec_p0106 type p0106.
data w_return type bapireturn1.
start-of-selection.
get pernr.
read table p0106 index 1.
rec_p0106 = p0106.
rec_p0106-stras = '2235 Burns Rd'.
read table p0021 index 1.
rec_p0021 = p0021.
rec_p0021-favor = 'test-639111'.
Enqueue personnel number
call function 'BAPI_EMPLOYEE_ENQUEUE'
exporting
number = pernr-pernr
importing
return = w_return.
call function 'HR_INFOTYPE_OPERATION'
exporting
infty = '0021'
number = pernr-pernr
subtype = '2'
record = rec_p0021
validityend = P0021-ENDDA
validitybegin = P0021-BEGDA
operation = 'MOD'
dialog_mode = '2'
view_identifier = '07'
secondary_record = rec_p0106
importing
return = w_return.
call function 'BAPI_EMPLOYEE_DEQUEUE'
exporting
number = pernr-pernr
importing
return = w_return.
end-of-selection.
Regards
Vick
04-03-2006 8:51 PM
Check out the post :
can use the FM " RH_CUT_INFTY" to delimit the PD infotypes.
Therere few SAP Standard programs to "delimits" the records,
RPU204M0 IT 204: delimit report for FA customers
RPU510J1 Utility program to delimit P0008 after pay scale re-creation
H99CWTR0
Wage Type Reporter. Returns pay for particular wage types. To submit from new report you will need to create copy and export value to memory.
RHGRENZ0
Delimit IT1000 and related 1001s. Program will delete any 1001 infotypes whose start date is after the delimit date.
RHGRENZ1
Extend the end date on delimited records. Very useful when you delimit a bunch of records incorrectly, and need to change the end date.
RHGRENZ2
Delimit infotypes (IT1001)
RPCMPYG0
Statutory Maternity Pay(SMP)
RPCSSPG0_HIST
Statutory Sickness History(SSP)
RPDTRA00
List all HR transactions and there uses
RPTPSH10
Personal work schedule, also accessed via PA20/PA30 infotype 2001
RPUAUD00
HR Report to list all logged changes in infotype data for an employee. Uses the PCL4 Audit Cluster.
RPUAUDDL
HR Report to delete audit data from the PCL4 Audit Cluster
RPUDELPN
Delete all info for an employee number, including cluster data and infotypes
RPUP1D00
View/Delete records from PCL1 Cluster
RPUP2D00
View/Delete records from PCL2 Cluster
RPUP3D00
View/Delete records from PCL3 Cluster
RPUP4D00
View/Delete records from PCL4 Cluster
I hope this`ll help you
Thanks
Message was edited by: Saquib Khan
04-04-2006 7:15 AM
Thanks Saquib and Vick.
I will try out your suggestions.
Can I use RH_CUT_INFTY to delimit a position assignment to a specific perner?
Do you have any sample code for that?
Regards,
~Mark
04-04-2006 8:48 PM
I havent use this FM .. But you can see the <b><u>program : MPHPAI00</u></b>
call function 'RH_CUT_INFTY'
exporting
load = def_load_yes
gdate = <endda>
histo = pphdr-histo
vtask = def_vtask_space
commit_flg = def_commit_flg_no
authy = def_authy_no
pppar_imp = pppar
tables
innnn = pplog_tab
exceptions
error_during_cut = 01
no_authorization = 02
gdate_before_begda = 03
cut_of_timco_one = 04.
Good luck !!
01-19-2007 1:37 PM
Hi, mark. This is how I solved this problem:
Cuting the curent position **********************
APPEND pw_hrp1001 TO lt_hrp1001.
CALL FUNCTION 'RH_CUT_INFTY_1001_EXT'
EXPORTING
gdate = l_cut_date
histo = 'H'
vtask = 'S'
TABLES
innnn = lt_hrp1001
EXCEPTIONS
error_during_cut = 1
no_authorization = 2
gdate_before_begda = 3
cut_of_timco_one = 4
relation_not_reversible = 5
corr_exit = 6
OTHERS = 7.
Assigning new position *******************************
CALL FUNCTION 'RH_RELATION_MAINTAIN'
EXPORTING
act_fcode = 'INSE'
act_plvar = '01'
act_otype = 'P'
act_objid = l_employee
act_rsign = 'B'
act_relat = '008'
act_sclas = 'S'
act_sobid = p_personal-id_position
act_begda = lbegda
act_endda = lendda
ACT_PRIOX =
act_prozt = 100
ACT_ADATA =
EXCEPTIONS
maintainance_failed = 1
OTHERS = 2
.
For me this worked excelent. Beware: the parameter lt_hrp1001 has to contain all the data of the reccord you are trying to delimit.
Good luck!