Application Development 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: 

BAPI_CATIMESHEETMGR_INSERT error

Former Member
0 Kudos

I'm currently working on an integration with SAP HR, where we need to be able to submit timesheets using BAPI_CATIMESHEETMGR_INSERT. But I'm getting an error when calling the BAPI above, but I can't figure out where to start:

Missing customizing in trans ZCAT_TT_CHECK for CC  and Task Type

If you have any idea, please let me know.

Thanks

//Mikael

1 ACCEPTED SOLUTION

Former Member
0 Kudos

As it turns out, there was an OSS to include the missing paramethers to the BAPI:

Thanks for all the help!!!

Symptom

As of Release 4.70, the CATS interfaces use the fields TASKTYPE, TASKLEVEL and TASKCOMPONENT.
In the BAPIs BAPI_CATIMESHEETMGR_INSERT and BAPI_CATIMESHEETMGR_CHANGE, however, these fields are not available.

Reason and Prerequisites

These fields are actually a pure input help. Therefore, they are not absolutely required in the BAPIs.

Solution

To correct the problem, you need to change the BAPI structures and the BAPIs themselves.
BAPI structures and BAPIs are in different delivery tracks so that a complete delivery ov the correction in a Support Package is not possible.

The solution will be fully delivered in one of the next releases.

To implement this note in advance, proceed as follows:

1. Implement the attached source code corrections.

2. Start Transaction BAPI and, in the left frame, expand the 'Time Sheet' component.

3. Select the desired BAPI ('Change' or 'Insert')

4. In the right frame, select the 'Project' tab page,and create a new project as a "Project for changing existing BAPI'.

5. This is a compatible change, follow the instructions:

a) Call Transaction SE11 to make all the required DDIC changes:
For the 'Change' BAPI, structures BAPICATS3 and BAPICATS2 are relevant, for the 'Insert' BAPI, the structures BAPICATS1 and BAPICATS2 are relevant. For the affected structures, insert the following fields respectively at the end (!):

Component Component type

TASKTYPE CATSTASKTYPE

TASKLEVEL CATSTASKLEVEL

TASKCOMPONENT CATSTASKCOMPONENT

Save and activate the structures.

b) Source code corrections are not required at this point since you have already done this with point 1).

c) Regenerate the IDOCs by executing the link when you generate the 'Generate ALE interface from BAPI (BDBG)'.

Header Data



Release Status:

Released for Customer

Released on:

01.07.2004 08:40:22

Master Language:

German

Priority:

Correction with low priority

Category:

Program error

Primary Component:

CA-TS Time Sheet

26 REPLIES 26

raymond_giuseppi
Active Contributor
0 Kudos

- Can you provide message id and number ?

- Did you try to input same data via transaction CAT2

- Else look for Customizing for cost center and activity type (SPRO Controlling, Cost Center Accounting, Cost Centers /or/ Activity Types) and price/budget (KP26)

- Did you create customer checks in Enhancement CATS0003)

Regards,

Raymond

0 Kudos

- Can you provide message id and number ?

ID = Z_CATS

Number = 11

- Did you try to input same data via transaction CAT2

I'm embarrassed to say, I don't know what you mean

- Did you create customer checks in Enhancement CATS0003)

Not that I know of...

Thanks for helping you!

0 Kudos

ID = Z_CATS

This is a customer error raised by customer code, check for includes related to CA-TS enhancement on YOUR system. (Call transaction CMOD, look for project associated to enhancement starting with CATS)

You can also perform via SE91 a where-used on this message id.

NB: CAT2 is the transaction to input/maintain ca-ts time sheet in SAP. (there is also portal and other tools) - Try using this transaction to input same data than you pass to the BAPI, if you got the same error, you coded well the BAPI call, else...

Regards,

Raymond

Former Member
0 Kudos

Hi,

This is just a custom error triggered in some CAT user exits...

Why not simply do what the message suggests: Check custom transaction ZCAT_TT_CHECK for your Cost center and activity type??? If the message is correct, you just seems to use a CC/Act.Type that are not correctly maintained in this transaction...

Also, if you are not able to fix this, there is probably some functional guy around you knowing this kind of issue, no?

Kr,

Manu.

Former Member
0 Kudos

Thanks guys for all the help.

As the CATSRECORDS_IN request node does not have these preprties, should I use the EXTENSIONIN part of the request to submit these value(s)?

//Mikael

0 Kudos

