cancel
Showing results for 
Search instead for 
Did you mean: 

P&F Issue when using SAP_PD and SAP_PA same form scenario

marcosandrade
Participant
0 Kudos

Hi guys,

I have a requirement to transfer the employee to an existing position and also change this destination position attributes, I mean Job relationship, Cost Center and other infotypes such as P1050.

I start the process with SAP_PA due to the fact the user should select the affected employee first. Then in the form the user picks the destination position and change its attributes.

I set up SAP_PD to save the position attributes and SAP_PA to run a transfer action and assigned the destination position to field I0001_PLANS of infotype 0001.

When I execute the process and click on Check button get the dump below.

Category                     ABAP Programming Error

Runtime Errors         UNCAUGHT_EXCEPTION

Except.                        CX_HRPA_INVALID_PARAMETER

ABAP Program           CL_HRASR00_PAITF_ADAPTER======CP

Application Component  PA-AS

Date and Time          23.06.2013 03:11:23

An exception occurred that is explained in detail below.

The exception, which is assigned to class 'CX_HRPA_INVALID_PARAMETER', was not

caught in

procedure "IF_HRASR00_PAITF_ADAPTER~DO_OPERATIONS" "(METHOD)", nor was it

propagated by a RAISING clause.

Since the caller of the procedure could not have anticipated that the

exception would occur, the current program is terminated.

The reason for the exception is:

Invalid parameter EXCEPTION, value

The occurrence of the exception is closely related to the occurrence of

a previous exception "CX_HRPA_VIOLATED_ASSERTION", which was raised in the

program "CL_HRPA_OM_INTEGRATION========CP",

specifically in line 214 of the (include) program

"CL_HRPA_OM_INTEGRATION========CCIMP".

The cause of the exception was:

"UNCAUGHT_EXCEPTION" "CX_HRPA_INVALID_PARAMETER"

"CL_HRPA_RESOLVE_EXCEPTION=====CP" or "CL_HRPA_RESOLVE_EXCEPTION=====CM00

"RESOLVE"

*------------------------------------------------------------------------------------------------------------------------------------------- *

if we have a look at the exact point of the dump we can get a description of SAP.

* If we can not remap we would like to just re-raise the

* exception like below like "RAISE EXCEPTION exception.".

* Unfortunately the kernel will then forget about the

* original source position.

* So this is the fallback strategy. Calling this method

* is only allowed if the exception can be resolved. Since

* this is not the case we indicate a parameter violation.

   RAISE EXCEPTION TYPE cx_hrpa_invalid_parameter

     EXPORTING

       previous  = exception

       parameter = 'EXCEPTION'.

I realized that some people succeed using SAP_PD and SAP_PA in the same form scenario, could you please help me on this issue or give some directions??

thanks in advance.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Macros,

The dump message is referring some error coming from your DO_OPEARTIONs method .

Do you want to check further your coding in this method?

Perhaps to comment all the code and see if this error message still coming.

I have implemented position changed for an employee using SAP_PA. Had never tried to use both service in the same form. I noticed you have a lot of rules setup for your form, that must be very complex form you have developed. Good luck .

Thanks.

regards,

Xiang Li

marcosandrade
Participant
0 Kudos

Hi Xiangli,

thanks for your feedback, that's exactly what I'm doing right now, debugging the DO_OPERATION in order to understand what can be the issue.

Regards

Marcos

marcosandrade
Participant
0 Kudos

Hi,

we debugged this issue and noticed that SAP_PD and SAP_PA used in the same form scenario is possible, but since we do not use infotype 0000/0001 to run an action in PA, we had the OM_PA integration active then when we transfer the position to another Cost.Center or Org,unit it automatically updates infotype 0001, then it gets lost due to the fact we also use SAP_PA 0000/0001 to run an action.

there is might be a solution or note for that, I'm not sure but since we do not have enough time to spend in order to look into that carefully, our solution was.

1. Split the process into two form scenario.

Form A. Update position attributes.

Form B. Run transfer action.

2.  After the HR adm process the form we called the task TS17900108 to save data into the back-end for both form scenario.

if someone had this experience and solved in a different way would be good to know.

former_member189690
Participant
0 Kudos

Hi Marcos!,

I'm facing exactly the same issue than you but in my case I want to do a Rehiring action and update some address position fields.

I have in the same form scenario both SAP_PD and SAP_PA services but I'm getting the same dump than you. In fact, actually I have set MASSN = 12  (rehiring action) in SAP_PA services but the same error is showed up.

Any idea?

KR

marcosandrade
Participant
0 Kudos

Hi Afonso,

after several months of searching I could find the solution, actually understand how the P&F tool works.

This is how the P&F works. This issue is raised due to the fact that SAP_PD changes is already posted into the database, therefore in case some issue with SAP_PA is found the system will not be able to rollback the changes made by SAP_PD then this exception is raised.

