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

Custom fields Through FM BAPI_CATIMESHEETMGR_INSERT

Former Member
0 Likes
797

Hi All,

I have a requirement to create a program to punch the CATS entries through a Z program. I have got success in sending the standard field data in the CATS with the help of FM BAPI_CATIMESHEETMGR_INSERT. However I am not able to supply custom fields . I have read the documentation about the Fm but still it seems i am missing some thing. Can anybody help me out?

Regards,

Anu

3 REPLIES 3
Read only

uwe_schieferstein
Active Contributor
0 Likes
579

Hello Anurita

Obviously you know that you have to fill the TABLES parameter <b>EXTENSIONIN </b>with your custom data. The documentation of this parameter describes how to fill it:

 Customer Enhancement Import

 Description

     If you defined additional customer fields in your external application
     or external system as well as in the SAP System and you want to transfer
     data from them to the SAP System, you can use this import table. The
     additional customer fields are reproduced in the customer-specific
     fields in the CATSDB table using the BAPI_TE_CATSDB structure.

     You should enter the name of the structure in the STRUCTURE field. The
     contents of the BAPI_TE_CATSDB structure is contained in the data part.
     The data part of this table must be structured analogously to the
     BAPI_TE_CATSDB structure. The first 10 characters of the data part are
     for the line numbers. The customer fields are linked to the
     corresponding data record in the CATSRECORDS_IN table using the line
     numbers.

In order to fill custom data from a structured variable to the unstructured fields of EXTENSIONIN use the static method of <b>CL_ABAP_CONTAINER_UTILITIES</b>.

For details about its <i>static </i>methods please refer to:

Regards,

Uwe

Read only

0 Likes
579

Hi Uwe,

The class does not provide any help to me. Do you have any sample code which species wat all parameters needs to be supplied and how.

I have tried the class but it does not help me:

please look at the sample code below:

lv_struc = 'BAPI_TE_CATSDB'.

CALL METHOD cl_abap_container_utilities=>fill_container_c(

EXPORTING

im_value = lv_struc

IMPORTING

ex_container = wa_extensions-structure

).

  • wa_extensions-structure = 'BAPI_TE_CATSDB'.

CALL METHOD cl_abap_container_utilities=>fill_container_c(

EXPORTING

im_value = wa_bapi_te_catsdb

IMPORTING

ex_container = wa_extensions-valuepart1

).

  • wa_extensions-valuepart1 = wa_bapi_te_catsdb.

CHECK NOT wa_extensions IS INITIAL.

APPEND wa_extensions TO extensions.

.

.

.

.

.

CALL FUNCTION 'BAPI_CATIMESHEETMGR_INSERT'

EXPORTING

profile = lv_catsvariant

TABLES

catsrecords_in = lt_bapi_temp

extensionin = lt_extensions

return = lt_return.

Please let me know if you find any prblem in my code.

Regards,

Anu.

Read only

0 Likes
579

Hi Anu,

Did you find solution for your problem?

Please let me know the code snippet for the same if possible.

Thanks