<?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: Problem with 'HR_INFOTYPE_OPERATION' in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-hr-infotype-operation/m-p/5533562#M1264075</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Jose,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Send the complete code, will check in the system.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Br/Manas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 28 Apr 2009 07:40:10 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2009-04-28T07:40:10Z</dc:date>
    <item>
      <title>Problem with 'HR_INFOTYPE_OPERATION'</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-hr-infotype-operation/m-p/5533555#M1264068</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Good day to everyone. This is my first post and I'm looking forward to get your help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm working on a project and I need to insert a record into infotype.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The problem is when the program reach HR_INFOTYPE_OPERATION the system hangs! and you cannot even close it. Even end session will not work! to kill this session I have to go to sm04 ... etc&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;can you help me with this!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;this is a peace of my code!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;        CALL FUNCTION 'BAPI_EMPLOYEE_ENQUEUE'&lt;/P&gt;&lt;P&gt;          EXPORTING&lt;/P&gt;&lt;P&gt;            number = p9057-pernr&lt;/P&gt;&lt;P&gt;          IMPORTING&lt;/P&gt;&lt;P&gt;            return = wf_bapireturn1.&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                  = '9057'&lt;/P&gt;&lt;P&gt;           number                 = wa_pa9057-pernr&lt;/P&gt;&lt;P&gt;           subtype                = wa_pa9057-subty&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;          objectid               = wa_pa9057-objps&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;          lockindicator          = wa_pa9057-sprps&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;           validityend            = wa_pa9057-endda&lt;/P&gt;&lt;P&gt;           validitybegin          = wa_pa9057-begda&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;          recordnumber           = wa_pa9057-seqnr&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;           record                 = p9057&lt;/P&gt;&lt;P&gt;           operation              = 'INS'&lt;/P&gt;&lt;P&gt;           tclas                  = 'A'&lt;/P&gt;&lt;P&gt;           dialog_mode            = '0'&lt;/P&gt;&lt;P&gt;           nocommit               = 'X'&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;         VIEW_IDENTIFIER        =&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;         SECONDARY_RECORD       =&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;     IMPORTING&lt;/P&gt;&lt;P&gt;           return                 = wf_bapireturn1.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;          key                    = wf_key.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&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 = p9057-pernr&lt;/P&gt;&lt;P&gt;          IMPORTING&lt;/P&gt;&lt;P&gt;            return = wf_bapireturn1.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 27 Apr 2009 11:33:54 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-hr-infotype-operation/m-p/5533555#M1264068</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-04-27T11:33:54Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with 'HR_INFOTYPE_OPERATION'</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-hr-infotype-operation/m-p/5533556#M1264069</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;9057 is custom infotype, so check it once again 9057 is there in system or not. and also check it is properly created or not.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 27 Apr 2009 11:36:38 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-hr-infotype-operation/m-p/5533556#M1264069</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-04-27T11:36:38Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with 'HR_INFOTYPE_OPERATION'</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-hr-infotype-operation/m-p/5533557#M1264070</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It's there in the system. Also, I've been using direct INSERT statement and it is working fine. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 27 Apr 2009 11:47:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-hr-infotype-operation/m-p/5533557#M1264070</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-04-27T11:47:07Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with 'HR_INFOTYPE_OPERATION'</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-hr-infotype-operation/m-p/5533558#M1264071</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;There is no Problem in Given Code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Check the Infotype onse for any syntax errors .and let me know for how many records you are updating &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if you have large amount of data use FM  &lt;STRONG&gt;HR_PSBUFFER_INITIALIZE&lt;/STRONG&gt; to clear the Bufffer.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Vamshi.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 27 Apr 2009 11:52:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-hr-infotype-operation/m-p/5533558#M1264071</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-04-27T11:52:42Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with 'HR_INFOTYPE_OPERATION'</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-hr-infotype-operation/m-p/5533559#M1264072</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you for your response.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am only adding one record! and there are no syntax error! &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 27 Apr 2009 12:11:34 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-hr-infotype-operation/m-p/5533559#M1264072</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-04-27T12:11:34Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with 'HR_INFOTYPE_OPERATION'</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-hr-infotype-operation/m-p/5533560#M1264073</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1) May be below code will give some clue, check the returns after each BAPI Call&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;

    CALL FUNCTION 'HR_EMPLOYEE_ENQUEUE'
      EXPORTING
        number = pernr
      IMPORTING
        return = l_return.
    IF l_return-type = 'E'.
      Do error processing
    ELSE.
