Skip to Content
author's profile photo Former Member
Former Member

Deleting the infotype 14

Hi Gurus,

Am developing the program in which for the given subtype for the infotype 14 all the records should be deleted for that date selection. For this I write a program given below. It show that the Error 009No data stored for 0014 in the selected period Although the data is there. Please tell me where the error in my program.

&----


*& Report ZDEL14_SUBTYPE

*&

&----


*&

*&

&----


REPORT zdel14_subtype.

TABLES : pernr,

pa0014.

INFOTYPES : 0001,

0014.

DATA : BEGIN OF it_p0014 OCCURS 0.

INCLUDE STRUCTURE p0014.

DATA : END OF it_p0014.

DATA : zp0014 TYPE p0014.

SELECTION-SCREEN BEGIN OF BLOCK days1 WITH FRAME TITLE text-s02.

PARAMETER p_wage TYPE p0014-subty OBLIGATORY.

SELECTION-SCREEN END OF BLOCK days1.

DATA : return LIKE bapireturn1.

AT SELECTION-SCREEN.

IF pnpbegda IS INITIAL OR pnpendda IS INITIAL.

MESSAGE 'Enter Date' TYPE 'E'.

ENDIF.

************************************************************************

  • START-OF-SELECTION *

************************************************************************

START-OF-SELECTION.

GET pernr.

rp_provide_from_last p0001 space pnpbegda pnpendda.

PROVIDE * FROM p0014 BETWEEN pnpbegda AND pnpendda

WHERE p0014-subty EQ p_wage .

PERFORM delete14.

ENDPROVIDE.

END-OF-SELECTION.

&----


*& Form delete14

&----


  • text

----


FORM delete14.

CALL FUNCTION 'DEQUEUE_ALL' .

CALL FUNCTION 'HR_EMPLOYEE_ENQUEUE'

EXPORTING

number = p0014-pernr.

IF sy-subrc NE 0.

MESSAGE 'Unable To Insert. Release Lock Keys' TYPE 'E'.

ENDIF.

  • p0014-BETRG = 0.

CALL FUNCTION 'HR_INFOTYPE_OPERATION'

EXPORTING

infty = '0014'

number = p0014-pernr

subtype = p_wage

objectid = p0014-objps

lockindicator = p0014-sprps

validityend = p0014-endda

validitybegin = p0014-begda

recordnumber = p0014-seqnr

record = p0014

operation = 'DEL'

tclas = 'B'

dialog_mode = '0'

nocommit = ''

IMPORTING

return = return

EXCEPTIONS

OTHERS = 0.

CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.

CALL FUNCTION 'HR_EMPLOYEE_DEQUEUE'

EXPORTING

number = p0014-pernr.

IF return-number NE 0.

WRITE :/ p0014-pernr, 'IS NOT DELETED' ,return.

ENDIF.

ENDFORM. "delete14

Points will be awarded

Thanks

Ravi

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • author's profile photo Former Member
    Former Member
    Posted on Oct 19, 2007 at 06:11 AM

    Hi Gurus,

    Problem Solved by my own. i used the

    CALL FUNCTION 'HR_INFOTYPE_OPERATION'

    EXPORTING

    infty = '0014'

    number = p0014-pernr

    subtype = p_wage

    objectid = p0014-objps

    lockindicator = p0014-sprps

    validityend = p0014-endda

    validitybegin = p0014-begda

    recordnumber = p0014-seqnr

    record = p0014

    operation = 'DEL'

    tclas = 'B'

    dialog_mode = '0'

    nocommit = ''

    IMPORTING

    return = return

    EXCEPTIONS

    OTHERS = 0.

    for the function module. ITs working.

    Thanks

    Ravi

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.