HRCA_COBL_CHECK - Cost Assignment Validation Checks

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.

ABAP Tips

See Also
Sort Employees As Positioned In OM Structure

Get help for your ABAP problems
Do you have a ABAP Question?

ABAP Books
ABAP Certification, BAPI, Java, Web Programming, Smart Forms, Sapscripts Reference Books

More ABAP Tips

Best regards,
SAP Basis, ABAP Programming and Other IMG Stuff
http://www.erpgreat.com

All the site contents are Copyright © www.erpgreat.com and the content authors. All rights reserved.
All product names are trademarks of their respective companies.  The site www.erpgreat.com is in no way affiliated with SAP AG. 
Every effort is made to ensure the content integrity.  Information used on this site is at your own risk. 
 The content on this site may not be reproduced or redistributed without the express written permission of 
www.erpgreat.com or the content authors.