‎2014 Mar 16 1:49 PM
Hi,
I got the Requirement to Insert the CATS by using BAPI_CATIMESHEETMGR_INSERT. Please let me know the steps to Create this CATS. And what are the Importing and Exporting Parameter needs to be Passed.
Thanks in Advance.
Regards,
Sadiq Basha K
‎2014 Mar 18 7:13 AM
The parameter are very similar to CATSDB table, small sample if you cannot guess it :
* Mapping data
loop at lt_data into ls_data.
move-corresponding ls_data to ls_catsdb_ext.
call function 'MAP2E_CATSDB_EXT_TO_BAPICATS2'
exporting
catsdb_ext = ls_catsdb_ext
changing
bapicats2 = ls_cats2.
move-corresponding ls_cats2 to ls_cats1.
ls_cats1-activity = ls_cats2-avtivity. " Thx SAP for this typo
append ls_cats1 to lt_cats1.
endloop.
* Call BAPI
call function 'BAPI_CATIMESHEETMGR_INSERT'
exporting
profile = lv_profile
testrun = space
tables
catsrecords_in = lt_cats1
return = lt_return.
* Raise error, else commit
loop at lt_return into ls_return where type = 'E' or type = 'A'.
message id ls_return-id type 'E' number ls_return-number
with ls_return-message_v1 ls_return-message_v2 ls_return-message_v3 ls_return-message_v4.
endloop.
Regards,
Raymond