Yes you have to fill the EXTENSIONIN records using structure BAPI_TE_CATSDB (which should already contain include CI_CATSDB with your customer fields)

Regards,

Raymond

0 Kudos

Thanks Raymond,

Looking at the EXTENSIONIN element, all I have is:

-EXTENSIONIN

     - BAPICATS7

          - STRUCTURE (String)     Should this be "BAPI_TE_CATSDB"?

          - VALUEPART1 (String)

          - VALUEPART2 (String)

          - VALUEPART3 (String)

          - VALUEPART4 (String)

I read this post on the forum: http://scn.sap.com/thread/1555307

According to that post there should be a te_catsdb node as well, but I can't see that one

I should also let you know, I'm calling the BAPI using Microsoft BizTalk Server, where I pass these parameters as XML:

<EXTENSIONIN>

    <BAPICATS7 xmlns="http://Microsoft.LobServices.Sap/2007/03/Types/Rfc/">

      <STRUCTURE>BAPI_TE_CATSDB</STRUCTURE>

      <VALUEPART1>4100</VALUEPART1>

      <VALUEPART2>Z001</VALUEPART2>

      <VALUEPART3></VALUEPART3>

      <VALUEPART4></VALUEPART4>

    </BAPICATS7>

  </EXTENSIONIN>

I know you've probobly never seen this, but perhaps you could have a best guess

Thank you!

//Mikael

0 Kudos

In an ABAP Unicode, you would have to code like :

DATA: wa_data TYPE bapi_te_catsdb,

      wa_extensionin TYPE bapicats7.

FIELD-SYMBOLS: <cont1> TYPE c,

               <cont2> TYPE c,

               <cont3> TYPE c,

               <cont4> TYPE c,

               <any>   TYPE c.

ASSIGN wa_data TO <any> CASTING.

ASSIGN wa_extensionin-valuepart1 TO <cont1> CASTING.

ASSIGN wa_extensionin-valuepart2 TO <cont2> CASTING.

ASSIGN wa_extensionin-valuepart3 TO <cont3> CASTING.

ASSIGN wa_extensionin-valuepart4 TO <cont4> CASTING.

TRY.

    <cont1> = <any>.

    <cont2> = <any>+240.

    <cont3> = <any>+480.

    <cont4> = <any>+720.

  CATCH cx_sy_range_out_of_bounds.

ENDTRY.

wa_extensionin-structure = 'BAPI_TE_CATSDB'.

So don't put first field in valuepart1, second in valuepart2, but get the BAPI_TE_CATSDB structure in you VB and fill individual fields, resulting in something like :

<EXTENSIONIN>

  <BAPICATS7 xmlns="http://Microsoft.LobServices.Sap/2007/03/Types/Rfc/">

    <STRUCTURE>BAPI_TE_CATSDB</STRUCTURE>

    <VALUEPART1>4100  Z001</VALUEPART1>

    <VALUEPART2></VALUEPART2>

    <VALUEPART3></VALUEPART3>

    <VALUEPART4></VALUEPART4>

  </BAPICATS7>

</EXTENSIONIN>

Check subfields correct lengths.

Regards,

Raymond

0 Kudos

Hmm... trying this approach returns and error:

Details: ErrorCode=RFC_SYS_EXCEPTION.

ErrorGroup=RFC_ERROR_SYSTEM_FAILURE.

SapErrorMessage=Unable to interpret 4100  Z001 as a number.. 

AdapterErrorMessage=Error returned by RfcCallReceiveEx while calling RFC: BAPI_CATIMESHEETMGR_INSERT.

Feels like the transaction code (ZCAT_TT_CHECK) should be mentioned somewhere...

0 Kudos

Check subfields correct lengths.

As I wrote the VB parameter must perfectly fit the structure in SAP "BAPI_TE_CATSDB" (look via SE11)

As those are customer fields, I cannot give you the exact format (I just added a space to check your "alertness" )

Regards,

Raymond

0 Kudos

Damn, I feel this is close....

Don't I need to specify I'm using ZCAT_TT_CHECK?

BTW

<STRUCTURE>BAPI_TE_CATSDB</STRUCTURE>

<VALUEPART1>4100Z001</VALUEPART1>

...still gives me an "Unable to interpret" error...

0 Kudos

