HR_INFOTYPE_OPERATIONS    deleting infotype 2006 record

Hi I am trying to use the delete function of HR_INFOTYPE_OPERATIONS and it returns EP2                  375Record already deducted (deletion not possible).
LOOP AT it_2006 WHERE ktart NE '97'.
    CALL FUNCTION 'BAPI_EMPLOYEE_ENQUEUE'
      EXPORTING
        number = it_2006-pernr
      IMPORTING
        return = return.
    CLEAR return.
    CALL FUNCTION 'HR_INFOTYPE_OPERATION'
      EXPORTING
        INFTY         = '2006'
        number        = it_2006-pernr
        subtype       = it_2006-subty
        objectid      = it_2006-objps
        lockindicator = it_2006-sprps
        validityend   = it_2006-endda
        validitybegin = it_2006-begda
        recordnumber  = it_2006-seqnr
        record        = it_2006
        operation     = 'DEL'
        tclas         = 'A'
        DIALOG_MODE   = '0'
      IMPORTING
        return        = return
        key           = key.
    COMMIT WORK.
    CLEAR return.
    CALL FUNCTION 'BAPI_EMPLOYEE_DEQUEUE'
      EXPORTING
        number = it_2006-pernr
      IMPORTING
        return = return.
  ENDLOOP.
Please assist

Hi,
Debug the code and see for that pernr, the values passed to FM.
For the same values try doing it manually through PA30 if it gives the same error.
Regards,
Sumit

