cancel
Showing results for 
Search instead for 
Did you mean: 

HR_INFOTYPE_OPERATION Precondition Violated

Former Member
0 Kudos

Hi All,

I'm trying to create a new infotype record using FM HR_INFOTYPE_OPERATION in a WD4A application but get the Precondition Violated shortdump.

I've debugged it and see that it's caused because a constructor apparanty tries to reset the context.

I found that for non WD4A applications this can be solved by either switching the LDB used or adding a subroutine call at the LOAD-OF_PROGRAM event.

Is there something simular for WD4A or maybe an alternative to using the FM?

Thanks in advance.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,<br /> Even i faced the same problem while tryinh to update infotype 761 from my web dynpro abap component.Although it was showing todays date on the last changed column and also my sap id on the changed by column;then also the value which i was updating was not getting reflected in the database.<br /> <br /> Then i used the following solution which worked for me.After updating/inserting data in the infotype use the function module "HR_ECM_FLUSH_INFOTYPE".Then the data will reflect in the database.Below is the code snippet.<br /> <p /> <br />

DATA : wa_pskey TYPE pskey,<br />

message_handler TYPE REF TO if_hrpa_message_handler,<br />

is_ok TYPE boole_d.<br />

<br />

CALL FUNCTION 'HR_ECM_MODIFY_INFOTYPE' "to modify the infotype<br />

EXPORTING<br />

pnnnn = ls_wa_p0761<br />

  • TEXT_TAB =<br />

  • MODIFY_TEXT = ' '<br />

old_pskey = wa_pskey<br />

  • NO_AUTH_CHECK = ' '<br />

message_handler = message_handler<br />

IMPORTING<br />

  • SEQNR =<br />

is_ok = is_ok<br />

.<br />

<br />

CALL FUNCTION 'HR_ECM_FLUSH_INFOTYPE'<br />

EXPORTING<br />

nocommit = ''<br />

message_handler = message_handler<br />

IMPORTING<br />

is_ok = is_ok.<br />

<p />

<br />

Hope it works for everyone.<br />

Former Member
0 Kudos

Thanks for this example.

Since a collegue of my went a different direction to solve this problem by using the decoupled infotype framework I will not be able to test this immediately.

I have assigned you some points for the answer. I'll have to try the ECM functions to see if they go around the problem from HR_INFOTYPE_OPERATION before I can get back to you to confirm if this solved my problem.

Regards,

Arthur

Answers (5)

Answers (5)

Former Member
0 Kudos

Just call both Programms in sequence

  • CALL FUNCTION 'HR_ECM_FLUSH_INFOTYPE'
  • PERFORM do_nothing(sapfp50p).
Former Member
0 Kudos

Create a Z-version of HR_INFOTYPE_OPERATION with RFC marked and call the RFC with Destination 'NONE'
Hope this helps.

Former Member
0 Kudos

This message was moderated.

former_member463524
Contributor
0 Kudos

Hi,

Check whether is it failing in authorization while executing the FM.

This FM will do authorization check before executing the action.

Regards,

Meera

Former Member
0 Kudos

The problem is not in the authorization. The problem lies in the fact that the FM calls een form to initial a field. This form is only supposed to be called once but for some reason is called more than once.

The second time the form is called it creates the error because the variable is already set.

Regards,

Arthur

Former Member
0 Kudos

Hi ,

i have the same problem whit use FM HR_INFOTYPE_OPERATION in WDA .

System return CX_HRPA_INVALID_PARAMETER in HR_MAINTAIN_MASTERDATA .

Can you tell me if you solve your problem ?

Thanks in advance

Massimo

Former Member
0 Kudos

Hi,

Unfortunately we didn't solve the issue with the FM. A collegue of my changed the program to use the decoupled infotype framework though and so far that seems to be working. We still did have some issue but that was mainly because not all infotypes are fully integrated in the decoupled infotype framework.

Arthur

Former Member
0 Kudos

Hi,

I am talking to you as a moderator.

one question: Isn't this more an ABAP problem to be filed in the ABAP queue?

Where is the constructor being executed you are speking of?

Regards,

Thomas

Former Member
0 Kudos

Hi The reason I placed my question here was that I'm trying to use the HR_INFOTYPE_OPERATION FM in a WebDynpro for ABAP application and thought this was the best forumn to place it.

The Constructor I'm talking about is part of the nestled function module HR_MAINTAIN_MASTERDATA. It calls a form called INITIALIZE_PS(SAPFP50P). In there somewhere a field named context is initialized.

If I debug my WebDynpro application I find that the Initialisation form is called multiple times and I have no idea why this is.

However this all isn't the essence of my question. I just want to know if anybody knows if there's an alternative to using the FM that does work in WD4A since the HR_INFOTYPE_OPERATION function module does not.

Regards,

Arthur

former_member199125
Active Contributor
0 Kudos

Hi...

I am able to use HR_INFOTYPE_OPERATION in my webdynpro component without any problem.while debugging... what is the return value of the above FM?

Regards

Srinivas

Former Member
0 Kudos

Hi Sanasrinivas,

I don't remeber what the return code was. The only thing I do remeber is that as i said in a previous reply is that the error occurs because for some reason the form INITIALIZE_PS(SAPFP50P) is called multiple times when it's only allowed to be called once.

This form said a value for a variable and once that is set, it doens't allow it to be changed resulting in the shortdump because apparently SAP standard programming isn't handling the exception.

Regards,

Arthur

Former Member
0 Kudos

hi, i have this dump :

... exception "CX_HRPA_VIOLATED_PRECONDITION", which was raised in the

program "CL_HRPA_MASTERDATA_FACTORY====CP" .....

The dump is radom so is difficult to understand the failure .

thanks

Max