<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: hr_infotype_operation errors when called within a user exit in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/hr-infotype-operation-errors-when-called-within-a-user-exit/m-p/1797366#M342551</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The employee in change mode is already locked so enque is failing and you are still trying to update it. Its too late though but in process of searcing an answer I found this question..&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 27 Aug 2008 05:35:54 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-08-27T05:35:54Z</dc:date>
    <item>
      <title>hr_infotype_operation errors when called within a user exit</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/hr-infotype-operation-errors-when-called-within-a-user-exit/m-p/1797364#M342549</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi there.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am doing an enhancement in userexit PBAS0001 for CE using the enhancement framework.Whenever I am trying to change the payroll area in IT0001 by PA30 it has to give a message saying that 'all the assignments will change to new payroll areas do you want to continue?'if i say yes then the payroll areas for all the assignments should be chnaged to the current payroll area which I am trying to change.So after the pop up I am looping at all the assignments and calling the function module hr_infotype_operation.It gives an error Complex Application error.I debugged and saw that when it calls the function module the user exit gets triggered again and goes to the starting within the function call and hits the function module again and keep going like this.I checked the structure and all the parameters.looks fine below is the code where I am using the function module.I am trying to update IT0001 when somebody tries to change the IT0001(is that an issue??) i tried by submitting a program by calling the function module in the program.Didnt work too.Is there any way we can do it by BDC??&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; Check if the payroll areas are equal&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    IF ls_i0001-abkrs NE new_p0001-abkrs.&lt;/P&gt;&lt;P&gt;*&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;If the payroll areas are not equal then generate a message pop-up with 'YES' and 'NO' buttons&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;      CALL FUNCTION 'POPUP_TO_CONFIRM'&lt;/P&gt;&lt;P&gt;        EXPORTING&lt;/P&gt;&lt;P&gt;          titlebar       = 'Warning'&lt;/P&gt;&lt;P&gt;          text_question  = 'Payroll Area specified is different with other assignments.Do you want to move all the other assignments to the same payroll area?'&lt;/P&gt;&lt;P&gt;          text_button_1  = 'Yes'&lt;/P&gt;&lt;P&gt;          icon_button_1  = ' '&lt;/P&gt;&lt;P&gt;          text_button_2  = 'No'&lt;/P&gt;&lt;P&gt;          icon_button_2  = ' '&lt;/P&gt;&lt;P&gt;          default_button = '1'&lt;/P&gt;&lt;P&gt;          start_column   = 25&lt;/P&gt;&lt;P&gt;          start_row      = 6&lt;/P&gt;&lt;P&gt;        IMPORTING&lt;/P&gt;&lt;P&gt;          answer         = lv_case&lt;/P&gt;&lt;P&gt;        EXCEPTIONS&lt;/P&gt;&lt;P&gt;          text_not_found = 1&lt;/P&gt;&lt;P&gt;          OTHERS         = 2.&lt;/P&gt;&lt;P&gt;      CASE lv_case.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;        WHEN '2'.                                 "For 'NO' button&lt;/P&gt;&lt;P&gt;          LEAVE TO SCREEN '2010'.&lt;/P&gt;&lt;P&gt;        WHEN 'A'.                                 "For 'CANCEL' button&lt;/P&gt;&lt;P&gt;          LEAVE TO SCREEN '2010'.&lt;/P&gt;&lt;P&gt;        WHEN '1'.                                 "For 'YES' button&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Second Pop-up confirm&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;          CALL FUNCTION 'POPUP_TO_CONFIRM'&lt;/P&gt;&lt;P&gt;            EXPORTING&lt;/P&gt;&lt;P&gt;              titlebar              = 'Warning'&lt;/P&gt;&lt;P&gt;              text_question         = 'System will update all other assignments to the new payroll area'&lt;/P&gt;&lt;P&gt;              text_button_1         = 'Yes'&lt;/P&gt;&lt;P&gt;              icon_button_1         = ' '&lt;/P&gt;&lt;P&gt;              text_button_2         = 'No'&lt;/P&gt;&lt;P&gt;              icon_button_2         = ' '&lt;/P&gt;&lt;P&gt;              default_button        = '1'&lt;/P&gt;&lt;P&gt;              display_cancel_button = 'X'&lt;/P&gt;&lt;P&gt;              start_column          = 25&lt;/P&gt;&lt;P&gt;              start_row             = 6&lt;/P&gt;&lt;P&gt;            IMPORTING&lt;/P&gt;&lt;P&gt;              answer                = lv_case1&lt;/P&gt;&lt;P&gt;            EXCEPTIONS&lt;/P&gt;&lt;P&gt;              text_not_found        = 1&lt;/P&gt;&lt;P&gt;              OTHERS                = 2.&lt;/P&gt;&lt;P&gt;          CASE  lv_case1.&lt;/P&gt;&lt;P&gt;            WHEN '2'.                             "For 'NO' button&lt;/P&gt;&lt;P&gt;              LEAVE TO SCREEN '2010'.&lt;/P&gt;&lt;P&gt;            WHEN 'A'.                             "For 'CANCEL' button&lt;/P&gt;&lt;P&gt;              LEAVE TO SCREEN '2010'.&lt;/P&gt;&lt;P&gt;            WHEN '1'.                             "For 'YES' button&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;For all the assignments read the infotype 0001 and update the payroll area&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;              LOOP AT lt_pernr INTO ls_pernr.&lt;/P&gt;&lt;P&gt;                CLEAR:lt_i0001,ls_i0001.&lt;/P&gt;&lt;P&gt;                REFRESH lt_i0001.&lt;/P&gt;&lt;P&gt;                CALL FUNCTION 'HR_READ_INFOTYPE'&lt;/P&gt;&lt;P&gt;                  EXPORTING&lt;/P&gt;&lt;P&gt;                    tclas           = 'A'&lt;/P&gt;&lt;P&gt;                    pernr           = ls_pernr&lt;/P&gt;&lt;P&gt;                    infty           = '0001'&lt;/P&gt;&lt;P&gt;                    begda           = new_p0001-begda&lt;/P&gt;&lt;P&gt;                    endda           = new_p0001-endda&lt;/P&gt;&lt;P&gt;                    bypass_buffer   = 'X'&lt;/P&gt;&lt;P&gt;                  IMPORTING&lt;/P&gt;&lt;P&gt;                    subrc           = lv_subrc&lt;/P&gt;&lt;P&gt;                  TABLES&lt;/P&gt;&lt;P&gt;                    infty_tab       = lt_i0001&lt;/P&gt;&lt;P&gt;                  EXCEPTIONS&lt;/P&gt;&lt;P&gt;                    infty_not_found = 1&lt;/P&gt;&lt;P&gt;                    OTHERS          = 2.&lt;/P&gt;&lt;P&gt;                SORT lt_i0001 BY endda DESCENDING.&lt;/P&gt;&lt;P&gt;                READ TABLE lt_i0001 INTO ls_i0001 INDEX 1.&lt;/P&gt;&lt;P&gt;                ls_i0001-abkrs = new_p0001-abkrs.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;               lv_record = ls_i0001.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;               &lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Lock the employee&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;                  CALL FUNCTION 'BAPI_EMPLOYEE_ENQUEUE'&lt;/P&gt;&lt;P&gt;                    EXPORTING&lt;/P&gt;&lt;P&gt;                      number = ls_i0001-pernr&lt;/P&gt;&lt;P&gt;                    IMPORTING&lt;/P&gt;&lt;P&gt;                      return = lv_return.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;                  CALL FUNCTION 'HR_INFOTYPE_OPERATION'&lt;/P&gt;&lt;P&gt;                    EXPORTING&lt;/P&gt;&lt;P&gt;                      infty         = '0001'&lt;/P&gt;&lt;P&gt;                      number        = ls_i0001-pernr&lt;/P&gt;&lt;P&gt;                      validityend   = '12302006'&lt;/P&gt;&lt;P&gt;                      validitybegin = '12012006'&lt;/P&gt;&lt;P&gt;                      record        = ls_i0001&lt;/P&gt;&lt;P&gt;                      operation     = 'INS'&lt;/P&gt;&lt;P&gt;                     IMPORTING&lt;/P&gt;&lt;P&gt;                      return        = return.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*unlock the employee&lt;/P&gt;&lt;P&gt;                  CALL FUNCTION 'BAPI_EMPLOYEE_DEQUEUE'&lt;/P&gt;&lt;P&gt;                    EXPORTING&lt;/P&gt;&lt;P&gt;                      number = ls_i0001-pernr&lt;/P&gt;&lt;P&gt;                    IMPORTING&lt;/P&gt;&lt;P&gt;                      return = lv_return.&lt;/P&gt;&lt;P&gt;**&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;               SUBMIT zhr_infotype_operation_py_area USING SELECTION-SCREEN '1000'&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;               WITH p_infty  = '0001'&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;               WITH p_pernr  = ls_i0001-pernr&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;               WITH p_endda  = new_p0001-endda&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;               WITH p_begda  = new_p0001-begda&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;               WITH p_record = lv_record&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;               WITH p_opera  = 'INS'&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;               WITH p_tclas  = 'A'&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;               AND RETURN.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;              ENDLOOP.&lt;/P&gt;&lt;P&gt;          ENDCASE.&lt;/P&gt;&lt;P&gt;      ENDCASE.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 Dec 2006 17:20:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/hr-infotype-operation-errors-when-called-within-a-user-exit/m-p/1797364#M342549</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-12-13T17:20:28Z</dc:date>
    </item>
    <item>
      <title>Re: hr_infotype_operation errors when called within a user exit</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/hr-infotype-operation-errors-when-called-within-a-user-exit/m-p/1797365#M342550</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;maybe a little late, but I had found this message today (searching for different problem) but maybe the date for HR_infotype_operation might do a little problem, cause you are filling it with: DDMMYYYY but it should be YYYYMMDD so it just translate it that this is really far in the past so that might be a problem. Try sy-datum instead and for the end of validity try '99991231' dont worry, when you will update the same infotype again, the FM will end the previous infotype to previous day and the new one will get validity from sy-datum till the end ....&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Dec 2007 18:40:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/hr-infotype-operation-errors-when-called-within-a-user-exit/m-p/1797365#M342550</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-12-11T18:40:35Z</dc:date>
    </item>
    <item>
      <title>Re: hr_infotype_operation errors when called within a user exit</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/hr-infotype-operation-errors-when-called-within-a-user-exit/m-p/1797366#M342551</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The employee in change mode is already locked so enque is failing and you are still trying to update it. Its too late though but in process of searcing an answer I found this question..&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 Aug 2008 05:35:54 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/hr-infotype-operation-errors-when-called-within-a-user-exit/m-p/1797366#M342551</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-08-27T05:35:54Z</dc:date>
    </item>
  </channel>
</rss>

