RH_DELETE_INFTY

Hi All,
I have been trying to use this FM to delete infotype records but I keep getting the exception "error during Delete".
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?
Also, can anyone give me a sample on how it can be used? Currently I am trying to use it with HRP1008.
Thanks,
~Mark

Hi check this code for changing ENDDA to 99991231.
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.
I tried it and it's working..
Reward if useful
Regards
Prax

Similar Messages

  • RH_DELETE_INFTY:DELETE_FIRST_RECORD ISSUE in IT 7420 (talent group)

    Hello there I am trying to delete data from Infotype 7420 along with its related objects. I am getting dump DELETE_FIRST_RECORD when I try to delete data using FM RH_DELETE_INFTY. When I create IT 7420 (talent group) it create data in following tables HRP7420, HRT7420, HRP1000, HRP7430 AND HRT7430.  I also want to know if I delete data using FM RH_DELETE_INFTY from IT 7420 will it also delete data from other tables or not.
    thanks in advance for your answers.
    Mani

    Several objects don't leave us deleting them completely. Almost must exist one register because of the definition of the infotype.
    With report RHRHDL00 you can delete objects too. Test it

  • Function  RH_DELETE_INFTY

    Hi all,
         I was  trying  doing BDC  for  deletion of employee from workcentre using  Tcode CNR2 ,  but  it is not working  as the employee is not getting recorded only the cursor   is getting recorded.
      I found  document which said about RH_DELETE_INFTY  function   for deletion of employee from workcentre.  Has  anyone used this ,  if  so  can you please tell me  how to use this function  for the deletion of persons.
    if there is any otherway  apart from this  ,  your  inputs are  highly valuable.
    Regards,
    Shuja

    Hi Shuja,
            The BDC for the transaction CNR2 shouldn't have any problem. Can you mail me the screen shot of the problem you are facing and I would be able to help you with the BDC?
    Thanks and Regards,
    Sanjiv

  • Updating HRP table through abap codes - is it correct

    Hi all,
    In my hrp1001 table,I want that All Qualifications (Q) and Tasks (T) assigned to all the functional roles (ZF) existing in the system should be transferred to the positions(S) tagged to those respective functional roles.
    For that I am supposed to write a code which copies the entries from Qualifications (Q) and Tasks (T) and tag the same to the positions (S).
    Below is the sample code which is adding just one record to HRP1001 through abap statment. What I am curious to know is wheather it is logically correct to update HRP  table through abap statments or no. If not, Please let me know what should we do as a solution - should we update all records through LSMW of PP01 or any thing else we can do???
    REPORT  ZHRPAR0005 .
    TABLES: HRP1000, HRP1001.
    DATA IT_1001 LIKE HRP1001 OCCURS 5 WITH HEADER LINE..
    SELECT SINGLE * FROM HRP1001 INTO IT_1001 WHERE OTYPE = 'CP' AND PLVAR = '01' AND SCLAS NE 'S'.
    IT_1001-OTYPE = 'S'.
    APPEND IT_1001.
    INSERT INTO HRP1001 VALUES IT_1001.
    Thanks
    Ribhu

    Hi Ribhu..
    there are various FMs available for this purpose..
    use those... becasue if u directly insert, update or modify record in HRP1000 or HRP1001...
    then some related table might not be updated..
    So use FMs..
    RH_COPY_INFTY
    RH_CUT_INFTY
    RH_DELETE_INFTY
    RH_INSERT_INFTY
    RH_INVERT_RELA_INFTY
    RH_UPDATE_INFTY
    <b>For IT 1001 </b>
    RH_CUT_INFTY_1001_EXT
    RH_CUT_INFTY_1001_EXT_GENERIC
    RH_DELETE_INFTY_1001_EXT
    RH_DEL_INFTY_1001_EXT_GENERIC
    RH_INSERT_INFTY_1001_EXT
    RH_UPDATE_INFTY_1001_EXT
    RH_BASE_READ_INFTY_1001
    RH_READ_INFTY_1001
    RH_READ_INFTY_1001_EXT
    RH_READ_INFTY_1001_EXT_ONLY
    Reward if useful
    Regards
    Prax

  • Updating HRP tables through abap code- is it correct?

    Hi all,
    In my hrp1001 table,I want that All Qualifications (Q) and Tasks (T) assigned to all the functional roles (ZF) existing in the system should be transferred to the positions(S) tagged to those respective functional roles.
    For that I am supposed to write a code which copies the entries from Qualifications (Q) and Tasks (T) and tag the same to the positions (S).
    Below is the sample code which is adding just one record to HRP1001 through abap statment. What I am curious to know is wheather it is logically correct to update HRP table through abap statments or no. If not, Please let me know what should we do as a solution - should we update all records through LSMW of PP01 or any thing else we can do???
    REPORT ZHRPAR0005 .
    TABLES: HRP1000, HRP1001.
    DATA IT_1001 LIKE HRP1001 OCCURS 5 WITH HEADER LINE..
    SELECT SINGLE * FROM HRP1001 INTO IT_1001 WHERE OTYPE = 'CP' AND PLVAR = '01' AND SCLAS NE 'S'.
    IT_1001-OTYPE = 'S'.
    APPEND IT_1001.
    INSERT INTO HRP1001 VALUES IT_1001.
    Thanks
    Ribhu

    Hi Ribhu..
    there are various FMs available for this purpose..
    use those... becasue if u directly insert, update or modify record in HRP1000 or HRP1001...
    then some related table might not be updated..
    So use FMs..
    RH_COPY_INFTY
    RH_CUT_INFTY
    RH_DELETE_INFTY
    RH_INSERT_INFTY
    RH_INVERT_RELA_INFTY
    RH_UPDATE_INFTY
    For IT 1001
    RH_CUT_INFTY_1001_EXT
    RH_CUT_INFTY_1001_EXT_GENERIC
    RH_DELETE_INFTY_1001_EXT
    RH_DEL_INFTY_1001_EXT_GENERIC
    RH_INSERT_INFTY_1001_EXT
    RH_UPDATE_INFTY_1001_EXT
    RH_BASE_READ_INFTY_1001
    RH_READ_INFTY_1001
    RH_READ_INFTY_1001_EXT
    RH_READ_INFTY_1001_EXT_ONLY
    Reward if useful
    Regards
    Prax

  • Uploading data to OM infotypes

    Hi,
    Can anyone pls let me know what is the best method to upload data into infotyp hrp1051 its an OM infotype.
    AS per my search i understood PA infotype can be uploaded with HR_MAINTAIN_MASTERDATA.
    Here my doubt is Can OM infotypes also be updated using this FM or we need to go for BDC,LSMW.
    Thanks.

    HI Salini
    There are various FMs available for this purpose..
    If u directly insert, update or modify record in OM Infotpye Tables then some related table might not be updated..
    So use FMs..
    RH_COPY_INFTY
    RH_CUT_INFTY
    RH_DELETE_INFTY
    RH_INSERT_INFTY
    RH_INVERT_RELA_INFTY
    RH_UPDATE_INFTY
    For IT 1001
    RH_CUT_INFTY_1001_EXT
    RH_CUT_INFTY_1001_EXT_GENERIC
    RH_DELETE_INFTY_1001_EXT
    RH_DEL_INFTY_1001_EXT_GENERIC
    RH_INSERT_INFTY_1001_EXT
    RH_UPDATE_INFTY_1001_EXT
    RH_BASE_READ_INFTY_1001
    RH_READ_INFTY_1001
    RH_READ_INFTY_1001_EXT
    RH_READ_INFTY_1001_EXT_ONLY
    Hope this helps.
    Harsh

  • Fm to create, modify delimit the records in master data for org mag

    hi,
        There is a fm hr_infotype_operation to create, modify, delimit the records for one infotype of pernrs.
    Like this I want fm through which i can create, modify the records to master data of organisational management (OM). Whatever the infotype i will enter in that fm and data it will create a new record in OM master data. 
              If anybody know this, please tell me.
    thanks & regards,
        Sekhar.

    Hi,
    Try RH_UPDATE_INFTY.
    RH_INSERT_INFTY.
    RH_DELETE_INFTY.
    Regards,
    Dilek

  • Urgent:deleting relationship from HRP1001

    Hello,
    Is there any function module with RFC enabled to delete the relationships from HRP1001?
    can you please provide me the information ASAP.
    Regards,
    Soujanya

    U can use RH_DELETE_INFTY .. But I don't think it's RFC
    enabled ...

  • Error message return in RH_INSERT_INFTY

    Do you have any idea on how to return error messages from FM RH_INSERT_INFTY? im looking for something similar to HR_INFOTYPE_OPERATION bapi return 2.

    Just handling its Exceptions should be enough as it does not have any RETURN tables like the other ones. This is how I did it sometimes ago, you might find it helpful to refer to the below code.
    FORM update_pd_infty  USING    pt_old_pnnnn TYPE piq_p1001_t
                                   ps_new_pnnnn TYPE p1001
                          CHANGING pv_ok        TYPE boole_d.
      DATA:
        wplog_record       TYPE wplog,
        wplog_record_tab   TYPE wplog_tab.
      FIELD-SYMBOLS:
        <ls_old_pnnnn>     TYPE p1001.
    * check the old & new infotype records are not passed blank
      CHECK:
         pt_old_pnnnn IS NOT INITIAL,
         ps_new_pnnnn IS NOT INITIAL.
    * convert the Old PNNNN structure to WPLOG structure
      LOOP AT pt_old_pnnnn ASSIGNING <ls_old_pnnnn>.
        CALL METHOD cl_hrrcf_infotype=>pnnnn_to_wplog
          EXPORTING
            pnnnn = <ls_old_pnnnn>
          IMPORTING
            wplog = wplog_record.
        APPEND wplog_record TO wplog_record_tab.
      ENDLOOP.
    * delete the existing records (at buffer level only at this stage)
      CALL FUNCTION 'RH_DELETE_INFTY'
        EXPORTING
          vtask               = 'B'
          authy               = abap_false
        TABLES
          innnn               = wplog_record_tab
        EXCEPTIONS
          error_during_delete = 1
          no_authorization    = 2
          delete_first_record = 3
          corr_exit           = 4
          OTHERS              = 5.
      IF sy-subrc <> 0.
        RETURN.
      ENDIF.
      CLEAR:
        wplog_record,
        wplog_record_tab.
    * convert the New PNNNN structure to WPLOG structure
      CALL METHOD cl_hrrcf_infotype=>pnnnn_to_wplog
        EXPORTING
          pnnnn = ps_new_pnnnn
        IMPORTING
          wplog = wplog_record.
      APPEND wplog_record TO wplog_record_tab.
    * insert/create the new record (at buffer level only at this stage)
      CALL FUNCTION 'RH_INSERT_INFTY'
        EXPORTING
          vtask               = 'B'
          authy               = abap_false
        TABLES
          innnn               = wplog_record_tab
        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.
        RETURN.
      ENDIF.
    * update the database now for all buffer changes above
      CALL FUNCTION 'RH_UPDATE_DATABASE'
        EXPORTING
          vtask     = 'D'
        EXCEPTIONS
          corr_exit = 1
          OTHERS    = 2.
      IF sy-subrc <> 0.
        RETURN.
      ENDIF.
      pv_ok = abap_true.
    ENDFORM.                    " UPDATE_PD_INFTY
    Hope this helps.
    Cheers,
    Sougata.

  • Any FM to delimit record of infotype 1017 ?

    Hi Experts.
    I want to delimit the record of infotype 1017 so is there any function module to do so?
    I can do that using BDC but the problem is that I want to delimit a particular "PD Profile" which is not getting feasible using BDC.
    Thanks in Advance

    Hi ,
    since the infotype 1017 is an Organization Management infotypes you need to use the RH_*  standard function modules.
    To delimit the infotype without a BDC program you have to can use the following sequence:
    1) move the IT 1017 row to delimit into a wor area of type P1017.
    2) append the work area of point 1 into a table of type P1017.
    3) Call the FM RH_DELETE_INFTYPE using the table of point 2 as parameter.
    4) modify the end date of the local work area in point 1)
    5) repeat the step 2 using an empty internal table
    6) Call the FM  RH_INSERT_INFTY using the table of point 5 as parameter.
    7) Call the RH_UPDATE_DATABASE.
    example
    DATA: lt_p1017 TYPE TABLE OF p1017, 
                         lw_p1017 type p1017.
                 * move your data into lw_p1017  
               APPEND lw_p1017  TO lt_p1017.
            CALL FUNCTION 'RH_DELETE_INFTY'
                   EXPORTING
              *   LOAD                      = 'X'
                  vtask                        = 'B'
              *   ORDER_FLG                 = 'X'
              *   COMMIT_FLG                = 'X'
             *   AUTHY                            = 'X'
             *   PPPAR_IMP                 =
            *   KEEP_LUPD                 =
             *   WORKF_ACTV             = 'X'
              TABLES
               innnn                         = lt_p1017
         *   ILFCODE                     =
             EXCEPTIONS              
               error_during_delete       = 1
               no_authorization          = 2
               delete_first_record       = 3
               corr_exit                 = 4
            OTHERS                    = 5.
    IF sy-subrc <> 0.
       * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
      *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
       ELSE.
    hope it's helpfull,
    best regards luigi
    Edited by: luigi la motta on May 24, 2010 3:50 PM

  • Updating HRP1001 Tables.

    Hi All,
    While using MSS a manager performs a Store transfer for an employee on a particular date. In doing so a B 008 relation gets created in HRP1001 for that store number with an end date of 12/31/9999.
    The case is : If the Manager realises if he has made a mistake in the Store Name and tries to do a Store Transfer again for the same employee to a different store on the same data as above. A B008 relation does not get created for this in HRP1001.
    Also , If i try to delete an infotype record in HRP1001 , it keeps giving me an error while deleting. The FM which i am using for this is : RH_DELETE_INFTY_1001_EXT .
    Can anyone let me know how could i replace the B 008 relation which got created for the store transfer with the new store transfer B 008 relation.

    Hi,
    what error you are getting?
    check FM RH_DELETE_INFTY.
    Regards,
    Manoj.

  • DELETE EMPLOYEE RELATIONSHIP(BATCH)

    <b>HELLO TO ALL THE EXPERTS</b>,
    I HAVE A MAJOR PROBLEM.
    MY SCENARIO :
    I HAVE FETCHED THE DATA FROM<b> HRP1001</b> . USING THIS DATA I HAVE FETCHED "<b>PERNR</b>" AND CORRESPONDING "<b>ORGEH</b>" FROM <b>PA0001</b>.
    NOW, I HAVE COMPARED THE <b>HRP1001-OBJID</b> WHERE <b>OTYPE = "O"</b> WITH <b>PA0001-OBJID.</b> AND THOSE DATA WHICH DIFFER WITH RESPOECT TO THE "ORGANIZATION UNIT". AND STORED THAT DATA IN ANOTHER SEPARATE INTERNAL TABLE SAY "<b>ITAB_GLOBAL</b>".
    NOW USING THIS "<b>ITAB_GLOBAL</b>", I WANT TO DELETE ALL EXISTING RELATIONSHIPS USING A SAP STANDARD FUNC. MODULE.
    PROVIDED, ALL THE RELATIONSHIPS SHOULD BE DELETED ON SINGLE EXECUTION ONLY.
    I HAVE COME TO KNOW ONE FUNCTION "<b>RH_RELATION_DELETE</b>". BUT THE PROB WITH THIS IS IT POPS UP A DIALOGE WINDOW FOR THE CONFIRMATION OF THE DELETION, WHICH IS NOT DESIRED AS MY DATA IS VERY HUGE. I CAN NOT DO ON CLICKING FOR 1000 RECORDS.
    KINDLY LOOK INTO THIS AND PLEASE HELP.
    THANKING YOU IN ANTICIPATION.
    REGARDS,
    TEJAS

    Try RH_DELETE_INFTY.
    Regards,
    Amit

Maybe you are looking for

  • How to use variables, get results in a grid, without the Binds dialog.

    Hi all, I have recently embarked on the Oracle path, however am quite a seasoned MS SQL Server enthusiast. I would like to be able to use inline variables within my SQL Worksheet adhoc queries without having to bother with the BIND Popup window. I no

  • APEX Report Data Download in Excel and PDF format

    Hi, Can someone please guide me how to download APEX report data in Excel and PDF format.I know this is possible through BI Publisher but that is extra Licence cost for client so i don't want to use that option. Thanks in advance. Regards Prabhat Mis

  • Calculating the difference between to dates.

    All, I've a requirement where I need to calculate difference between to dates. If the given date is less than the current date, it should return '0'(zero) other wise should return 1. How can i do this? Regards, Venky

  • [Resolved][SCE 2010] Daily Health Report

    Hello everybody! I'm working in the IT support. And it turns that we cannot found the origin of one problem. I explain myself: We have many servers. For the exchange for System Center Essentials2010 and others. But since the beginning of October the

  • Menu Autoselection *PLEASE HELP*

    Hello, I am making a dvd for a client and have run into an issue. The client wants the menu to show up and audio in the background playing for 1 min. At the end of the minute, if none of the 4 options have been selected, she wants the main video to b