‎2008 Jan 14 7:03 AM
Hi
Can i have a bapi which replaces the existing Position ID with the recent position in HR Module.
If an employee changed from one designation to another designation in the same organisation then his position id will also be changes so generally we will goto some tcodes related to this change of position id and we will try to make modifications. But i want a bapi or any FM with which we can directly update or insert or replace the existing ID with the new one
Regards
Krishna
‎2008 Jan 14 7:11 AM
Hi Krishna
You can use the FM "RH_INSERT_INFTY_1001_EXT" for thsi purpose. Pass the FCODE as 'INS', and to the INNNN structore populate as below
PLVAR = '01'
OTYPE = 'P'
OBJID = <Employee number to be assigned>
INFTY = '1001'
RSIGN = 'A'
RELAT = '008'
SCLAS = 'S'
SOBID = <New Position to be assigned>.
Hope this helps !
~ Ranganath
‎2008 Jan 14 7:11 AM
Hi Krishna
You can use the FM "RH_INSERT_INFTY_1001_EXT" for thsi purpose. Pass the FCODE as 'INS', and to the INNNN structore populate as below
PLVAR = '01'
OTYPE = 'P'
OBJID = <Employee number to be assigned>
INFTY = '1001'
RSIGN = 'A'
RELAT = '008'
SCLAS = 'S'
SOBID = <New Position to be assigned>.
Hope this helps !
~ Ranganath
‎2008 Jan 14 7:31 AM
Hi Ramesh
I followed your procedure. It was asking to insert the input parameter for Vtask
then i had inserted 'X' at one time and 'I' at another time but i got the same error as
Exception ERROR_DURING_INSERT
Regards
Krishna
‎2008 Jan 14 7:33 AM
Please also pass Begda and ENdda with validity intervals of the record you want to create. And VTASK pass 'D'.
~ Ranganath
‎2008 Jan 14 7:41 AM
‎2008 Jan 14 7:44 AM
‎2008 Jan 14 8:06 AM
Hi
Now i got the bapi executed when i put B but the problem is it was not replacing the existing ID
MANDT 100
PLVAR 01
OTYPE P
OBJID 50000525
INFTY 1001
RSIGN B
RELAT 008
ISTAT
PRIOX
BEGDA 14.01.2008
ENDDA 14.01.2008
VARYF
SEQNR 000
AEDTM
UNAME
REASN
HISTO
ITXNR 00000000
SCLASS S
SOBJID 50000526
PROZT 0.00
ADATA
‎2008 Jan 14 8:34 AM
Hi Krishna
Use the FM "RH_DELETE_INFTY_1001_EXT" by passing the existing record that you have in your DB. ie. in table HRP1001.
Then call your FM for insert. That should solve the problem.
~ Ranganath
‎2008 Jan 14 8:56 AM
Hi Ramesh
Cant we do all the process in a single FM or Bapi
Regards
Krishna
‎2008 Jan 14 8:58 AM
Hi Krishna
This is not possible coz the relationship we are trying to maintain is of Time constraint 3, unlike others i.e. TC 1 and TC2, where on creating a new one the previous one will be de-limited.
Cheers
~ Ranganath
‎2008 Jan 14 9:09 AM
ok fine then can we use update instead of insert in the above function module??
‎2008 Jan 14 9:18 AM
Hi Krishna
You cannot use Modify because the data stored in case of Org. structure is different compared to other conventional SAP tables.
We have to maintain the historical data, that's why SAP does not give the option of modifying the tables. You can get more help if you read the OM part of SAP HR. Mainly issue is related to inverse relationship being maintained.
~ Ranganath
‎2008 Jan 14 9:20 AM
OK fine thank you and one more thing for delete what are the parameteres we have to pass???
‎2008 Jan 14 9:23 AM
Hi Krishna
Get the records from HRP1001 for the existing relationship. And pass the same record to the delete FM, and FCODE as 'DEL'.
~ Ranganath
‎2008 Jan 14 9:30 AM
Hi
If i pass DEL in Fcode then it was showing an exception error as ERROR_DURING_INSERT
My doubt is in the same way as insert and delete can we have a option for update??
If it is in case of insert also it was not inserting the new position id with original id what might be the problem?? if i give
INS as u said ealier then i'm able to check the FM correctly but it was not inserting the new data into that
Regards
Krishna
‎2008 Jan 14 9:38 AM
Hi Krishna
I don't think it is possible to update. May be you can take a look more in detail. But sorry for the confusion, we need not have to pass 'DEL' Fcode to RH_DELETE_INFTY_1001_EXT, this by default deletes the record.
Hope all this info helps !
~ Ranganath
‎2008 Jan 14 9:50 AM
Hi Ramesh
All your inputs are very very valuable for me but can u clear me one doubt plz.
we are using the FM RH_INSERT_INFTY_1001_EXT
to insert but it was not insewrting with new id what we can do know??
Regards
Krishna
‎2008 Jan 14 9:56 AM
Hi Krishna
Hopefully that ID is created in table HRP1000. Then only we can have the relationship created with the mentioned FM. Else i don't see any other problems to create this relationship.
~ Ranganath
‎2008 Jan 14 9:59 AM
Ya it is in the same table. But even though the insert option is not working for it. Plz ramesh help me in this issue
‎2008 Jan 14 10:03 AM
Please check and confirm these options once again,
MANDT 100
PLVAR 01
OTYPE P
OBJID 50000525 " Personnel number
INFTY 1001
RSIGN B
RELAT 008
ISTAT
PRIOX
BEGDA 14.01.2008
ENDDA 14.01.2008
VARYF
SEQNR 000
AEDTM
UNAME
REASN
HISTO
ITXNR 00000000
SCLASS S
SOBJID 50000526 " New position ID to be created
PROZT 0.00
ADATA
FCODE = 'INS' and VTASK = 'D'.
~ Ranganath