Application Development 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: 

Infotype PA0015 and ASSOB, ASSHR

Former Member
0 Kudos

hi all,

I have to create entries in Infotype PA0015 via a flat file corresponding to particular WageTypes for a particular PERNR. But the flat file also contains a field Cost Center or Order.

My question is "Do I have to update any other table(like ASSOB/ASSHR) or infotype for linking this cost object to the Personnel No. or just Updating PA0015 is fine?"

What exactly is the use of tables ASSOB and ASSHR.

Preeti

1 ACCEPTED SOLUTION

Former Member
0 Kudos

I think, Cost Center is not necessarily to be updated ..

You may leave this field as it is.. ask ur functional person if it is needed...

You can not maintain, infotype 0001 for Cost Center... either you have to run some action for it.. It may be in the file just for the reference...

Just maintain infotype 0015 with the given fields in the file... if only this infotype is to be maintained.

Regards

Prax

5 REPLIES 5

Former Member
0 Kudos

Hi preeti,

1. I don't think infotype 0015 (table = PA0015)

contains field like cost center or order.

2. so no other table is required to be updated.

3. For updating pa0015, do not update the table directly.

(its not recommended by sap)

4. U can use the fm HR_INFOTYPE_OPERATION.

5. sample code (just copy paste)

U can change the pernr and amount values as per requirement.

6.

Report abc.

*----


Data

DATA : P0015 LIKE P0015.

DATA : RETURN LIKE BAPIRETURN1.

DATA : KEY LIKE BAPIPAKEY.

DATA : RETURNE LIKE BAPIRETURN1 .

*----


Values (Change as per Requirement)

P0015-PERNR = '1'.

P0015-BEGDA = '2061101'.

P0015-ENDDA = '2061101'.

P0015-LGART = '3075'.

P0015-PREAS = '01'.

P0015-WAERS = 'INR'.

P0015-BETRG = '2500'.

*----- First Enqu

CALL FUNCTION 'BAPI_EMPLOYEE_ENQUEUE'

EXPORTING

NUMBER = p0015-pernr

IMPORTING

RETURN = RETURNE.

*----


Update

CALL FUNCTION 'HR_INFOTYPE_OPERATION'

EXPORTING

INFTY = '0015'

NUMBER = P0015-PERNR

SUBTYPE = P0015-SUBTY

OBJECTID = P0015-OBJPS

LOCKINDICATOR = P0015-SPRPS

VALIDITYEND = P0015-ENDDA

VALIDITYBEGIN = P0015-BEGDA

RECORDNUMBER = P0015-SEQNR

RECORD = P0015

OPERATION = 'INS'

TCLAS = 'A'

DIALOG_MODE = '0'

IMPORTING

RETURN = RETURN

KEY = KEY.

IF RETURN IS NOT INITIAL.

WRITE 😕 'Error Occurred'.

ENDIF.

*----


Dequeue

CALL FUNCTION 'BAPI_EMPLOYEE_DEQUEUE'

EXPORTING

NUMBER = P0015-PERNR

.

regards,

amit m.

0 Kudos

hi amit,

Thnx for the reply.

ur answer is what i am already doing.

But then what to do with Cost Object field in the flat file?

0 Kudos

hi amit,

also,

please tell me the significance of tables ASSOB and ASSHR.

0 Kudos

Hi again,

1. I am not able to understand why is there the field for cost center

in the flat file.

2. Its not at all required for infotype 0015.

3. May be there is some confusion or the functional consultant can provide

some help.

regards,

amit m.

Former Member
0 Kudos

I think, Cost Center is not necessarily to be updated ..

You may leave this field as it is.. ask ur functional person if it is needed...

You can not maintain, infotype 0001 for Cost Center... either you have to run some action for it.. It may be in the file just for the reference...

Just maintain infotype 0015 with the given fields in the file... if only this infotype is to be maintained.

Regards

Prax