Skip to Content
0
Former Member
Oct 19, 2007 at 05:57 AM

Deleting the infotype 14

95 Views

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