* update infotype
      CALL FUNCTION 'HR_INFOTYPE_OPERATION'
        EXPORTING
          infty         = '9310'
          number        = pernr
          validityend   = begda
          validitybegin = begda
          recordnumber  = seqnr
          record        = 
          operation     = 'INS'
          nocommit      = l_nocommit
        IMPORTING
          return        = l_t_return.
      READ TABLE l_t_return WITH KEY type = 'E'.
      IF sy-subrc = 0.
      ENDIF.
*Unlock the pernr
      CLEAR l_return.
      CALL FUNCTION 'HR_EMPLOYEE_DEQUEUE'
        EXPORTING
          number = pernr
        IMPORTING
          return = l_return.

      IF l_return-type = 'E'.
        Error Processing
      ENDIF.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2) Try updating the other PerNrs record as Pernr you are updating may have some data problem.&lt;/P&gt;&lt;P&gt;3) Finally try running the same in debugging mode if it gives some clue.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let us know if nothing works or yu get some clue.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Shital&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 27 Apr 2009 13:12:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-hr-infotype-operation/m-p/5533560#M1264073</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-04-27T13:12:35Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with 'HR_INFOTYPE_OPERATION'</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-hr-infotype-operation/m-p/5533561#M1264074</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you all for your help I really appreciate it. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Unfortunately, the problem is not resolved yet! &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here are my observation.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
  wa_pa9057-pernr = p9057-pernr.
  wa_pa9057-subty = p9057-subty.
  wa_pa9057-objps = p9057-objps.
  wa_pa9057-sprps = p9057-sprps.
  wa_pa9057-endda = p9057-endda.
  wa_pa9057-begda = p9057-begda.
  wa_pa9057-uname = sy-uname.
  wa_pa9057-seqnr = p9057-seqnr.
  wa_pa9057-pry_post_trm = p9057-pry_post_trm.
  wa_pa9057-sev_bn = p9057-sev_bn.



  CASE sy-ucomm.
    WHEN 'SAVE'.

      DATA: uname2 LIKE pa9056-uname.

      SELECT SINGLE uname INTO uname2 FROM pa9056 WHERE objps = p9057-objps AND pernr = p9057-pernr.

      IF sy-subrc &amp;lt;&amp;gt; 0.
        MESSAGE e309(zhofs).

      ELSE.

        CALL FUNCTION 'BAPI_EMPLOYEE_ENQUEUE'
          EXPORTING
            number = p9057-pernr
          IMPORTING
            return = wf_bapireturn1.
        IF wf_bapireturn1 = 'E'.
          MESSAGE s001(zhofs).

        ELSE.

          CALL FUNCTION 'HR_INFOTYPE_OPERATION'
            EXPORTING
              infty         = '9057'
              number        = wa_pa9057-pernr
              validityend   = wa_pa9057-endda
              validitybegin = wa_pa9057-begda
              recordnumber  = wa_pa9057-seqnr
              record        = p9057
              operation     = 'INS'
              NOCOMMIT      = ' '
        importing
          RETURN        = wf_bapireturn1.

        ENDIF.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;in this case the system hangs ! when I change record parameter to wa_pa9057 it gives me a run time error saying that source field is too short. However, I'm pretty sure that all key values of 9057 is included in my work area!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Apr 2009 07:17:27 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-hr-infotype-operation/m-p/5533561#M1264074</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-04-28T07:17:27Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with 'HR_INFOTYPE_OPERATION'</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-hr-infotype-operation/m-p/5533562#M1264075</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Jose,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Send the complete code, will check in the system.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Br/Manas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Apr 2009 07:40:10 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-hr-infotype-operation/m-p/5533562#M1264075</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-04-28T07:40:10Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with 'HR_INFOTYPE_OPERATION'</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-hr-infotype-operation/m-p/5533563#M1264076</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you for your response! &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;

