01-08-2008 11:13 AM
Hi all,
Im creating a report with LDB PNPCE, this report has to create/modify infotypes of an ID person. Im trying to use de FM HR_INFOTYPE_OPERATION, but its not working A DUMP is generated, with this description:
An exception that could not be caught occurred.CX_HRPA_VIOLATED_PRECONDITION
I think that the problem is due to logical database PNPCE, because if I use PNP, its working Does anybody know anything about using the FM HR_INFOTYPE_OPERATION with the LDB PNPCE?
Thanks!!
01-08-2008 1:38 PM
It might be due to the way your passing values to the function call.. HR_INFOTYPE_OPERATION as such has nothing to do with the LDB.. PNP/PNPCE is of no relevance.. PL paste your code..
~Suresh
01-08-2008 1:52 PM
This piece of code it's working with ldb PNP
CALL FUNCTION 'ENQUEUE_EPPRELE'
EXPORTING
MODE_PREL = 'E'
MANDT = SY-MANDT
pernr = wa_p9961-pernr
infty = '9961'
SUBTY =
OBJPS =
SPRPS =
endda = wa_p9961-endda "'99991231'
begda = wa_p9961-begda "'20071201'
SEQNR =
X_PERNR = ' '
X_INFTY = ' '
X_SUBTY = ' '
X_OBJPS = ' '
X_SPRPS = ' '
X_ENDDA = ' '
X_BEGDA = ' '
X_SEQNR = ' '
_SCOPE = '2'
_WAIT = ' '
_COLLECT = ' '
EXCEPTIONS
foreign_lock = 1
system_failure = 2
OTHERS = 3
.
CALL FUNCTION 'HR_INFOTYPE_OPERATION'
EXPORTING
infty = '9961'
number = wa_p9961-pernr
subtype = wa_p9961-subty
OBJECTID =
lockindicator = 'X'
validityend = wa_p9961-endda
validitybegin = wa_p9961-begda
recordnumber = lwa_pa9961-seqnr
record = wa_p9961
operation = 'INS'
tclas = 'A'
dialog_mode = '0'
nocommit = ' '
VIEW_IDENTIFIER =
SECONDARY_RECORD =
IMPORTING
return = l_return
KEY =
.
CALL FUNCTION 'DEQUEUE_EPPRELE'
EXPORTING
MODE_PREL = 'E'
MANDT = SY-MANDT
pernr = wa_p9961-pernr
infty = '9961'
SUBTY =
OBJPS =
SPRPS =
endda = wa_p9961-endda "'99991231'
begda = wa_p9961-begda "'20071201'
SEQNR =
X_PERNR = ' '
X_INFTY = ' '
X_SUBTY = ' '
X_OBJPS = ' '
X_SPRPS = ' '
X_ENDDA = ' '
X_BEGDA = ' '
X_SEQNR = ' '
_SCOPE = '3'
_SYNCHRON = ' '
_COLLECT = ' '
.
But if I use ldb PNPCE instead PNP, with the events:
GET person.
GET group.
GET peras.
ths dump is generated...
Thank u!!
01-08-2008 8:27 PM
Why don't you use the function call outside the Get events ie after the end-of-selection ? you can trap all the pernrs that need in an itab, loop at the itab & make the function call for each pernr inside that loop.
~Suresh
01-10-2008 9:43 AM
Hello!
I can't use the function call outside the get evets, because I need the data of the infotypes for each pernr to calculate the results...
01-10-2008 10:14 AM
Hi Marta,
Have you checked SAP NOTE: 493984.
Since HR_INFOTYPE_OPERATION calls the method 'SET_FRAMEWORK of class CL_HRPA_MASTERDATA_FACTORY Also This note talks about the same dump due to exception rasied in SET_FRAMEWORK method of CL_HRPA_MASTERDATA_FACTORY. Also gives solution " setting or evaluating the CE main switches correctly ".
Hope this helpful,
Shrinivas
P.S: I haven't worked on CE environment uptill now, so do not have much idea regading setting CE switches.
01-10-2008 11:08 AM
Hi Shrinivas!!
I've just checked the note... I have almost the same problem... but with other class an other method:
CLASS "CL_HRPA_INFOTYPE_FACTORY "
METHOD: "SET_CONTEXT"
The attribute a_context is initial so...
context must never be set twice
RAISE EXCEPTION TYPE cx_hrpa_violated_precondition.
any sugestion?
Thanks a lot, your replay has been very useful, maybe I would have to put another SAP NOTE...
01-10-2008 12:00 PM
Hi Marta,
In our system we haven't implemented CE, so i am not able to debug/test since i m not getting the dump :).
Try to debug and check why the context has set twice (are you using any other FM or Class methods before calling HR_INFOTYPE_OPERATION whcih is setting the context ?) , also i noticed you are updating custom infotype '9961', check whether same dump is coming when you update for standard infotype's ?
Regards,
Shrinivas