I cannot know transaction ZCAT_TT_CHECK, but the error message describe it as a Custmer Customizing transaction. BAPI_CATIMESHEETMGR_INSERT is related to SAP transaction CAT2. AFAIK there are no TCODE fields in this BAPI. As BAPICATS7-VALUEPART1 is a character field of length 240, if any wrong values is input , the error will only occur during execution of the BAPI, so error mapped in RETURN parameter and not raising an RFC error. The problem my come from the xml mapping, but i dn't have tools to test this.

Can you build a small ABAP report which call the BAPI with a single test record, using EXTENSIONIN ?

Regards,

Raymond

0 Kudos

Hello Mikael,

To populate custom fields added in CATS you may take a look at this wiki:

http://wiki.sdn.sap.com/wiki/display/ERPHCM/Adding+Custom+fields+in+CATS+and+updating+them+with+BAPI...

You need to follow an order while populating this field in BAPI and has been highlighted in the wiki like row no. etc.

While working on this BAPI, most of the errors that I faced were related to configuration and as already suggested by Manu, functional consultant could easily help you with these. You would get the same error while trying to make entry from transaction CAT2.

Regards,

Kumud

0 Kudos

Thanks Kumud,

I know the length of the BAPI_TE_CATSDB is 10 characters, so from all aI understand this should be correct:

  <EXTENSIONIN>

    <BAPICATS7>

      <STRUCTURE>BAPI_TE_CATSDB</STRUCTURE>

      <VALUEPART1>      4100      Z001</VALUEPART1>

    </BAPICATS7>

  </EXTENSIONIN>

However, I don't understand where the rownumbers fit in...

"prefixed with the row count of data record in MI_RECIN to which these extended fields belong to"

This does not work either:

  <EXTENSIONIN>

    <BAPICATS7>

      <STRUCTURE>BAPI_TE_CATSDB</STRUCTURE>

      <VALUEPART1>10000041002     Z001</VALUEPART1>

    </BAPICATS7>

  </EXTENSIONIN>

I know the values (4100 & Z001) is correct to, but I get the same error...

0 Kudos

Hello Mikael,

How many records are you population in the BAPI at a time?

The extended fields that we populate via extensionin have to correspond to the one of the data records (sent in bapi via catsrecords_in) that we are trying to update.

The data sent via extensionin should be in accordance with the lengths of custom fields.

Please send a screenshot of custom fields added with their corresponding length.

What are the length's of fields in table CATSDB with values '4100' and 'Z001'?

Also why are you populating spaces in between?

Regards,

Kumud

0 Kudos

Q: How many records are you population in the BAPI at a time?

A: Only one.

Could you explain this:

"prefixed with the row count of data record in MI_RECIN to which these extended fields belong to"

Should I add a rowcount number (1) first. What would length of the row field be?

Q: The data sent via extensionin should be in accordance with the lengths of custom fields.

A: The lenght of the BAPI_TE_CATSDB is 10 characters, which I assumed was the length of each custom field (2). This is also why I've added white spaces. Given your question, I assume this was wrong?

Thank you so much for all the help!

0 Kudos

Look via SE11 to BAPI_TE_CATSDB (better post this definition here as the append structure of CATSDB)

It should contain :

- ROW : 10 character for row number

- Your ZZ-fields which must be part of CI_CATSDB

<VALUEPART1>00000000014100Z001</VALUEPART1> 


But as you wrote the structure length is 10, you did not put your customer fields in CI_CATSDB but in another append *) ? so either add an append structure to BAPI_TE_CATSDB similar to your append, or move your customer fields to CI_CATSDB. - In this case, how did you maintain those fields in CAT2 ?

Did you try to input the same data via CAT2 as I already suggested in my first answer ?

Regards,

Raymond

(*) Read also via SMOD documentation of enhancement CATS0005.

0 Kudos

Mikael,

You haven't given me the list of custom fields added in CATSDB. Below is the screenshot of structure BAPI_TE_CATSDB

Please go to the same structure in your system via SE11 and see the custom fields after the include CI_CATSDB and their lengths.

So the way VALUEPART1 has to be populated in ABAP would be like

CONCATENATE '0000000001' '4100' 'Z001' into valuepart1 where '0000000001' is the row no. and should be of length 10.

I assume the field with value is of type NUMC and length 4. I also assume field with value Z001 is of type character and length 4.

Please read the wiki link provided earlier to see some other constraints and documentation of the BAPI.

I would like to know what are you sending in Parameter CATSRECORDS_IN?

If you say that BAPI_TE_CATSDB is of 10 characters, then where are the custom fields?

Regards,

Kumud

0 Kudos

Hi Raymond,

