‎2007 Nov 06 4:38 AM
Hai all,
I got a problem while doing Dynamic Actions. I want to delete a record from 0105 infotype and it is through dynamic actions using function module. All things going correct but in the database table the entry was not deleted. While debugging it was giving as deleted but actually it is not deleting in database table. I hope u help me out.
Thanks,
Tara.
‎2007 Nov 06 6:29 AM
Hi tara,
pls follow the sample code.
CALL FUNCTION 'HR_INFOTYPE_OPERATION'
EXPORTING
INFTY = '0002'
NUMBER = EMPLOYEENUMBER
SUBTYPE = SUBTYPE
OBJECTID = OBJECTID
LOCKINDICATOR = LOCKINDICATOR
VALIDITYEND = VALIDITYEND
VALIDITYBEGIN = VALIDITYBEGIN
RECORDNUMBER = RECORDNUMBER
RECORD = P0002
OPERATION = DELETE
NOCOMMIT = NOCOMMIT
IMPORTING
RETURN = RETURN
EXCEPTIONS
OTHERS = 0.
change accordingly.
Or u can use FM BAPI_PERSDATA_DELETE
Regards
Srimanta
‎2007 Nov 06 4:47 AM
Hi Tara,
Can u tell what FM u r using to delete the records from infotype 0105?
If in debugging mode it is showing. So why is it not happend in ur database table?
Pls breif ur problem quickly.
Regards
Srimanta
‎2007 Nov 06 4:51 AM
Hai,
I used HR_INFOTYPE_OPERATION function module.
and in that i passed the operation as delete.
And i should not use any sql statements to delete
the records from database tables.
Thanks.
Message was edited by:
Tara Lakshmi Padala
‎2007 Nov 06 6:19 AM
Hai Srimantra,
Thanks for ur reply. Here iam sending the code where i used my function module.
Kindly check this and tell me any modifications to be done.
But here i should not use any sql statements or commands to delete the record
from database table. And this is really urgent.
Hope u all help me out.
Thank u,
Tara.
‎2007 Nov 06 6:23 AM
Hai Srimantra,
Thanks for ur response and here iam sending the code where i used the function module. and i called the subroutine from sm30.
I should not use any sql statements or commands to delete the records from database tabels. hope u will help me out.
Thank u,
Tara.
TABLES p0105.
*data: lw_0105 type p0105.
TABLES: pspar.
&----
*& Form HR_INFOTYPE_OPERATION
&----
text
----
FORM hr_infotype_operation.
DATA: l_it_pa0105 TYPE STANDARD TABLE OF pa0105.
DATA: l_it_p0105 TYPE STANDARD TABLE OF p0105.
DATA: l_p0105 TYPE p0105.
DATA: wa_pa0105 TYPE pa0105.
DATA: l_return TYPE bapireturn1.
break developer.
SELECT SINGLE * FROM pa0105 INTO CORRESPONDING FIELDS OF l_p0105
WHERE pernr EQ p0105-pernr AND
subty EQ p0105-subty AND
begda EQ p0105-begda AND
endda EQ p0105-endda AND
seqnr EQ p0105-seqnr AND
objps EQ p0105-objps AND
sprps EQ p0105-sprps.
CHECK sy-subrc EQ 0.
CALL FUNCTION 'HR_INFOTYPE_OPERATION'
EXPORTING
infty = '0105'
number = l_p0105-pernr
subtype = l_p0105-subty
objectid = l_p0105-objps
lockindicator = l_p0105-sprps
validityend = l_p0105-endda
validitybegin = l_p0105-begda
recordnumber = l_p0105-seqnr
record = l_p0105
operation = 'DEL'
TCLAS = 'A'
NOCOMMIT =
VIEW_IDENTIFIER =
SECONDARY_RECORD =
IMPORTING
return = l_return.
KEY =
MESSAGE l_return-message TYPE 'S'.
ENDFORM. "HR_INFOTYPE_OPERATION
.
‎2007 Nov 06 6:29 AM
Hi tara,
pls follow the sample code.
CALL FUNCTION 'HR_INFOTYPE_OPERATION'
EXPORTING
INFTY = '0002'
NUMBER = EMPLOYEENUMBER
SUBTYPE = SUBTYPE
OBJECTID = OBJECTID
LOCKINDICATOR = LOCKINDICATOR
VALIDITYEND = VALIDITYEND
VALIDITYBEGIN = VALIDITYBEGIN
RECORDNUMBER = RECORDNUMBER
RECORD = P0002
OPERATION = DELETE
NOCOMMIT = NOCOMMIT
IMPORTING
RETURN = RETURN
EXCEPTIONS
OTHERS = 0.
change accordingly.
Or u can use FM BAPI_PERSDATA_DELETE
Regards
Srimanta
‎2007 Nov 06 7:31 AM
Hai Srimanta,
Thanks for ur suggestion and i passed the same parameters u have given tht.
But eventhough it is not able to delete the record.
I also used the bapi which u have given but i getting the same problem.
So through tht also i am not able to delete the record.
So do u know any other way, kindly help me.
Thanks,
Tara.