Quantcast
Channel: SCN : All Content - ABAP Development
Viewing all articles
Browse latest Browse all 8332

Error in HCM organization unit update via class method

$
0
0

Hello!

 

I am doing customer WebDynpro ABAP development with SAP HCM. Basically I am developing WDA program
that creates new HR employees to SAP HCM.

 

I have a problem with SAP HR organization's position - employee assigment when creating employee,
that has limited validity with organization assigment.

 

Basically I want to create person that has most of HR infotypes with validity period that ends
at date 31.12.9999. Only infotype 1 (organization assigment) validity period is needed to be ended
with other date than 31.12.9999 (with actual organization's position). The rest of validity period
should be assigned to position 99999999 (= user is no more assigned to actual position, 99999999 is default position).

 

So result in infotype 1 should be like this:

 

Validity start  Validity end  Position
8.8.2013        12.8.2013     50000114
13.8.2013       31.12.9999    99999999

 

I'm using function HR_PAD_HIRE_EMPLOYEE to create new employee with validty period that ends at 31.12.9999.
After that I use class CL_HRPA_MASTERDATA_FACTORY with interface IF_HRPA_PLAIN_INFOTYPE_ACCESS by INSERT method to make new entry to infotype 1 data with position 99999999. (I can't do that in HR_PAD_HIRE_EMPLOYEE function, because I need only it 1 with different validity periods than rest ones - if I try to limit only it 1 validty period in function, it gives me an error that says that there must be no gaps in it data.)

 

My solution is working fine (at infotype 1: infotype is delimited correctly when creating new it entry), but actual lines in organization assigment table (HRP1001) goes now like this:


P 150139   01 B 008 1  08.08.2013 12.08.2013 S 50000114  1001 P 00150139 B008 07.08.2013 SAVIAHDE_T    S 50000114
P 150139   01 B 008 1  13.08.2013 31.12.9999 S 50000114  1001 P 00150139 B008 07.08.2013 SAVIAHDE_T    S 50000114
S 50000114 01 A 008 1  08.08.2013 12.08.2013 P 00150139  1001 S 50000114 A008 07.08.2013 SAVIAHDE_T    P 00150139
S 50000114 01 A 008 1  13.08.2013 31.12.9999 P 00150139  1001 S 50000114 A008 07.08.2013 SAVIAHDE_T    P 00150139

 

So basically there is now 4 lines created. It should be only 2 lines like this:


P 150139   01 B 008 1  08.08.2013 12.08.2013 S 50000114  1001 P 00150139 B008 07.08.2013 SAVIAHDE_T    S 50000114
S 50000114 01 A 008 1  08.08.2013 12.08.2013 P 00150139  1001 S 50000114 A008 07.08.2013 SAVIAHDE_T    P 00150139

 

Those 4 lines in HRP1001 table results situation that employee has 2 position - person assigments in HR organization.
Both assigments are starting date 8.8.2013 without ending date.

 

So basically class' methods creates (delimites existing it entry and creates one new it entry) infotype 1 correctly, but HRP1001 table is not updated correctly via class CL_HRPA_MASTERDATA_FACTORY with interface IF_HRPA_PLAIN_INFOTYPE_ACCESS via INSERT method.

 

If we do new employee creation in SAP GUI using transaction PA40, the organization assigments in HRP1001 are assigned correctly.

I found notes

Note 1667139 - IT0001: Previous record assigned to default position
Note 1674514 - IT0001: Previous record assigned to default position [2]

Note 1864520 - IT0001: Error message "S 00000000 does not exist"


, but they are not exactly valid to my situation. And in other hand our system have them installed.

 

I think that I found the class method where this position update goes somehow wrong: Infotype 1 is updated by using class CL_HRPA_INFTY_0001
and position determination is handled at method INTEGRATION_PA_OM that uses FILL_POSITION_TAB method. Method FILL_POSITION_TAB receives information about new position (99999999) via IT data (P0001-PLANS). When new position (99999999) is same as default position in attribute a_defplans and without organization, method valuates position table correctly - in my case like this:

 

OTYPE OBJID    BEGDA    ENDDA    PROZT  OPERA
S     50000114 20130808 99991231 0.00   DEL
S     50000114 20130808 20130812 0.00   INSO
S     99999999 20130813 99991231 100.00 INSN

 

But when execution comes to method UPDATE_RELATIONSHIPS (in class CL_HRPA_INFTY_0001) something goes wrong and the
line that contains default position (99999999) is not handled correcty. I'm not sure, but it seems like lines with value 'INSN' in table's OPERA column is not handled at all and therefore the organization entry is updated wrongly.

 

So is there something wrong with class method that needs to be fidex?

 

-Timo


Viewing all articles
Browse latest Browse all 8332

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>