Similar Messages

  • DELETE infotype 0000  using HR_MAINTAIN_MASTERDATA or HR_INFOTYPE_OPERATION

    Please kindly help ,
    how to delete infotype using HR_MAINTAIN_MASTERDATA or HR_INFOTYPE_OPERATION?
    i did try to use HR_INFOTYPE_OPERATION but return code shown as :
    "No data stored for 0003 in the selected period"
    but when i try using HR_MAINTAIN_MASTERDATA.
    Return code was zero, and infotype 0000 still exist.
    regards,
    Rudy.

    Here you go Rudy
    Loopt at the your internal table. Lock the user, post or delete the record, unlock the user.
    CALL FUNCTION 'HR_EMPLOYEE_ENQUEUE'
          EXPORTING
            number       = t_file-pernr
          IMPORTING
            return       = t_return
            locking_user = w_uname.
        IF t_return-number IS NOT INITIAL.
          t_return-message_v1 = t_file-pernr.
          APPEND t_return.
          g_fail = g_fail + 1.
          g_flag = 'X'.
        ELSE.
          CLEAR: t_return, personaldatakey.
    CALL FUNCTION 'HR_INFOTYPE_OPERATION'
              EXPORTING
                infty         = '2006'
                number        = t_file1-pernr
                subtype       = t_file1-subty
                validityend   = t_file1-endda
                validitybegin = t_file1-begda
                record        = p2006
                operation     = 'DEL'
                dialog_mode   = '1'
                nocommit      = ' '
              IMPORTING
                return        = t_return
                key           = personaldatakey.
          IF t_return-number IS NOT INITIAL.
            t_return-message_v1 = t_file-pernr.
            APPEND t_return.
            g_fail = g_fail + 1.
            g_flag = 'X'.
          ELSE.
            MOVE-CORRESPONDING t_file TO t_file1.
            APPEND t_file1.
            g_success = g_success + 1.
          ENDIF.
          "Unlock the employee
          CALL FUNCTION 'HR_EMPLOYEE_DEQUEUE'
            EXPORTING
              number = t_file-pernr
            IMPORTING
              return = t_return.
    Please award points if useful.
    Thanks, Raj

  • Need to delimit infotype pa2006 record 'HR_INFOTYPE_OPERATION'

    Hi
    I need to delimit infotype record of infotype pa2006  in my own function module.
    start date =  01.01.2009
    delimit date = 01.01.2010
    PA2006
      SELECT * FROM PA2006 INTO IT_PA2006
                    WHERE PERNR EQ PERNR
                      AND ENDDA LE '99991231'.
      ENDSELECT.
      IF SY-SUBRC = '0'.
        WA_TAB1-INFTY = '2006'.
        WA_TAB1-FNAME = 'P2006-PERNR'.
        WA_TAB1-FVAL = IT_PA2006-PERNR.
        APPEND WA_TAB1 TO IT_TAB1.
        WA_TAB1-INFTY = '2006'.
        WA_TAB1-FNAME = 'P2006-BEGDA'.
        WA_TAB1-FVAL = IT_PA2006-BEGDA.
        APPEND WA_TAB1 TO IT_TAB1.
        WA_TAB1-INFTY = '2006'.
        WA_TAB1-FNAME = 'P2006-ENDDA'.
        WA_TAB1-FVAL = IT_PA2006-ENDDA.
        APPEND WA_TAB1 TO IT_TAB1.
        WA_TAB1-INFTY = '2006'.
        WA_TAB1-FNAME = 'P2006-KTART'.
        WA_TAB1-FVAL = IT_PA2006-KTART.
        APPEND WA_TAB1 TO IT_TAB1.
        WA_TAB1-INFTY = '2006'.
        WA_TAB1-FNAME = 'P2006-BEGUZ'.
        WA_TAB1-FVAL = IT_PA2006-BEGUZ.
        APPEND WA_TAB1 TO IT_TAB1.
        WA_TAB1-INFTY = '2006'.
        WA_TAB1-FNAME = 'P2006-ENDUZ'.
        WA_TAB1-FVAL = IT_PA2006-ENDUZ.
        APPEND WA_TAB1 TO IT_TAB1.
        WA_TAB1-INFTY = '2006'.
        WA_TAB1-FNAME = 'P2006-ANZHL'.
        WA_TAB1-FVAL = IT_PA2006-ANZHL.
        APPEND WA_TAB1 TO IT_TAB1.
        WA_TAB1-INFTY = '2006'.
        WA_TAB1-FNAME = 'P2006-DESTA'.
        WA_TAB1-FVAL = IT_PA2006-DESTA.
        APPEND WA_TAB1 TO IT_TAB1.
        WA_TAB1-INFTY = '2006'.
        WA_TAB1-FNAME = 'P2006-DEEND'.
        WA_TAB1-FVAL = IT_PA2006-DEEND.
        APPEND WA_TAB1 TO IT_TAB1.
    ENDIF.
    CALL FUNCTION 'HR_INFOTYPE_OPERATION'
      EXPORTING
        INFTY                  = 2006
        NUMBER                 = PERNR
       SUBTYPE                = IT_PA2006-SUBTY
      OBJECTID               =
      LOCKINDICATOR          =
       VALIDITYEND            = DATE
       VALIDITYBEGIN          = IT_PA2006-BEGDA
      RECORDNUMBER           =
        RECORD                 = IT_TAB1
        OPERATION              = 'MOD'
      TCLAS                  = 'A'
      DIALOG_MODE            = '0'
      NOCOMMIT               =
      VIEW_IDENTIFIER        =
      SECONDARY_RECORD       =
    IMPORTING
       RETURN                 = RETURN
      KEY                    =
    Why it is not delimit the infotype record. Let me know if any other way to do the same.

    Hi friend please do this
    "Need to lock the employee before delimiting
    CALL FUNCTION 'BAPI_EMPLOYEE_ENQUEUE'
        EXPORTING
          number        = px_infty_key-pernr
    IMPORTING
           return       = px_bapireturn.
    "in the 'HR_INFOTYPE_OPERATION' we need to specify all the details of the infotype what i have mentioned belo
      CHECK px_bapireturn-type NA 'AEX'.
      CLEAR: px_bapireturn.
      CALL FUNCTION 'HR_INFOTYPE_OPERATION'       " Updation of Employee Record
        EXPORTING
         infty                  = px_infty_key-infty
         number                 = px_infty_key-pernr
         subtype                = px_infty_key-subty
         objectid               = px_infty_key-objps
         lockindicator          = px_infty_key-sprps
         validityend            = px_infty_key-endda     "just give the date which you want to delimit with
         validitybegin          = px_infty_key-begda
         recordnumber           = px_infty_key-seqnr
         record                 = px_infty_data
         operation              = lc_mod
         tclas                  = 'A'
         dialog_mode            = '0'
         nocommit               = space
       IMPORTING
         return                 = px_bapireturn
         key                    = px_bapikey.
    "Unlock the employee after the operation
      CALL FUNCTION 'BAPI_EMPLOYEE_DEQUEUE'       " Unlock the Employee Record
        EXPORTING
          number        = px_infty_key-pernr.
    I think will will solve your problem.
    Just try it and let me know if you have any issues.
    Thanks and Regards,
    Sri Hari Anand Kumar

  • Question on Deleting infotype 15

    Hi All,
    I am creating a record in info type 15 using the function module HR_ECM_INSERT_INFOTYPE which creates a record with out any authority check.
    Similarly I need a function module to delete infotype 15 with out checking any authority i.e. no authority check.
    Can any one please suggest  a solution.
    Thanks and Regards

    I cannot see any authority skip statements in FM HR_ECM_INSERT_INFOTYPE.Probably you are Aurthorized to Insert Record in Infotype.
    Similarly I need a function module to delete infotype 15
    Are you looking for deleting the infotype of Record in infortypes?
    For deleting the records you may use HR_Infotype operation or HR_Maintain_Masterdata
    where in your case OPERATION would be DEL     Delete.

  • HR_INFOTYPE_OPERATION insert infotype 0000

    I am using HR_INFOTYPE_OPERATION to insert a new infotype 0000 record. However, if there's any future record exist, my program should not overwrite future record but delimit my current record. How can I achieve this? I tried to pass in HR_INFOTYPE_OPERATION with a new 0000 record with end date not 31.12.9999 but system return an error.

    Hi Ajay,
    When you use BDC or FM to update infotype, you can not call dynamic action as it wont be supported by SAP.
    So if you wnat to meet your requirement you have to create one RFC FM inside which you can call from the user exit or after your code had executed the FM operation and got the success message you can call the same FM for updating other infotypes.
    The best approach can be to create BDC sessions for updating each infotype after you have done with update of IT0000.
    Hope this will help you in resolving your queries.
    Regards,
    guds

  • Restore deleted Infotype

    Hello,
    one of our programs deleted to many records in one infotype (0019).
    I can see the changes with the Report "RPUAUD00".
    Is there any chance to restore the data? (records)???
    I know the date when they were deleted and the subtype of the infotype .
    Thank you for your help!

    HI,
    U have to go through the report log chenged which consists of both the data that is old data and changed data and deleted data and by whom so u can track the data which has been deleted....
    Reward if helpful,
    Regards,
    Asha

  • Delete infotype data (HR)

    Is there any standard report to delete infotype data of some employees ??
    Thanks.

    Hi maria
    You can use the FM "HR_INFOTYPE_OPERATION" to delete the employee infotype data. Uyou can find the documentation for this FM about the usage.
    ~ Ranganath
    PS : Reward points for all useful answers !

  • How to delete the double records connected to one or more than one tables in SQL 2008?

    Hi
    Can anyone please help me with the SQL query. I Im having a table called People with columns names: personno., lastname, firstname and so on. The personno. is having duplicate records,so all the duplicate records i have written with "double" in
    the beginning of the numbers. I tried deleting these double records but they are linked to one or more than one tables. I have to find out, all the tables blocking the deleting of double person. And then create select statements which creates update statements
    in order to replace the current id of double person with substitute id. (The personno. is in the form of id's in the database)
    Thanks

    You should not append "double" in the personno. When we append it will not be able to join or relate to other table. Keep the id as it is and use another field(STATUS) to mark as duplicate. Also we will require another field(PRIMARYID) against
    those duplicate rows i.e the main or the primary personno.
    SELECT * FROM OtherTable a INNER JOIN
    (SELECT personno, status, primaryid FROM PEOPLE WHERE status = 'Duplicate') b
    ON a.personno = b.personno
    UPDATE OtherTable SET personno = b.primaryid
    FROM OtherTable a INNER JOIN
    (SELECT personno, status, primaryid FROM PEOPLE WHERE status = 'Duplicate') b
    ON a.personno = b.personno
    NOTE: Please take backup before applying the query. This is not tested.
    Regards, RSingh

  • How to Delete the condition record in CRM

    HI,
    Can you please help me how to delete the condition record from condition table in CRM.
    Please explain the usage of FM CRMXIF_CONDITION_SEL_DELETE with examples.
    I have also read the documention of the function module. How to use this FM for custom defined condition table.
    (this is the code given in Documentation)
    DATA-OBJECT_REPRESENTATION         = 'E'
    DATA-SEL_OPT-CT_APPLICATION              = 'CRM'
    DATA-SEL_OPT-OBJECT_TASK                    = 'D'
    DATA-SEL_OPT-RANGE-FIELDNAME        = 'PRODUCT_ID'
    DATA-SEL_OPT-RANGE-R_SIGN                  = 'I'    (Including)
    DATA-SEL_OPT-RANGE-R_OPTION           = 'EQ'
    DATA-SEL_OPT-RANGE-R_VALUE_LOW  = 'PROD_1'
    Thanks
    Shankar

    Hi Shankar,
    I am using the same CRMXIF_CONDITION_SEL_DELETE function module to delete condition record present in CRM.
    But it is giving me below error in the return table of the FM after i run the program. Can you please correct me if I am doing any thing wrong?
    Error in  lt_return: SMW3     CND_MAST_SEL_DEL_EXT_VALIDATE     CND_M_SD
    code:
    ls_range-fieldname = 'PRODUCT_ID''.
    ls_range-R_SIGN = 'I'.
    ls_range-R_OPTION = 'EQ'.
    ls_range-R_VALUE_LOW = '123456'.
    APPEND ls_range TO lt_range.
    MOVE lt_range TO ls_entry-SEL_OPT-range.
    ls_data-SEL_OPT-object_task = 'D'.
    ls_data-SEL_OPT-ct_application = 'CRM'.
    ls_data-object_representation = 'E'.
    CALL FUNCTION 'CRMXIF_CONDITION_SEL_DELETE'
      EXPORTING
        DATA          = ls_date
    IMPORTING
       RETURN        = lt_return
    CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
      IMPORTING
        return = lt_ret.
    Edited by: Saravanaprasad Nadar on Jul 7, 2010 1:27 AM

  • APP-PAY-07201 Cannot perform a delete when child record exists in future

    I am trying to put end date to a payment method of any employee in HR/Payroll 11.5.10.2
    but receiving the following error message:
    APP-PAY-07201 Cannot perform a delete when child record exists in future
    Can u advise what steps I should follow to resolve this issue.
    Regards /Ali

    This note is related to termination of employee while our employee is on payroll and just want to change is payment method. But in the presence of existing payment method we cannot attched another becuase we are receiving an error:
    APP-PAY-07041: Priority must be unique within an orgainzational payment method

  • How to delete the material records related to storage type

    Dear SAP guru's,
    I got a situation that if the material "XXXXXX" exists in two different storage type (let say 001 & 002 ) and the material needs to be removed out of one (Let say 002) to avoid the picking and putaway in future.
    Inorder to accomplish an above requirement we tried the below cases
    Case 1: By flagged the material "XXXXXX" under storage type 002 in MM06 transaction.But it didn't restrict the system on allocating and removing the stock from /to to the storage type 002.
    Case 2:After we flagged the material for deletion under storage type 002 ,we used to MM71 transaction to archive & delete the material record that assocaited with the storage type 002 completely.
    I am kind of queiries to know if there is any other method or procedure available to delete the storage type associated material records in SAP.
    Please guide me with the other options.Thanks.
    Regards,
    John.

    Hi John,
    Its very simple, remove the Storage type indicators from the material master - Warehouse View 1 at Stock placement & Stock removal section, with this it won't pickup or place the materials in the concerned storage type.
    If you have extended this materials to more than 1 storage type, you need to do the same for all the storage types.
    Reward if it is helpful.

  • How to delete the duplicated records, not just surpress the records?

    I am new to CR. Right now I am doing a project which needs CR get query from Oracle. I got the query from Oracle. There are records with duplicated fields. For example (the following only show part of fields):
    ID    body_code  
    1            10            
    2             10            
    3             15            
    4              15           
    5              15           
    6              16           
    I need to only select records (not surpress, because I will do some caluculate later) like following:
    ID         body_code        
    1             10         
    2              15
    3               16   
    I tried to creat selection fomula in fomula workshop, shown as follows:
    onlastrecord;
    <>next
    but CR said next can be evaluated. I think it must have something to do with the print-time. So what show I do to delete the duplicated records.Thank you very much.

    Ting,
    Try this:
    Insert a group on body_code.  Then create a running total called Distinct Count.  Field to summarize -> ID, Evaluate on change of group Group # 1 Body Code, and Never Reset.
    Then insert a chart in the report header:
    In the advanced layout, select body_code on change of and select Distinct Count running total in the Show values.
    I hope I understood what you're looking to accomplish.
    Z

  • How to delete the duplicate records in a table without promary key

    I have a table that contains around 1 million records and there is no promary key or auto number coulums. I need to delete the duplicate records from this table. what is the simple effective way to do this.

    Please see this link:
    Remove duplicate records ...
    sqldevelop.wordpress.com

  • How to delete the single record from the  ODS

    HI,
       I want to DELETE  the particular record from ODS.. how to delete that..
    plz give me the solution.. it's urgent..
    with regards
    @jay

    Hi Prakash,
        You can delete a particular record from ODS by specifying the key field name in Selective deletion button available in Contents tab in the manage screen of ODS. But it will only delete the record from the active data table and not from the Change log and new data table . You should be very carefull if you are doing in Production system as there is chance of deleting other records accidentally.
    Go to Selective deletion button - > Click on delete selection -> Enter the key field values of the record you want to delete-> Press save button to save as Variant -> Go back and click on selection button -> Chosse the background job type -> Click on start button.
    Regards,
    Prakash

  • Procedure to delete mutiple table records with 1000 rows at a time

    Hello Champs,
    I am having requirement to create procedure to achive the deletes from 5 big tables. 1 master table and 4 child tables. Each table has 28 millions records. Now I have to schedule a procedure to run it on daily basis to delete approximately 500k records from each tables. But the condition is: Seperate procedures for each tables and delete only 1000 rows at a time. The plan is below. Since I am new for writing complicate procedure, I don't have much idea how to code the procedures, can some one help me to design the procedure queries. Many Thanks
    1. Fetch 1000 rows from master table with where clause condition.
    2. Match them with each child tables and delete the records.
    3. Atlast delete those 1000 rows from master table.
    4. over all commit for all 5 X 1000 records.
    5. Repeat the steps 1 to 4 till no rows to fetch from master table.
    Below are detailed procedure plan:----
    ----- Main procedure to fetch 1000 rows at a time and providing them as input to 5 different procedures to delete records, repeating same steps till no rows to fetch i.e. (i=0)-----
    Create procedure fetch_record_from_master_table:
    loop
    i = Select column1 from mastertable where <somecondition> and rowcount <= 1000;
    call procedure 1 and i rows as input;
    call procedure 2 and i rows as input;
    call procedure 3 and i rows as input;
    call procedure 4 and i rows as input;
    call procedure 5 and i rows as input;
    commit;
    exit when i=0
    end loop;
    ----- Sepereate procedure's to delete records from each child tables------
    Create procedure 1 with input:
    delete from child_table1 where column1=input rows of master table;
    Create procedure 2 with input:
    delete from child_table2 where column1=input rows of master table;
    Create procedure 3 with input:
    delete from child_table3 where column1=input rows of master table;
    Create procedure 4 with input:
    delete from child_table4 where column1=input rows of master table;
    --- procedure to delete records from master table atlast----
    Create procedure 5 with input:
    delete from Master_table where column1=input rows of master table;

    Oops, but this will work, won't it?
    begin
      execute immediate 'truncate table child_table1';
      execute immediate '  truncate table child_table2';
      execute immediate '  truncate table child_table3';
      execute immediate '  truncate table child_table4';
      for r_fk in ( select table_name, constraint_name
                    from user_constraints
                    where table_name = 'MASTER_TABLE'
                    and   constraint_type = 'R'
      loop
        execute immediate 'ALTER TABLE ' || r_fk.table_name || ' MODIFY CONSTRAINT ' || r_fk.constraint_name || ' DISABLE';
      end loop;
      execute immediate '  truncate table master_table';
      for r_fk in ( select table_name, constraint_name
                    from user_constraints
                    where table_name = 'MASTER_TABLE'
                    and   constraint_type = 'R'
      loop
        execute immediate 'ALTER TABLE ' || r_fk.table_name || ' MODIFY CONSTRAINT ' || r_fk.constraint_name || ' ENABLE';
      end loop;
    end;
    / Or
      truncate table child_table1;
      truncate table child_table2;
      truncate table child_table3;
      truncate table child_table4;
    begin
      for r_fk in ( select table_name, constraint_name
                    from user_constraints
                    where table_name = 'MASTER_TABLE'
                    and   constraint_type = 'R'
      loop
        execute immediate 'ALTER TABLE ' || r_fk.table_name || ' MODIFY CONSTRAINT ' || r_fk.constraint_name || ' DISABLE';
      end loop;
    end;
    truncate table master_table;
    begin
      for r_fk in ( select table_name, constraint_name
                    from user_constraints
                    where table_name = 'MASTER_TABLE'
                    and   constraint_type = 'R'
      loop
        execute immediate 'ALTER TABLE ' || r_fk.table_name || ' MODIFY CONSTRAINT ' || r_fk.constraint_name || ' ENABLE';
      end loop;
    end;
    /

Maybe you are looking for

  • How to generate a MSDS report from status GP (Generation possible) to RE

    Hi EHS Goeroes, I'm struggling with the Generation of the MSDS. I have done the following procedure and settings: a) Create MSDS report (CG42) b) Edit Generation Variant (CG2B) Settings: (I have assigned my template to the Generation Variant) Generat

  • FTP not working through SAP R/3 data transport

    Hi, Environment: Software: BO Data Services 3.2 DI server OS: AIX Source data from: SAP (has BODI 11.5.2 programs) After recently installing BO Data services 3.2 on the AIX box, I am able to run a dataflow with an R/3 component. This component, reads

  • Performance Management Appraisal pull position to position

    We are implementing Performance management in MSS/ESS 1.41. The requirement is to have the appraisal document (flexible) pull position to position instead of chief to position. Does anyone know where in the webdynpro this change should be made? D. Ma

  • Playing movie full-screen across two monitors?

    I have a PC with a pair of 800x600 monitors side-by-side for a dual-monitor desktop. I want to play a very wide (1600x600) QuickTime movie fullscreen across them both (not simply mirrored), with no window border or Windows taskbar visible. But when I

  • RAC: Multiple Databases / Instances with network seperation

    Dear all, We are planning to run our oracle 11g DB on RAC, with two instances both on seperate networks. Is this possible? here is what i mean Instance 1 including RAC DB is configured in e.g VLAN 12 with subnet 192.168.120.0/24. Instance 2 is config