<?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: Problems copying infotypes using HR_INFOTYPE_OPERATION in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/problems-copying-infotypes-using-hr-infotype-operation/m-p/1915108#M380707</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;When i follow the link, i get a thread about converting a SmartForm to SAP Script. I don't understand how that can help me with my problem?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 01 Mar 2007 11:04:04 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-03-01T11:04:04Z</dc:date>
    <item>
      <title>Problems copying infotypes using HR_INFOTYPE_OPERATION</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problems-copying-infotypes-using-hr-infotype-operation/m-p/1915106#M380705</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi guys.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have implemented the following code in ZXPADU02 to create new instances of infotype 0002 and 0105-0010 when changing the userid on infotype 0105-0001.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
CASE innnn-infty.

  WHEN '0105'.

    DATA: lt_p0002     TYPE TABLE OF p0002,
          ls_p0002     LIKE LINE OF lt_p0002,
          lt_p0002_ret TYPE p0002 OCCURS 0 WITH HEADER LINE,
          l_return     TYPE bapireturn1,
          l_uname      LIKE sy-uname,
          lt_p0105     TYPE TABLE OF p0105,
          ls_p0105     LIKE LINE OF lt_p0105,
          lt_p0105_ret TYPE p0105 OCCURS 0 WITH HEADER LINE,
          l_usrid_long LIKE p0105-usrid_long.

    IF sy-ucomm EQ 'UPD'
    AND innnn-data1(4) = '0001'.

      CONCATENATE innnn-data1+4(30) '@xxx.dk' INTO l_usrid_long.
      CONDENSE l_usrid_long NO-GAPS.
      TRANSLATE l_usrid_long TO UPPER CASE.

      CALL FUNCTION 'HR_READ_INFOTYPE'
        EXPORTING
          pernr     = innnn-pernr
          infty     = '0105'
          begda     = innnn-begda
          endda     = innnn-endda
        TABLES
          infty_tab = lt_p0105.

      LOOP AT lt_p0105 INTO ls_p0105 WHERE subty EQ '0010'.
        IF ls_p0105-usrid_long NE l_usrid_long.
          ls_p0105-usrid_long = l_usrid_long.
          lt_p0105_ret = ls_p0105.
          IF lt_p0105_ret-begda LT innnn-begda.
            lt_p0105_ret-begda = innnn-begda.
          ENDIF.
          IF lt_p0105_ret-endda GT innnn-endda.
            lt_p0105_ret-endda = innnn-endda.
          ENDIF.
          APPEND lt_p0105_ret.
        ENDIF.
      ENDLOOP.

      IF sy-subrc NE 0.
        lt_p0105_ret = innnn.
        lt_p0105_ret-subty = '0010'.
        lt_p0105_ret-usrty = '0010'.
        CLEAR lt_p0105_ret-usrid.
        lt_p0105_ret-usrid_long = l_usrid_long.
      ENDIF.

      CALL FUNCTION 'HR_INFOTYPE_OPERATION'
        EXPORTING
          infty     = '0105'
          number    = innnn-pernr
          subtype   = '0010'
          record    = lt_p0105_ret
          operation = 'COP'
        IMPORTING
          return    = l_return.

      CALL FUNCTION 'HR_READ_INFOTYPE'
        EXPORTING
          pernr     = innnn-pernr
          infty     = '0002'
          begda     = innnn-begda
          endda     = innnn-endda
        TABLES
          infty_tab = lt_p0002.

      LOOP AT lt_p0002 INTO ls_p0002.
        IF ls_p0002-inits NE innnn-data1+4(30).
          lt_p0002_ret = ls_p0002.
          IF lt_p0002_ret-begda LT innnn-begda.
            lt_p0002_ret-begda = innnn-begda.
          ENDIF.
          IF lt_p0002_ret-endda GT innnn-endda.
            lt_p0002_ret-endda = innnn-endda.
          ENDIF.
          lt_p0002_ret-inits = innnn-data1+4(30).
          APPEND lt_p0002_ret.
        ENDIF.
      ENDLOOP.

      CALL FUNCTION 'HR_INFOTYPE_OPERATION'
        EXPORTING
          infty     = '0002'
          number    = innnn-pernr
          record    = lt_p0002_ret
          operation = 'COP'
        IMPORTING
          return    = l_return.

      COMMIT WORK.

    ENDIF.

