on 10-23-2008 1:23 AM
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.
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....
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi sai,
follow what suresh said and simulteniously
Put this into ABAP General for bette and qucik results.
Best Regars
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
User | Count |
---|---|
103 | |
12 | |
11 | |
6 | |
5 | |
4 | |
3 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.