*----------------------------------------------------------------------*
*  MODULE user_command_2010 INPUT
*----------------------------------------------------------------------*
*
*----------------------------------------------------------------------*
MODULE user_command_2010 INPUT.

  wa_pa9057-pernr = p9057-pernr.
  wa_pa9057-subty = p9057-subty.
  wa_pa9057-objps = p9057-objps.
  wa_pa9057-sprps = p9057-sprps.
  wa_pa9057-endda = p9057-endda.
  wa_pa9057-begda = p9057-begda.
  wa_pa9057-uname = sy-uname.
  wa_pa9057-seqnr = p9057-seqnr.
  wa_pa9057-pry_post_trm = p9057-pry_post_trm.
  wa_pa9057-sev_bn = p9057-sev_bn.

  CLEAR: loc_objps,loc_begda,loc_sev_bn,loc_pry_post_trm .

  loc_objps = p9057-objps.
  loc_begda = p9057-begda.
  loc_sev_bn = p9057-sev_bn.
  loc_pry_post_trm = p9057-pry_post_trm.


  CASE sy-ucomm.
    WHEN 'SAVE'.

      DATA: uname2 LIKE pa9056-uname.

      SELECT SINGLE uname INTO uname2 FROM pa9056 WHERE objps = p9057-objps AND pernr = p9057-pernr.

      IF sy-subrc &amp;lt;&amp;gt; 0.
        MESSAGE e309(zhofs).

      ELSE.

        CALL FUNCTION 'BAPI_EMPLOYEE_ENQUEUE'
          EXPORTING
            number = p9057-pernr
          IMPORTING
            return = wf_bapireturn1.
        IF wf_bapireturn1 = 'E'.
          MESSAGE s001(zhofs).

        ELSE.

          CALL FUNCTION 'HR_INFOTYPE_OPERATION'
            EXPORTING
              infty         = '9057'
              number        = wa_pa9057-pernr
              validityend   = wa_pa9057-endda
              validitybegin = wa_pa9057-begda
              recordnumber  = wa_pa9057-seqnr
              record        = p9057
              operation     = 'INS'
              NOCOMMIT      = ' '
        importing
          RETURN        = wf_bapireturn1.

        ENDIF.





        CALL FUNCTION 'BAPI_EMPLOYEE_DEQUEUE'
          EXPORTING
            number = p9057-pernr
          IMPORTING
            return = wf_bapireturn1.

        IF wf_bapireturn1-number = '0'.
          MESSAGE s308(zhofs).
          wf_en_dis = 1.
        ELSE.
          EXIT.
        ENDIF.

      ENDIF. " check OBJPS

*Write your Logic after saving the record**

    WHEN 'BACK'.
      LEAVE PROGRAM.
      CALL TRANSACTION 'PA30'.

    WHEN 'EXIT'.
      EXIT.

    WHEN 'CANCEL'.
      LEAVE PROGRAM.
    WHEN OTHERS.
  ENDCASE.


ENDMODULE. 

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Apr 2009 07:48:48 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-hr-infotype-operation/m-p/5533563#M1264076</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-04-28T07:48:48Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with 'HR_INFOTYPE_OPERATION'</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-hr-infotype-operation/m-p/5533564#M1264077</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Please let me know what u r trying to do and what are the type of the infotypes 9056 and 9057, I mean r they PA infotypes or PD infotypes?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Br/Manas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Apr 2009 08:01:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-hr-infotype-operation/m-p/5533564#M1264077</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-04-28T08:01:46Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with 'HR_INFOTYPE_OPERATION'</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-hr-infotype-operation/m-p/5533565#M1264078</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;They are PA. I want to insert a record at 9057 but I have first to make sure that objps does exist in 9056 before saving. If doesn't exist then I have to throw an error message. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope that I'm clear. Please let me know if you want any clarifying.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Apr 2009 10:06:14 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-hr-infotype-operation/m-p/5533565#M1264078</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-04-28T10:06:14Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with 'HR_INFOTYPE_OPERATION'</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-hr-infotype-operation/m-p/5533566#M1264079</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Go through this piece of code. &lt;/P&gt;&lt;P&gt;It insert data into 0194 infotype successfully.&lt;/P&gt;&lt;P&gt;See if its of any help.&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;*&amp;amp;---------------------------------------------------------------------*
*&amp;amp;      Form  INSERT_0194
*&amp;amp;---------------------------------------------------------------------*
*       Inserting the infotype with corresponding records
*----------------------------------------------------------------------*
*  --&amp;gt;  p1        text
*  &amp;lt;--  p2        text
*----------------------------------------------------------------------*
FORM INSERT_0194.

  CLEAR WA_0194.
  LOOP AT I_0194 INTO WA_0194.
