cancel
Showing results for 
Search instead for 
Did you mean: 

HR_INFOTYPE_OPERATION.

Former Member
0 Kudos
186

Hi.... ,

Well i am stucked with a problem regarding updation of pa0002 .

I have browsed through threads and developed a zprog . for updating

pa0002,however i am not able to update all records of a particular pernr i.e

if there are 5 records my prog is updating only 3 of them . For some pernrs it is not even updating single record.

I am not getting what is the condition that F.M is checking for?

Here is my code:

&----


*& Report ZTEST_14

*&

&----


*&

*&

&----


REPORT ZTEST_14.

infotypes : 0002.

tables :pernr.

  • return structure

data: rec_return type bapiret1. "return code

start-of-selection.

get pernr.

*rp-provide-from-last P0002 space SY-DATUM SY-DATUM.

provide * from p0002 between pn-begda and pn-endda.

p0002-nachn = 'test'.

call function 'BAPI_EMPLOYEE_ENQUEUE

exporting

number = p0002-pernr

importing

return = rec_return.

call function 'HR_INFOTYPE_OPERATION'

exporting

infty = '0002'

number = p0002-pernr

subtype = p0002-subty

objectid = p0002-objps

recordnumber = p0002-seqnr

validityend = p0002-endda

validitybegin = p0002-begda

record = p0002

operation = 'MOD'

*tclas = ''

lockindicator = p0002-sprps

*nocommit = ''

importing

return = rec_return.

call function 'BAPI_EMPLOYEE_DEQUEUE'

exporting

number = p0002-pernr

importing

return = rec_return.

endprovide.

end-of-selection.

Reply Pls.

John

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi John

The FM checks for the data record in PA0002.

I think the problem lies in PRovide and End Provide.

If U see in Debugging U can see that the begda and endda in P0002 get changed to pn-begda and pn-endda after getting into loop Provide and EndProvide.

That's why the FM doesnot upload data.(U can chk the Return value in debugger).

Example:-Lets say U have 3 records for P0002 having

BEGDA ENDDA

01.04.2006 30.04.2006

01.05.2006 31.05.2006

01.06.2006 31.12.9999

pn-begda = 01.04.2006 and pn-endda = 31.12.9999.

When Ur Provide and End Provide Starts the records will be converted to

BEGDA ENDDA

01.04.2006 31.12.9999

01.04.2006 31.12.9999

01.04.2006 31.12.9999

And this begda and endda will be passed to FM and FM will not find any such kind of dates from PA0002 and will not update.

Instead of using Pro and End Pro User Loop and Endloop.

Hope this clears U.

~ BiSu

Former Member
0 Kudos

hmmm... well i have debugged my code and dates that are getting passed to F.M are the same as in the table Pa0002. Here you can see whats happening :

Following data is for pernr :00000001

ENDDA BEGDA seqnr AEDTM UNAME NACHN

04/08/1983 01/04/1981 000 10/03/2006 abc das

08/08/1999 04/09/1983 000 10/05/2006 abc mandal

10/11/2006 08/09/1999 000 11/27/2006 JOHN test

10/22/2006 10/12/2006 000 11/27/2006 JOHN test

12/31/9999 10/23/2006 000 11/27/2006 JOHN test

So, only last 3 records are getting updated . I have checked dates it is taking from Pa0002 only. One more thing i forgot to tell when it is updating a record it ask for a workbench request , if i click on display button on pop-up a information message ' Save link canceled in Organizational Management' comes .if in place of display i click on OK button i get run time error ' Invalid COMMIT WORK in a COMMIT WORK or ROLLBACK WORK.'. After this changes take place in table.

i am not getting these things... hopefully u guys are getting it...

pls help John.

John.

Message was edited by:

john d'souza

Message was edited by:

john d'souza

Former Member
0 Kudos

Hi John,

What is ur pn-begda & pn-endda dates?

Since these two record dates(BEGDA & ENDDA) must not satisfying the pn-begda & ennda since ur using provide statement.

04/08/1983 01/04/1981 000 10/03/2006 abc das

08/08/1999 04/09/1983 000 10/05/2006 abc mandal

if you want to update all records of IT0002, then use Loop-endllop statement.

Hope this helps,

Thanks,

Sarika.

Former Member
0 Kudos

Hi John

What I can think is the PNP-BEGDA and PNP-ENDDA is not okay.

And as U were saying that System is asking for Transport request U can disable that by going to view V_T77S0SC by SM30 and put 'X' for

TRSP CORR.

And I wud still suggest to use Loop and Endloop as I had before to get ur problem solved.

~BiSu

Former Member
0 Kudos

Hi Sarika...

Well, my pnp-begda and pnp-endda are empty i am not entering any value, i have selected 'other period' radio button.

i am using loop endloop now, and one more thing i have debugged my code , F.M is geeting table dates only.

i think problem is becuse of some other dependancy. ;-(

John...;-)

suresh_datti
Active Contributor
0 Kudos

Pl verify if you can change those records directly in PA30.. could be the Payroll Control record issue..you are probably going farther back than the allowed date for master data changes..

~Suresh

Former Member
0 Kudos

hi suresh...

Well I have changed my function module to "hr_maintain_masterdata",

Its working now. Pls let me know whats diff between these 2 modules ?

do both of these perform same functionality?

suresh_datti
Active Contributor
0 Kudos

the issue lies somehwere.. HR_MAINTAIN_MASTERDATA can be used to update more than one infotype in the same call.. but for a couple of parameters there is absolutely no change in the functionality. In fact HR_INFOTYPE_OPERATION gets called inside HR_MAINTAIN_MASTERDATA ..

~Suresh

Answers (2)

Answers (2)

Former Member
0 Kudos

Thanks for your Replies... problem is not 100% solved but its is solved to a good extent

:-)I have awarded you guys your lucky points.

JOHN D'souza

Former Member
0 Kudos

Hi John,

Check the begda & endda dates for the employees where data is not updating.

I am sure, it must be some data issue, as for other employees it is updating.

Check the dates or in debug mode check what data FM gets.

or let me know what error FM is giving out.

Hope this helps.

Thanks,

Sarika.