cancel
Showing results for 
Search instead for 
Did you mean: 

Re: Problem with HR_INFOTYPE_OPERATION, DELETE

Former Member
0 Kudos

Hello Friends,

I'm trying create few records from PA0105 infotype, i'm using the above FM.

When i use the Opereation DEL to delete the records, i'm not getting any error, i mean the return parameter is initial. But no records are being delted from the database table PA0105. here is the code below (it is harcoded for one emp only), please suggest:

select pernr subty begda endda usrid_long

from pa0105

into table it_pa0105

where pernr = '00001451'

and subty = '0010'

and begda ge '19000101'

and endda le '20080503'.

if sy-subrc eq 0.

loop at it_pa0105.

CALL FUNCTION 'BAPI_EMPLOYEE_ENQUEUE'

EXPORTING

NUMBER = it_pa0105-pernr.

CALL FUNCTION 'HR_INFOTYPE_OPERATION'

EXPORTING

INFTY = '0105'

NUMBER = it_pa0105-pernr

SUBTYPE = it_pa0105-subty

VALIDITYEND = it_pa0105-endda

VALIDITYBEGIN = it_pa0105-begda

RECORD = P0105

OPERATION = 'DEL'

TCLAS = 'A'

DIALOG_MODE = '0'

IMPORTING

RETURN = return.

  • KEY =

.

if return is INITIAL.

'deleted successfully'.

ENDIF.

CALL FUNCTION 'BAPI_EMPLOYEE_DEQUEUE'

EXPORTING

NUMBER = it_pa0105-pernr.

endloop.

endif.

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Just fill the p0105 structure the following way:

DATA: it_pa0105 TYPE STANDARD TABLE OF PA0105,

wa_pa0105 TYPE PA0105,

wa_p0105 TYPE P0105.

SELECT * FROM PA0105

INTO TABLE it_pa0105

WHERE blah blah.

LOOP AT it_pa0105 INTO wa_pa0105.

MOVE-CORRESPONDING wa_pa0105 TO wa_p0105.

CALL FUNCTION 'BAPI_EMPLOYEE_ENQUEUE'

EXPORTING

NUMBER = wa_pa0105-pernr.

CALL FUNCTION 'HR_INFOTYPE_OPERATION'

EXPORTING

INFTY = '0105'

NUMBER = wa_pa0105-pernr

SUBTYPE = wa_pa0105-subty

VALIDITYEND = wa_pa0105-endda

VALIDITYBEGIN = wa_pa0105-begda

RECORD = WA_P0105

OPERATION = 'DEL'

TCLAS = 'A'

DIALOG_MODE = '0'

IMPORTING

RETURN = return.

Hope it helps....

Former Member
0 Kudos

Hello Henrik,

Thanks for the update. I will modify my code

Thanks one and all who responded to this thread, all your inputs are appreciated.

Former Member
0 Kudos

Hi sai,

follow what suresh said and simulteniously

Put this into ABAP General for bette and qucik results.

Best Regars

Former Member
0 Kudos

Sai Krishna,

Once u get a dump, please go to ST22 immediately.

You will have to debug and identify the error.

suresh_datti
Active Contributor
0 Kudos

Are you sure the structure p0105 is not empty? It should have the record that needs to be deleted. Fill it up after reading pa0105.

~Suresh

Former Member
0 Kudos

Hello Suresh,

Thank you for your quick response.

there is no data coming in p0105. if i try to pass pa0105 it is giving me dump.

Former Member
0 Kudos

Hi Sai krishna

As suresh Suggested u need to fill the structure P0105 with the record you want to delete and

It is giving dump when you pass pa0105 as this is of this table PA0105 and not of type p0105(structure)

Regards,

Umesh Chaudhari

Edited by: Umesh Chaudhari on Oct 23, 2008 10:28 AM

Edited by: Umesh Chaudhari on Oct 23, 2008 10:28 AM