ENDCASE.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I expect that new records will be created when saving infotype 0105-0001, and at first glance it seems to work fine - I can see the new records. The problem is, that if I leave the transaction (PA30), and start it again, the new records are gone, and infotype 0002 and 0105-0001 looks exactly like they did before I saved 0105-0001.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any thoughts?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards&lt;/P&gt;&lt;P&gt;Poul Steen Hansen, Denmark&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 Mar 2007 09:55:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problems-copying-infotypes-using-hr-infotype-operation/m-p/1915106#M380705</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-03-01T09:55:00Z</dc:date>
    </item>
    <item>
      <title>Re: Problems copying infotypes using HR_INFOTYPE_OPERATION</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problems-copying-infotypes-using-hr-infotype-operation/m-p/1915107#M380706</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;please see the below forum. I'm sure this will help you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="jive_macro jive_macro_thread" href="https://community.sap.com/" __jive_macro_name="thread" modifiedtitle="true" __default_attr="334136"&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;shamim&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 Mar 2007 10:49:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problems-copying-infotypes-using-hr-infotype-operation/m-p/1915107#M380706</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-03-01T10:49:36Z</dc:date>
    </item>
    <item>
      <title>Re: Problems copying infotypes using HR_INFOTYPE_OPERATION</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problems-copying-infotypes-using-hr-infotype-operation/m-p/1915108#M380707</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;When i follow the link, i get a thread about converting a SmartForm to SAP Script. I don't understand how that can help me with my problem?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 Mar 2007 11:04:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problems-copying-infotypes-using-hr-infotype-operation/m-p/1915108#M380707</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-03-01T11:04:04Z</dc:date>
    </item>
    <item>
      <title>Re: Problems copying infotypes using HR_INFOTYPE_OPERATION</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problems-copying-infotypes-using-hr-infotype-operation/m-p/1915109#M380708</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Have you checked in SM21 and SM13 for any further info?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 Mar 2007 11:13:01 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problems-copying-infotypes-using-hr-infotype-operation/m-p/1915109#M380708</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-03-01T11:13:01Z</dc:date>
    </item>
    <item>
      <title>Re: Problems copying infotypes using HR_INFOTYPE_OPERATION</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problems-copying-infotypes-using-hr-infotype-operation/m-p/1915110#M380709</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think that may due to the COMMIT WORK conflict.. Place the code that creates the new records ina separate Report program &amp;amp; SUBMIT that from the User exit. This might isolate the 2 workprocesses &amp;amp; effect both the COMMITs.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;~Suresh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 Mar 2007 11:13:03 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problems-copying-infotypes-using-hr-infotype-operation/m-p/1915110#M380709</guid>
      <dc:creator>suresh_datti</dc:creator>
      <dc:date>2007-03-01T11:13:03Z</dc:date>
    </item>
    <item>
      <title>Re: Problems copying infotypes using HR_INFOTYPE_OPERATION</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problems-copying-infotypes-using-hr-infotype-operation/m-p/1915111#M380710</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think you are right, but i have chosen another approach. I placed the code in a RFC enabled function module and called it with DESTINATION 'NONE' - Problem solved &lt;SPAN __jive_emoticon_name="happy"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for the input - it was a great help!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Chris: No entries in SM21 and SM13, but good thinking!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards&lt;/P&gt;&lt;P&gt;Poul Steen Hansen, Denmark&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 Mar 2007 14:39:05 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problems-copying-infotypes-using-hr-infotype-operation/m-p/1915111#M380710</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-03-01T14:39:05Z</dc:date>
    </item>
  </channel>
</rss>

