cancel
Showing results for 
Search instead for 
Did you mean: 

How to delete a record from infotype ?

Former Member
0 Kudos

Hi All,

How to delete a record from infotype which has a time delimit 0 or 1 ?

Thanx in advance

ram

Accepted Solutions (0)

Answers (6)

Answers (6)

rainer_hbenthal
Active Contributor

see function HR_INFOTYPE_OPERATION

rajasekhar_matukumalli3
Active Participant
0 Kudos

Hi,

Small correction to the above question. Actually the record was not CREATED the day before but the BEGDA value is yesterdays date.

Former Member
0 Kudos

Moderator message - you've already asked this in it's own thread. Please do not duplicate post.

<< Removed >>

Edited by: Rob Burbank on Apr 7, 2009 1:40 PM

rajasekhar_matukumalli3
Active Participant
0 Kudos

Hi,

I am practising HR ABAP and trying to delete a record from infotype 0000 using the following code. But it is giving me an error "Entry does not exist in - check your entry".

DATA: i_return TYPE bapireturn1,

i_return2 TYPE bapireturn1,

w_p0000 TYPE p0000,

w_pernr LIKE pspar-pernr VALUE 7,

w_infty LIKE pspar-infty VALUE '0000',

w_actio LIKE pspar-actio VALUE 'DEL',

w_tclas LIKE pspar-tclas VALUE 'A',

w_begda LIKE pspar-begda,

w_endda LIKE pspar-endda VALUE '99991231'.

DATA: BEGIN OF wa_record.

INCLUDE STRUCTURE p0000.

DATA: mandt LIKE sy-mandt.

DATA: END OF wa_record.

START-OF-SELECTION.

w_begda = sy-datum - 1. "Record was created the previous day

SELECT SINGLE * FROM pa0000

INTO CORRESPONDING FIELDS OF wa_record

WHERE pernr = w_pernr.

w_p0000 = wa_record.

w_p0000-infty = '0000'.

CALL FUNCTION 'BAPI_EMPLOYEE_ENQUEUE'

EXPORTING

number = w_pernr

IMPORTING

return = i_return.

CALL FUNCTION 'HR_INFOTYPE_OPERATION'

EXPORTING

infty = w_infty

number = w_pernr

objectid = w_p0000-objps

lockindicator = w_p0000-sprps

recordnumber = w_p0000-seqnr

validityend = w_endda

validitybegin = w_begda

record = w_p0000

operation = w_actio

nocommit = 'X'

IMPORTING

return = i_return2.

COMMIT WORK.

CALL FUNCTION 'BAPI_EMPLOYEE_DEQUEUE'

EXPORTING

number = w_pernr

IMPORTING

return = i_return.

Is there some thing wrong with the code.

Former Member
0 Kudos

You can't use PP01 PP02 transactions for deleting a record with time constrains 0 and 1

You can't delete using function groups

The only way i know at this moment ,is using a sql statement ,delete for being more exactly

Former Member
0 Kudos

I stand corrected... PU00 is a useful tool for deleting Infotypes which don't have the time constraints you are talking about. HR_INFOTYPE_OPERATION is indeed the way to go (as mentioned in an earlier post) Here is a code sample, if it helps..

*--- Lock Pernr.

call function 'BAPI_EMPLOYEE_ENQUEUE'

exporting

number = Pernr

importing

return = p_i_return.

call function 'HR_INFOTYPE_OPERATION'

exporting

infty = '0000'

number = Pernr

subtype = SubType (If any)

objectid =

lockindicator =

validityend = ENDDA

validitybegin = BEGDA

recordnumber =

record = Data

operation = 'DEL'

nocommit = ''

importing

return = l_return.

call function 'BAPI_EMPLOYEE_DEQUEUE'

exporting

number = Pernr

importing

return = l_return.

Former Member
0 Kudos

Use transaction PU00 & check if it helps you.

suresh_datti
Active Contributor
0 Kudos

Hi Ram,

By 'Time Delimit' are you referring to the Time Constraints? In that case I do not of any Time Constraint 0. And as for Time constraint 1 , it must be used for all of the infotypes containing information that must be available at all times. So can you pl be more specific about your requirement?

Good Luck,

Suresh Datti