2007 Jul 08 6:46 PM
Hallow
I doing an inteface to other system that log the pa and I wont to now if im in the write way?
becouse i call to fm log get detail in the first time like u see below but in all perform above the function i need to call it again .
(i call it in the first time to see what action done and take care of the log if emp hire fire or just change data in infotype)
i certain that there is better way to do that i wont help with plan.
best regards
CALL FUNCTION 'HREIC_GET_LOGGED_INFTY_CHANGES'
EXPORTING
is_log_key = is_log_key
IMPORTING
et_infty_modif = et_infty_modif. "here i get table with log
SORT et_infty_modif BY pernr bdate btime .
LOOP AT et_infty_modif INTO wa_et_infty_modif.
ON CHANGE OF wa_et_infty_modif-pernr.
ASSIGN wa_et_infty_modif-pernr TO <fs_pernr> CASTING.
CALL FUNCTION 'HR_INFOTYPE_LOG_GET_DETAIL'
EXPORTING
logged_infotype = wa_et_infty_modif
auth_check = 'X'
use_archive = ' '
TABLES
infty_tab_before = infty_tab_before
infty_tab_after = infty_tab_after
fields = fields.
*--- Check Action Hire/Fire/Change---
PERFORM action_type.
*---Take care on change infotype-----
IF <fs_action> = '1'.
PERFORM change_infotype.
ENDIF.
*---Take care on hire employee--
IF <fs_action> = '0'.
APPEND LINES OF et_infty_modif TO hire_tab.
DELETE hire_tab WHERE pernr NE <fs_pernr>.
SORT hire_tab BY infty.
READ TABLE hire_tab ASSIGNING <wa_hire_tab> WITH KEY infty = '0000'. "subrc = 0 its action
IF sy-subrc = 0.
PERFORM action.
ENDIF.
ENDIF.
*---Take care on delete records--
IF <fs_action> = '8'.
PERFORM delete_record.
ENDIF.
ENDON.
ENDLOOP.
ENDFORM.
2007 Jul 09 6:18 AM
Hi,
This is the correct way. I dont see any problems in it. Do let us know, what problem you are facing.
Best regards,
Prashant
2007 Jul 09 11:26 AM
hi Prashant
lets say i have action in log i check field massn and see which action happen
lets say hire 'A1' now i have to now if fields orgeh and stell are not empty and there
i call to function get log detail with employee for 0000 ,0001,0002....
i can avoid doing 2 times call to fm log detail in program.
Regards