<?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: RH_DELETE_INFTY in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/rh-delete-infty/m-p/2595980#M594583</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi check this code for changing ENDDA to 99991231.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;

data:  t1008 type table of p1008 initial size 0 with header line.

parameters:  p_otype type otype,
             p_objid type hrobjid.


CALL FUNCTION 'RH_READ_INFTY'
 EXPORTING
*   AUTHORITY                  = 'DISP'
*   WITH_STRU_AUTH             = 'X'
    PLVAR                      = '01'
   OTYPE                      = p_otype
   OBJID                      = p_objid
   INFTY                      = '1008'
   ISTAT                      = '1'
*   EXTEND                     = 'X'
*   SUBTY                      = ' '
*   BEGDA                      = '19000101'
*   ENDDA                      = '99991231'
*   CONDITION                  = '00000'
*   INFTB                      = '1'
*   SORT                       = 'X'
*   VIA_T777D                  = ' '
  TABLES
    innnn                      = t1008
*   OBJECTS                    =
 EXCEPTIONS
   ALL_INFTY_WITH_SUBTY       = 1
   NOTHING_FOUND              = 2
   NO_OBJECTS                 = 3
   WRONG_CONDITION            = 4
   WRONG_PARAMETERS           = 5
   OTHERS                     = 6
          .

check sy-subrc eq 0.


read table t1008 index 1.
t1008-endda = '99991231'.

clear: t1008[].
append t1008.

CALL FUNCTION 'RH_INSERT_INFTY'
  EXPORTING
*   FCODE                     = 'INSE'
    VTASK                     = 'S'
*   ORDER_FLG                 = 'X'
*   COMMIT_FLG                = 'X'
*   AUTHY                     = 'X'
*   PPPAR_IMP                 =
*   OLD_TABNR                 = ' '
*   REPID                     = ' '
*   FORM                      = ' '
*   KEEP_LUPD                 =
*   WORKF_ACTV                = 'X'
  TABLES
    INNNN                     = t1008
*   ILFCODE                   =
 EXCEPTIONS
   NO_AUTHORIZATION          = 1
   ERROR_DURING_INSERT       = 2
   REPID_FORM_INITIAL        = 3
   CORR_EXIT                 = 4
   BEGDA_GREATER_ENDDA       = 5
   OTHERS                    = 6
          .
IF SY-SUBRC = 0.

write:/ 'Done'.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried it and it's working..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reward if useful&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Prax&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 30 Jul 2007 20:14:00 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-07-30T20:14:00Z</dc:date>
    <item>
      <title>RH_DELETE_INFTY</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/rh-delete-infty/m-p/2595973#M594576</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have been trying to use this FM to delete infotype records but I keep getting the exception "error during Delete". &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am just trying to see what I am doing wrong. If there are multiple infotype records, can I delete all by using the start date of the first record and end date of the last record or I have to delete each record separately?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also, can anyone give me a sample on how it can be used? Currently I am trying to use it with HRP1008.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;~Mark&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 30 Jul 2007 17:56:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/rh-delete-infty/m-p/2595973#M594576</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-07-30T17:56:25Z</dc:date>
    </item>
    <item>
      <title>Re: RH_DELETE_INFTY</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/rh-delete-infty/m-p/2595974#M594577</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Check the program RPUDELPN ,this program use FM&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Check with below links:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="jive_macro jive_macro_message" href="https://community.sap.com/" __jive_macro_name="message" modifiedtitle="true" __default_attr="246180"&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="jive_macro jive_macro_message" href="https://community.sap.com/" __jive_macro_name="message" modifiedtitle="true" __default_attr="3742073"&gt;&lt;/A&gt;&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="494251"&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Seshu&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 30 Jul 2007 18:33:27 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/rh-delete-infty/m-p/2595974#M594577</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-07-30T18:33:27Z</dc:date>
    </item>
    <item>
      <title>Re: RH_DELETE_INFTY</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/rh-delete-infty/m-p/2595975#M594578</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi.. check the below code : I had used this FM and deleted the record successfully&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;


data:  t1008 type table of p1008 initial size 0 with header line.

parameters:  p_otype type otype,
             p_objid type hrobjid.


CALL FUNCTION 'RH_READ_INFTY'
 EXPORTING
*   AUTHORITY                  = 'DISP'
*   WITH_STRU_AUTH             = 'X'
    PLVAR                      = '01'
   OTYPE                      = p_otype
   OBJID                      = p_objid
   INFTY                      = '1008'
   ISTAT                      = '1'
*   EXTEND                     = 'X'
*   SUBTY                      = ' '
*   BEGDA                      = '19000101'
*   ENDDA                      = '99991231'
*   CONDITION                  = '00000'
*   INFTB                      = '1'
*   SORT                       = 'X'
*   VIA_T777D                  = ' '
  TABLES
    innnn                      = t1008
*   OBJECTS                    =
 EXCEPTIONS
   ALL_INFTY_WITH_SUBTY       = 1
   NOTHING_FOUND              = 2
   NO_OBJECTS                 = 3
   WRONG_CONDITION            = 4
   WRONG_PARAMETERS           = 5
   OTHERS                     = 6
          .

check sy-subrc eq 0.

CALL FUNCTION 'RH_DELETE_INFTY'
  EXPORTING
*   LOAD                      = 'X'
    VTASK                     = 'S'

*   ORDER_FLG                 = 'X'
*   COMMIT_FLG                = 'X'
*   AUTHY                     = 'X'
*   PPPAR_IMP                 =
*   KEEP_LUPD                 =
*   WORKF_ACTV                = 'X'
  TABLES
    INNNN                     = t1008