*Necessary FM required to lock an employee before calling FM
*HR_INFOTYPE_OPERATION
    CALL FUNCTION 'BAPI_EMPLOYEE_ENQUEUE'
      EXPORTING
        NUMBER = WA_0194-PERNR
      IMPORTING
        RETURN = WA_RETURN.


    IF WA_RETURN IS NOT INITIAL.
          &amp;lt;Error Checking&amp;gt;
      CONTINUE.

    ELSE.

*Populating the new structure with the old values
      CLEAR WA_0194_NEW.
      WA_0194_NEW-PERNR = WA_0194-PERNR.
      WA_0194_NEW-BEGDA = WA_0194-BEGDA.
      WA_0194_NEW-ENDDA = WA_0194-ENDDA.
      WA_0194_NEW-GCASE = WA_0194-GCASE.
      WA_0194_NEW-GSTAT = WA_0194-GSTAT.
      WA_0194_NEW-RCVDD = WA_0194-RCVDD.
      WA_0194_NEW-RLSDD = WA_0194-RLSDD.
      WA_0194_NEW-GPRIO = WA_0194-GPRIO.
      WA_0194_NEW-ORIGN = WA_0194-ORIGN.
      WA_0194_NEW-GCATE = WA_0194-GCATE.
      WA_0194_NEW-FIPSC = WA_0194-FIPSC.
      WA_0194_NEW-MEDSU = WA_0194-MEDSU.
      WA_0194_NEW-LIFNR = WA_0194-LIFNR.
      WA_0194_NEW-ORCOD = WA_0194-ORCOD.
      WA_0194_NEW-ORNAM = WA_0194-ORNAM.
      WA_0194_NEW-ORSTR = WA_0194-ORSTR.
      WA_0194_NEW-ORORT = WA_0194-ORORT.
      WA_0194_NEW-ORPLZ = WA_0194-ORPLZ.
      WA_0194_NEW-ORREG = WA_0194-ORREG.
      WA_0194_NEW-PLAIN = WA_0194-PLAIN.
      WA_0194_NEW-SCHID = WA_0194-SCHID.
      WA_0194_NEW-RULNR = WA_0194-RULNR.
      WA_0194_NEW-ANSWR = WA_0194-ANSWR.
      WA_0194_NEW-LAPDY = WA_0194-LAPDY.
      WA_0194_NEW-SCRUL = WA_0194-SCRUL.
      WA_0194_NEW-LAPDT = WA_0194-LAPDT.



*Function Module to insert 0194 data
      CALL FUNCTION 'HR_INFOTYPE_OPERATION'
        EXPORTING
          INFTY                  = '0194'
          NUMBER                 = WA_0194-PERNR
*     SUBTYPE                =
*     OBJECTID               =
*     LOCKINDICATOR          =
*     VALIDITYEND            =
*     VALIDITYBEGIN          =
*     RECORDNUMBER           =
          RECORD                 = WA_0194_NEW
          OPERATION              = 'INS'
         TCLAS                  = 'A'
         DIALOG_MODE            = '0'
*     NOCOMMIT               =
*     VIEW_IDENTIFIER        =
*     SECONDARY_RECORD       =
       IMPORTING
         RETURN                 = WA_RETURN_OP
         KEY                    = KEY_INFO
                .

      COMMIT WORK.