I solved this by finding the right place where this exception is raised and did an enhancement at that point. At first I thought it would impact another functionality but after a few processes posted I realized that not was damaged.

well here you go the solution.

in the class CL_HRPA_OM_INTEGRATION there is a method called ENABLE_OM_INTEGRATION.

inside this method there is another method which is called.

IF a_is_integration_active = false.

     lcl_memento_proxy=>enable( ).

   ENDIF.


inside the method ENABLE there is another method which is called.

IF proxy->a_om_memento->is_empty( ) = false.

*       Before the enable OM operations were already performed.

*       Hence the proxy can not determine the correct buffer

*       state for rollback.

*       In other words the enable for OM integration was

*       issued after the first OM write access. This is by

*       definition a coding error of the surrounding transaction.

         RAISE EXCEPTION TYPE cx_hrpa_violated_assertion.

       ENDIF.

     ENDLOOP.


then the last point inside the method is_empty of the local class  lcl_om_memento. I set an enhancement. Please find the final code of this method below which includes the enhancement.


* =============================================================== *

METHOD is_empty.

*    RETURNING

*      is_emtpy TYPE boole_d.

     IF a_buffer_count       IS INITIAL AND

        a_buffo_object_count IS INITIAL AND

        a_plog_tab_count     IS INITIAL AND

        a_tb_buffer_count    IS INITIAL AND

        a_tb_plog_tab_count  IS INITIAL AND

        a_buffer_tab         IS INITIAL AND

        a_buffo_tab          IS INITIAL AND

        a_plog_tab_tab       IS INITIAL AND

        a_tb_buffer_tab      IS INITIAL AND

        a_tb_plog_tab_tab    IS INITIAL.

       is_empty = true.

     ELSE.

       is_empty = false.

     ENDIF.

"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""$"$\SE:(1) Class LCL_OM_MEMENTO, Method IS_EMPTY, End                                                                                                        A

*$*$-Start: (1)---------------------------------------------------------------------------------$*$*

ENHANCEMENT YPX0_EP_INTEGRATION_OM_PA.    "active version

* This implementation is used due to the fact that in the "ApproveForm", of P&F it calls do operation of SAP_PD and then SAP_PA.

* when do operation of SAP_PD is called this method is called and buffer of SAP_PD is loaded then gererating this error.

* this is procedure of P&F to call this do_operation for both services, but nothing is saved at this point, only check.

* that's whty we set up true always, this issue is only raised by using both SAP_PD and SAP_PA.

  is_empty = true.

ENDENHANCEMENT.

*$*$-End:   (1)---------------------------------------------------------------------------------$*$*

   ENDMETHOD.                    "is_empty


Hope it helps you.

Kind Regards


Answers (2)

Answers (2)

KrishnaK
Explorer
0 Kudos

Hi,

you can resolve this issue by using custom generic service before and after calling the SAP_PA service. ( i.e. add a new method to class CL_HRPA_OM_INTEGRATION to set the parameter A_is_integration_active  = X  or A_is_integration_active  = space  this has to be controlled from process, then you will be sure that there is no impact to any process.


Regards,

Krishna 

AlpeshP
Discoverer
0 Kudos

Hi venkatkrishnakallakuri ,

Can you guide me more on this solution.

Where to control from HRASR form process?

Regards,

Alpesh

former_member189690
Participant
0 Kudos

Hi Marcos,

Thanks a lot for your response. It is very helpful for me and I'm gonna implement the same enhancement.

Just one last weird thing that I want to comment you. I'm facing this error while performing a Rehire process but I have implemented a Hire process which it is using both SAP_PD and SAP_PA and everything is ok and no error is raised. Do you know the reason for that?

KR

marcosandrade
Participant
0 Kudos

Hi Afonso,

I had a hire scenario which I had this issue. This was a hiring to a new position. I started the process with Org.Unit, then the user filled out all information about the new position, then I used SAP_PD to create the new position. Later on I used SAP_PA to hire the employee.

This issue only happened because I save SAP_PD. I think if you do not use SAP_PD to post data into back-end only reading access you will not face this issue.

Please, let me know your scenario.

Kind Regards

former_member189690
Participant
0 Kudos

Hi Marcos,

I'm updating data of position in the same form scenario. Position is already created and user selects it and performs Hire action on given position. Inside my form scenario I have SAP_PD backend service first for update IT1028 (Change operation) fields and afterwards I have SAP_PA with hiring action and performing creation on several infotypes, and everything is ok. I don't figure out the sense because in this action all is working fine and not in rehiring action...

Maybe there is any relation regarding while hiring action I don't have any personnel number created on database yet and system is performing another different behaviour that when we have a personnel number selected.

KR