What is this function module HRCA_COBL_CHECK used
for?
This function module is used
for cost assignment validation checks. You fill in all the details used
in cost assignment and it will respond you with errors.
Giving you an example if this
can be of any use to you.
data: ls_cobl type cobl_ex.
data: ls_applog type crmt_bsp_applog.
data: lt_cobl_messages type zcobl_messages_tab.
data: ls_cobl_messages type bapireturn1.
data: number_of_errors type i.
ls_cobl-glvor = 'RFBU'.
ls_cobl-vorgn = 'TRVL'.
ls_cobl-awtyp = 'TRAVL'.
ls_cobl-awkey = is_cost_assign-pernr.
ls_cobl-awpos = '00010'.
ls_cobl-budat = sy-datum.
ls_cobl-bukrs = is_cost_assign-comp_code.
ls_cobl-kostl = is_cost_assign-costcenter.
ls_cobl-aufnr = is_cost_assign-internal_order.
ls_cobl-kstrg = is_cost_assign-cost_obj.
ls_cobl-ps_posid = is_cost_assign-wbs_elemt.
ls_cobl-nplnr = is_cost_assign-network.
ls_cobl-vornr = is_cost_assign-activity.
ls_cobl-kdauf = is_cost_assign-sales_ord.
ls_cobl-kdein = '' .
ls_cobl-kdpos = is_cost_assign-s_ord_item.
call function 'HRCA_COBL_CHECK'
exporting
i_cobl = ls_cobl
importing
number_of_errors = number_of_errors
e_cobl = ls_cobl
tables
cobl_messages = lt_cobl_messages
exceptions
others = 1.
if lt_cobl_messages is not initial.
loop at lt_cobl_messages into ls_cobl_messages.
clear ls_applog.
ls_applog-msgindex = 1.
ls_applog-msgty = ls_cobl_messages-type.
ls_applog-msgid = ls_cobl_messages-id.
ls_applog-msgno = ls_cobl_messages-number.
ls_applog-msgv1 = ls_cobl_messages-message.
ls_applog-msgv2 = sy-msgv2.
ls_applog-msgv3 = sy-msgv3.
ls_applog-msgv4 = sy-msgv4.
append ls_applog to gt_applog.
endloop. |