Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

bapi to replace existing position ID

Former Member
0 Likes
2,164

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

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
2,022

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

19 REPLIES 19
Read only

Former Member
0 Likes
2,023

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

Read only

0 Likes
2,022

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

Read only

0 Likes
2,022

Please also pass Begda and ENdda with validity intervals of the record you want to create. And VTASK pass 'D'.

~ Ranganath

Read only

0 Likes
2,022

Hi

the same error is coming

Regards

Krishna

Read only

0 Likes
2,022

Try withbthis value,

RSIGN = 'B'

~ Ranganath

Read only

0 Likes
2,022

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

Read only

0 Likes
2,022

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

Read only

0 Likes
2,022

Hi Ramesh

Cant we do all the process in a single FM or Bapi

Regards

Krishna

Read only

0 Likes
2,022

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

Read only

0 Likes
2,022

ok fine then can we use update instead of insert in the above function module??

Read only

0 Likes
2,022

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

Read only

0 Likes
2,022

OK fine thank you and one more thing for delete what are the parameteres we have to pass???

Read only

0 Likes
2,022

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

Read only

0 Likes
2,022

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

Read only

0 Likes
2,022

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

Read only

0 Likes
2,022

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

Read only

0 Likes
2,022

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

Read only

0 Likes
2,022

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

Read only

0 Likes
2,022

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