Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Reg : Insert CATS Time Sheet Update ( bapi_catimesheetmgr_insert )

former_member227911
Participant
0 Likes
1,045

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

1 REPLY 1
Read only

RaymondGiuseppi
Active Contributor
0 Likes
721

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