on 03-13-2007 10:54 PM
Hello,
Is there anybody ever used function module HR_ECM_DELETE_INFOTYPE?
How can I give the data for MESSAGE_HANDLER? Thanks.
Meiying
Just declare a variable of type IF_HRPA_MESSAGE_HANDLER and pass it to FM for message_handler.
Dont worry about data, it wont through error.
I cant say about its exact usage but cheked several standard reports with this field and all are doing the same.
Regards,
Amit
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi, Amit,
Thanks for the reply.
I tried it. But I got an error saying "Access via 'NULL' object reference not possible". My code is like below. Would you please look at it and see where is wrong? Thank you!
TABLES: pa9001.
DATA:
ls_return TYPE TABLE OF bapireturn1,
msg TYPE REF TO IF_HRPA_MESSAGE_HANDLER ,
is_ok TYPE BOOLE_D,
ls_9001 TYPE pskey.
DATA: BEGIN of lt_pa9001 Occurs 0.
INCLUDE structure pa9001.
DATA: END OF lt_pa9001.
START-OF-SELECTION.
SELECT * FROM pa9001 INTO lt_pa9001
WHERE ztitlety = 'CONTRACT'
AND begda = '20060701'
AND endda = '20060630'
AND aedtm = '20070313'
AND uname = 'MYANG1'.
IF sy-subrc = 0.
* MOVE-CORRESPONDING pa9001 to ls_9001.
MOVE lt_pa9001-pernr to ls_9001-pernr.
ls_9001-infty = '9001'.
MOVE lt_pa9001-begda to ls_9001-begda.
move lt_pa9001-endda to ls_9001-endda.
move lt_pa9001-seqnr to ls_9001-seqnr.
ENDIF.
ENDSELECT.
* MOVE lt_pa9001-pernr to ls_9001-pernr.
* MOVE lt_pa9001-begda to ls_9001-begda.
* move lt_pa9001-endda to ls_9001-endda.
* move lt_pa9001-aedtm to ls_9001-aedtm.
* move lt_pa9001-uname to ls_9001-uname.
* move lt_pa9001-subty to ls_9001-subty.
* move lt_pa9001-seqnr to ls_9001-seqnr.
* ls_9001-pernr = lt_pa9001-pernr.
* ls_9001-begda = lt_pa9001-begda.
CALL FUNCTION 'HR_ECM_DELETE_INFOTYPE'
EXPORTING
pskey = ls_9001
MESSAGE_HANDLER = msg
IMPORTING
IS_OK = is_ok.
Yeah you have to put that code before the Function call.
you can even try out this code too instead of that one.
<b>
data message_handler type ref to if_hrpa_message_handler.
data dummy_handler type ref to cl_hrpa_dummy_message_handler.
create object dummy_handler.
message_handler = dummy_handler.
</b>
Regards,
Amit
Hi, Amit,
I tried this one and commented out the formal one. The program ran through, but did not delete the records. Do you think that might be because the end date is bigger than beginning date? I could not delete those records using ZBGD_INFTY9001_REMOVE either, because it think the date range is invalid. Do you have any idea? Thank you very much!
meiying
Yes. It allows me to change all the end date records. But I have to use function module to do it instead of using directly update table. When I use HR_INFOTYPE_OPERATION to change records, it still check the date range. I am new to SAP. Do you think it is safe to change end date directly using update ... set ... in the program? Thank you!
Meiying
User | Count |
---|---|
91 | |
8 | |
7 | |
4 | |
4 | |
3 | |
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.