*   ILFCODE                   =
 EXCEPTIONS
   ERROR_DURING_DELETE       = 1
   NO_AUTHORIZATION          = 2
   DELETE_FIRST_RECORD       = 3
   CORR_EXIT                 = 4
   OTHERS                    = 5
          .
IF SY-SUBRC = 0.

write:/ 'Done'.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reward points if useful&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;Prax&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 30 Jul 2007 18:37:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/rh-delete-infty/m-p/2595975#M594578</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-07-30T18:37:49Z</dc:date>
    </item>
    <item>
      <title>Re: RH_DELETE_INFTY</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/rh-delete-infty/m-p/2595976#M594579</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Pradeep, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So basically we cannot just use an arbitrary start and end date to delete all the records between these dates, we need to first read all the records and then delete each record.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;One last thing, is it possible to take the first record and change its end date to high date using FM RH_UPDATE_INFTY? That should delete all the records in between!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;~Mark&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 30 Jul 2007 19:39:34 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/rh-delete-infty/m-p/2595976#M594579</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-07-30T19:39:34Z</dc:date>
    </item>
    <item>
      <title>Re: RH_DELETE_INFTY</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/rh-delete-infty/m-p/2595977#M594580</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Mark&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In order to read infotype records perhaps my Wiki posting may be useful:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;a href="https://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/sdn/wiki?path=/display/snippets/unified%2baccess%2bto%2ball%2bhr%2binfotypes"&amp;gt;unified Access to All HR Infotypes&amp;lt;/a&amp;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;  Uwe&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 30 Jul 2007 19:47:06 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/rh-delete-infty/m-p/2595977#M594580</guid>
      <dc:creator>uwe_schieferstein</dc:creator>
      <dc:date>2007-07-30T19:47:06Z</dc:date>
    </item>
    <item>
      <title>Re: RH_DELETE_INFTY</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/rh-delete-infty/m-p/2595978#M594581</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;yes mark.. in the table  u should have BEGDA and ENNDA along wid OBJID and OTYPE ..&lt;/P&gt;&lt;P&gt;I think... PLVAR, INFTY and SEQNR are also necessary..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Prax&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 30 Jul 2007 20:05:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/rh-delete-infty/m-p/2595978#M594581</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-07-30T20:05:51Z</dc:date>
    </item>
    <item>
      <title>Re: RH_DELETE_INFTY</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/rh-delete-infty/m-p/2595979#M594582</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think u should use RH_INSERT_INFTY in this case..&lt;/P&gt;&lt;P&gt;Read first record...  change its ENDDA to 99991231 and INSERT it..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;other records will get deleted automatically..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Prax&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 30 Jul 2007 20:08:55 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/rh-delete-infty/m-p/2595979#M594582</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-07-30T20:08:55Z</dc:date>
    </item>
    <item>
      <title>Re: RH_DELETE_INFTY</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/rh-delete-infty/m-p/2595980#M594583</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi check this code for changing ENDDA to 99991231.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;

data:  t1008 type table of p1008 initial size 0 with header line.

parameters:  p_otype type otype,
             p_objid type hrobjid.


CALL FUNCTION 'RH_READ_INFTY'
 EXPORTING
*   AUTHORITY                  = 'DISP'
*   WITH_STRU_AUTH             = 'X'
    PLVAR                      = '01'
   OTYPE                      = p_otype
   OBJID                      = p_objid
   INFTY                      = '1008'
   ISTAT                      = '1'
*   EXTEND                     = 'X'
*   SUBTY                      = ' '
*   BEGDA                      = '19000101'
*   ENDDA                      = '99991231'
*   CONDITION                  = '00000'
*   INFTB                      = '1'
*   SORT                       = 'X'
*   VIA_T777D                  = ' '
  TABLES
    innnn                      = t1008
*   OBJECTS                    =
 EXCEPTIONS
   ALL_INFTY_WITH_SUBTY       = 1
   NOTHING_FOUND              = 2
   NO_OBJECTS                 = 3
   WRONG_CONDITION            = 4
   WRONG_PARAMETERS           = 5
   OTHERS                     = 6
          .

check sy-subrc eq 0.


read table t1008 index 1.
t1008-endda = '99991231'.

clear: t1008[].
append t1008.

CALL FUNCTION 'RH_INSERT_INFTY'
  EXPORTING
*   FCODE                     = 'INSE'
    VTASK                     = 'S'
*   ORDER_FLG                 = 'X'
*   COMMIT_FLG                = 'X'
*   AUTHY                     = 'X'
*   PPPAR_IMP                 =
*   OLD_TABNR                 = ' '
*   REPID                     = ' '
*   FORM                      = ' '
*   KEEP_LUPD                 =
*   WORKF_ACTV                = 'X'
  TABLES
    INNNN                     = t1008
*   ILFCODE                   =
 EXCEPTIONS
   NO_AUTHORIZATION          = 1
   ERROR_DURING_INSERT       = 2
   REPID_FORM_INITIAL        = 3
   CORR_EXIT                 = 4
   BEGDA_GREATER_ENDDA       = 5
   OTHERS                    = 6
          .
IF SY-SUBRC = 0.

write:/ 'Done'.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried it and it's working..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reward if useful&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Prax&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 30 Jul 2007 20:14:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/rh-delete-infty/m-p/2595980#M594583</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-07-30T20:14:00Z</dc:date>
    </item>
  </channel>
</rss>