*Success Error Summary
      CLEAR WA_ERROR.
      CLEAR WA_SUCCESS.
      IF WA_RETURN_OP IS NOT INITIAL.
          &amp;lt;Error Checking&amp;gt;
      ELSE.
          &amp;lt;Error Checking&amp;gt;
      ENDIF.

*FM to unlock an employee
      CALL FUNCTION 'BAPI_EMPLOYEE_DEQUEUE'
        EXPORTING
          NUMBER = WA_0194-PERNR
        IMPORTING
          RETURN = WA_RETURN.


      IF WA_RETURN-MESSAGE IS NOT INITIAL.
          &amp;lt;Error Checking&amp;gt;
      ENDIF.

  ENDLOOP.

ENDFORM.                    " INSERT_0194&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;And WA_0194_NEW is of type P0194 structure.&lt;/P&gt;&lt;P&gt;Regards.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: rajan roy on Apr 28, 2009 12:29 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Apr 2009 10:27:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-hr-infotype-operation/m-p/5533566#M1264079</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-04-28T10:27:31Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with 'HR_INFOTYPE_OPERATION'</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-hr-infotype-operation/m-p/5533567#M1264080</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you very much for your effort. Unfortunately, the problem still stand! &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;All I need that I want to add only 1 record. for that reason I don't need loop at! &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I copy/ paste your record. Then I modify it to help my purpose but the same problem happen. The system hangs 4 ever!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thank you again I really appreciate your help.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Apr 2009 12:16:56 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-hr-infotype-operation/m-p/5533567#M1264080</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-04-28T12:16:56Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with 'HR_INFOTYPE_OPERATION'</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-hr-infotype-operation/m-p/5533568#M1264081</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try executing the code in Debug mode and check where it hangs...&lt;/P&gt;&lt;P&gt;Check if at all it is due to the FM HR_INFOTYPE_OPERATION as in my case it works fine, it must be due to some other reason.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Apr 2009 12:33:06 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-hr-infotype-operation/m-p/5533568#M1264081</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-04-28T12:33:06Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with 'HR_INFOTYPE_OPERATION'</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-hr-infotype-operation/m-p/5533569#M1264082</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In debug mode, I make sure that it hangs on HR_INFOTYPE_OPERATION.&lt;/P&gt;&lt;P&gt;when I went deep inside that &lt;U&gt;function module&lt;/U&gt; I found that it hangs here i.e. like infinite loop. I don't have any clue! &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt; 
  LOOP AT X031L_TAB.
        CLEAR: NAMETAB,
               DFIES.
        CALL 'C_DD_READ_FIELD'
             ID 'TYPE'      FIELD READTYPE
             ID 'TABNAME'   FIELD X031L_TAB-TABNAME
             ID 'FIELDNAME' FIELD X031L_TAB-FIELDNAME
             ID 'LANGUAGE'  FIELD LANGU.
        CASE SY-SUBRC.
          WHEN 0.
          WHEN 2.
            FIELDTEXT_NOT_FOUND = 'X'.
          WHEN OTHERS.
            RAISE INTERNAL_ERROR.
        ENDCASE.
