cancel
Showing results for 
Search instead for 
Did you mean: 

Delete records from info type 9001

Former Member
0 Kudos
98

Hello,

Is there anybody know howt o delete records from info type 9001? Thanks a lot.

Meiying

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi there. I think you can use function module HR_INFOTYPE_OPERATION. Here is some sample code:

CALL FUNCTION 'HR_INFOTYPE_OPERATION'

EXPORTING

infty = '9001'

number = p_pernr

  • SUBTYPE =

  • OBJECTID =

  • LOCKINDICATOR =

VALIDITYEND = p_endda

VALIDITYBEGIN = p_begda

  • RECORDNUMBER =

record = P9001

operation = 'DEL'

  • TCLAS = 'A'

  • DIALOG_MODE = '0'

  • NOCOMMIT =

  • VIEW_IDENTIFIER =

  • SECONDARY_RECORD =

IMPORTING

RETURN = return

  • KEY =

.

I hope this helps.

- April King

Former Member
0 Kudos

Thanks April!

I used this function module. But it seems do not work. Here is my codes.

Please look at t and see where is wrong. Thanks a lot.

TABLES: pa9001.

DATA:
        ls_return              TYPE TABLE OF bapireturn1,
        ls_9001                TYPE p9001.
DATA:   BEGIN of lt_pa9001 Occurs 0.
          INCLUDE structure pa9001.
DATA:   END OF lt_pa9001.


START-OF-SELECTION.
    SELECT * FROM pa9001 INTO lt_pa9001
       WHERE ztitlety = 'CONTRACT'
         AND begda = '20060501'
         AND endda = '20060630'
         AND aedtm = '20070313'
         AND uname = 'MYANG1'.
     IF sy-subrc = 0.
*      MOVE-CORRESPONDING pa9001 to ls_9001.
    MOVE lt_pa9001-pernr to ls_9001-pernr.
    MOVE lt_pa9001-begda to ls_9001-begda.
    move lt_pa9001-endda to ls_9001-endda.
    move lt_pa9001-aedtm to ls_9001-aedtm.
    move lt_pa9001-uname to ls_9001-uname.
    move lt_pa9001-subty to ls_9001-subty.
    move lt_pa9001-seqnr to ls_9001-seqnr.
     ENDIF.
ENDSELECT.
      CALL FUNCTION 'ZBGD_INFTY9001_REMOVE'
        EXPORTING
          zinfty              = '9001'
          znumber             = lt_pa9001-pernr
*         ZSUBTYPE                =
*         ZOBJECTID               =
*         ZLOCKINDICATOR          =
          zvalidityend            = '99990630'
          zvaliditybegin          = '19990701'
*         ZRECORDNUMBER           =
          zrecord                 = ls_9001
          zoperation              = 'DEL'
*         ZTCLAS                  = 'A'
*         ZDIALOG_MODE            = '0'
*          ZNOCOMMIT               = 'X'
*         ZVIEW_IDENTIFIER        =
*         ZSECONDARY_RECORD       =
*        IMPORTING
*         ZKEY                    =
       TABLES
         ZRETURN                 = ls_return.

amit_khare
Active Contributor
0 Kudos

Check this FM.

HR_ECM_DELETE_INFOTYPE

Regards,

Amit

Former Member
0 Kudos

Check your begin and end dates. I think they need to match the begda and endda of your 9001 record.

- April

Former Member
0 Kudos

Yes. Thank you very much, April! It works.

Meiying

Former Member
0 Kudos

Hi, April,

My records has begda>endda. I want to delete those records. But with this function module, it does not work. Do you have any idea? Thanks.

Meiying

Former Member
0 Kudos

Try the module function:

HR_MAINTAIN_MASTER_DATA

Former Member
0 Kudos

Hi Meifing... the correct way of handling this would be first read Infotype using HR_READ_INFOTYPE or if you are usinga select query then select the Records as per the conditions in Where Clause and pass the Endda and Begda to the Function Module which you are using for deleting the infotype.

~Bhawanidutt.

Former Member
0 Kudos

Thanks for the advise. But the function module checks the valid biginning date and ending date. And my begda> endda. The function module see it is unvalid.

amit_khare
Active Contributor
0 Kudos

Hi,

Seems you are still looking for an alternative solution.

I looked for and as mentioned before there are only two options available-

1. update the BEGDA and then use FM to Delete.

2. Write report and force the delete.

Regards,

Amit

Former Member
0 Kudos

Hi, Amit,

Actually I have deleted all the records just as you suggested yesterday. I see still there are answers, I think someboy might have some other ideas for my future use. :).

Meiying

amit_khare
Active Contributor
0 Kudos

I just came to know one more solution to delete data from data base table and I think its too god if works for custom HR tables. thought of sharing with you.

Check Tcode SE14. Give the table name execute then on the next screen choose the operation.

Regards,

Amit

Former Member
0 Kudos

I don't have the authorizations to run tranzaction se14. (:. Thanks anyway!

Meiying

Former Member
0 Kudos

What about transaction SE16? You should be able to delete your records there (if you can get to it) via table PA9001.

- April

Answers (1)

Answers (1)

amit_khare
Active Contributor
0 Kudos

9001 is the custom infotype number for deleting records from that just goto PA30 and give the PERNR whose record want to delete and press on the delete button on the toolbar.

Regards,

Amit

Reward all helpful replies.

Former Member
0 Kudos

Thanks Amit for the response. But I have about 2000 records needs to be deleted. Is there any function module can do it? Would you please provide some sample program? Thanks.

Meiying