on 2006 Nov 27 6:57 AM
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
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
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.
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
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...;-)
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
105 | |
9 | |
8 | |
6 | |
5 | |
5 | |
4 | |
4 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.