*       DNTAB aus DFIES aufbauen.
        MOVE:  DFIES-TABNAME       TO NAMETAB-TABNAME,
               DFIES-FIELDNAME     TO NAMETAB-FIELDNAME,
               DFIES-LANGU         TO NAMETAB-LANGU,
               DFIES-POSITION      TO NAMETAB-POSITION,
               DFIES-OFFSET        TO NAMETAB-OFFSET,
               DFIES-KEYFLAG       TO NAMETAB-KEYFLAG,
               DFIES-FIELDTEXT     TO NAMETAB-FIELDTEXT,
               DFIES-DATATYPE      TO NAMETAB-DATATYPE,
               DFIES-INTTYPE       TO NAMETAB-INTTYPE,
               DFIES-LENG          TO NAMETAB-DDLEN,
               DFIES-INTLEN        TO NAMETAB-INTLEN,
               DFIES-DECIMALS      TO NAMETAB-DECIMALS,
               DFIES-CHECKTABLE    TO NAMETAB-CHECKTABLE,
               DFIES-REFTABLE      TO NAMETAB-REFTABLE,
               DFIES-REFFIELD      TO NAMETAB-REFFIELD,
               DFIES-PRECFIELD     TO NAMETAB-PRECFIELD,
               DFIES-LOGFLAG       TO NAMETAB-LOGFLAG,
               DFIES-MEMORYID      TO NAMETAB-MEMORYID,
               DFIES-LOWERCASE     TO NAMETAB-LOWERCASE,
               DFIES-SIGN          TO NAMETAB-SIGN,
               DFIES-VALEXI        TO NAMETAB-VALEXI,
               DFIES-NOFORKEY      TO NAMETAB-NOFORKEY,
               DFIES-CONVEXIT      TO NAMETAB-CONVEXIT.
        APPEND NAMETAB.
      ENDLOOP.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 Apr 2009 06:47:43 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-hr-infotype-operation/m-p/5533569#M1264082</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-04-29T06:47:43Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with 'HR_INFOTYPE_OPERATION'</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-hr-infotype-operation/m-p/5533570#M1264083</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;While creating the infotype did you create the 'PS Structure'?&lt;/P&gt;&lt;P&gt;And the parameter you are passing in "record" in HR_INFOTYPE_OPERATION has to be a structure type and custom infotypes generally have reference structures starting with PSxxxx. Check these two things.&lt;/P&gt;&lt;P&gt;Regards.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 Apr 2009 11:02:01 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-hr-infotype-operation/m-p/5533570#M1264083</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-04-29T11:02:01Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with 'HR_INFOTYPE_OPERATION'</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-hr-infotype-operation/m-p/5533571#M1264084</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm having the same problem on infotype 2002 insertion. The system loops in the code like an infinite loop. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How did you solve this issue ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you for your help,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 Oct 2009 07:37:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-hr-infotype-operation/m-p/5533571#M1264084</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-10-27T07:37:29Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with 'HR_INFOTYPE_OPERATION'</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-hr-infotype-operation/m-p/5533572#M1264085</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How have you declared your workarea?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Harini&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 Oct 2009 08:11:48 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-hr-infotype-operation/m-p/5533572#M1264085</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-10-27T08:11:48Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with 'HR_INFOTYPE_OPERATION'</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-hr-infotype-operation/m-p/5533573#M1264086</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Joes,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can u try create a record manualy through PA30 if hang or not.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 Oct 2009 09:03:55 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-hr-infotype-operation/m-p/5533573#M1264086</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-10-27T09:03:55Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with 'HR_INFOTYPE_OPERATION'</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-hr-infotype-operation/m-p/5533574#M1264087</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm just doing a program that load data, with this function module. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Do I have to declare the personal area in my input ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  DATA : ls_p2002 TYPE p2002,&lt;/P&gt;&lt;P&gt;               ls_stb_line LIKE LINE OF lt_stb_table. " Internal Table&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  CLEAR ls_p2002.&lt;/P&gt;&lt;P&gt;  ls_p2002-pernr = ls_stb_line-pernr.&lt;/P&gt;&lt;P&gt;  ls_p2002-begda = ls_stb_line-stbdy.&lt;/P&gt;&lt;P&gt;  ls_p2002-endda = ls_stb_line-stbdy.&lt;/P&gt;&lt;P&gt;  ls_p2002-beguz = ls_stb_line-beguz.&lt;/P&gt;&lt;P&gt;  ls_p2002-enduz = ls_stb_line-enduz.&lt;/P&gt;&lt;P&gt;  ls_p2002-stdaz = ls_stb_line-durtn.&lt;/P&gt;&lt;P&gt;  ls_p2002-versl = '7'.&lt;/P&gt;&lt;P&gt;  ls_p2002-infty = '2002'.&lt;/P&gt;&lt;P&gt;  ls_p2002-subty = '9509'.&lt;/P&gt;&lt;P&gt;  ls_p2002-aedtm = sy-datum.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you for your help,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 Oct 2009 09:19:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-hr-infotype-operation/m-p/5533574#M1264087</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-10-27T09:19:41Z</dc:date>
    </item>
  </channel>
</rss>