Looks like our replies are pretty much the same.

I feel it's an error and would be seen even while entering data in CAT2. I now think there are no custom fields added. I think Mikael can try transaction KP26 to resolve this error as already said by you.

Regards,

Kumud

0 Kudos

This is beginning to feel like the longest thread in history I just hope you guys will have a Microsoft related problem in the future, in case I'll go to great length to help you!

Anyway, I've asked our SAP administrator (she has limited understanding of this), to check the CI_CATSDB, and we can't see any fields. In fact it doesn't come up searching for it using SE11.

"I think Mikael can try transaction KP26 to resolve this error". I have no idea, what this is, but hopefully I'll get in contact with an SAP dev today, and maybe he can help me out...

Thanks (again) to both of you.

0 Kudos

- For KP26 don't ask SAP, ask to co-functional.

- If no fields are in CI_CATSDB, check table CATSDB looking for append structure(s)

Regards,

Raymond

Former Member
0 Kudos

Hi experts,

Can someone please share sample code for this BAPI. I am new to ECC and am having difficulty from where to start?

Regards,

Dhruv

0 Kudos

Hello Dhruv,

I am yet to complete all the contents of this wiki but you may start looking at the different sections of it:

wiki.sdn.sap.com/wiki/display/ERPHCM/CATS+-+Inserting+records+into+CATSDB

To start with I would suggest first try directly executing the BAPI with values after reading everything available in the documentation of this BAPI. Be ready to face lot of BAPI errors which are mostly related to data issues and configuration.

Regards,

Kumud

Former Member
0 Kudos

As it turns out, there was an OSS to include the missing paramethers to the BAPI:

Thanks for all the help!!!

Symptom

As of Release 4.70, the CATS interfaces use the fields TASKTYPE, TASKLEVEL and TASKCOMPONENT.
In the BAPIs BAPI_CATIMESHEETMGR_INSERT and BAPI_CATIMESHEETMGR_CHANGE, however, these fields are not available.

Reason and Prerequisites

These fields are actually a pure input help. Therefore, they are not absolutely required in the BAPIs.

Solution

To correct the problem, you need to change the BAPI structures and the BAPIs themselves.
BAPI structures and BAPIs are in different delivery tracks so that a complete delivery ov the correction in a Support Package is not possible.

The solution will be fully delivered in one of the next releases.

To implement this note in advance, proceed as follows:

1. Implement the attached source code corrections.

2. Start Transaction BAPI and, in the left frame, expand the 'Time Sheet' component.

3. Select the desired BAPI ('Change' or 'Insert')

4. In the right frame, select the 'Project' tab page,and create a new project as a "Project for changing existing BAPI'.

5. This is a compatible change, follow the instructions:

a) Call Transaction SE11 to make all the required DDIC changes:
For the 'Change' BAPI, structures BAPICATS3 and BAPICATS2 are relevant, for the 'Insert' BAPI, the structures BAPICATS1 and BAPICATS2 are relevant. For the affected structures, insert the following fields respectively at the end (!):

Component Component type

TASKTYPE CATSTASKTYPE

TASKLEVEL CATSTASKLEVEL

TASKCOMPONENT CATSTASKCOMPONENT

Save and activate the structures.

b) Source code corrections are not required at this point since you have already done this with point 1).

c) Regenerate the IDOCs by executing the link when you generate the 'Generate ALE interface from BAPI (BDBG)'.

Header Data



Release Status:

Released for Customer

Released on:

01.07.2004 08:40:22

Master Language:

German

Priority:

Correction with low priority

Category:

Program error

Primary Component:

CA-TS Time Sheet

0 Kudos

Even I am facing the same problem. How to pass Tasktype, Tasklev, taskcom ?

In the structure of EXTENSIONIN we have to give the first field as 'BAPI_TE_CATSDB'. What about the other filed like VALUEPART1, VALUEPART2, VALUEPART3, VALUE PART4.

The BAPI is working fine if I dont pass Tasktype, Tasklev, Taskcom. I would really appreciate it if you guys could provide a code snippet to make it more clear,

Regards,

Ravi Singh

ravi_rajput
Participant
0 Kudos

Could a provide a code snippet to pass these task type, tasklev, taskcom ?

EXTENSIONIN-STRUCTURE = 'BAPI_TE_CATSDB'.

EXTENSIONIN-VALUEPART1 = 0000000001 -> Inicates sy-tabix.

What about task type, tasklev, taskcom ? Where shall i pass it ?