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

Class type 023 is not defined for object error in BAPI_OBJCL_CHANGE

Former Member
0 Likes
8,127

We have recently upgraded our SAP system. In one of our customized programs we are using the BAPI BAPI_OBJCL_CHANGE to update the characteristics of a batch. Class type is 023.

After the upgrade we get the below error::

Class type 023 is not defined for object 0000000030200023270000206979.

Here are the parameters that the calling program passed in the BAPI:

CALL FUNCTION 'BAPI_OBJCL_CHANGE'

EXPORTING

objectkey = lv_objek

objecttable = 'MCH1'

classnum = gv_class

classtype = gv_klart

TABLES

allocvaluesnumnew = lt_num2

allocvaluescharnew = lt_char2

allocvaluescurrnew = lt_curr2

return = lt_ret2.

I check the BAPI_OBJCL_CHANGE, there is a validation added after the upgrade which returns the error message:

*check wether object and class/classtype fits together begin_1260633

value1 = classtype.

value2 = OBJECTKEY.

CALL FUNCTION 'CLCA_CHECK_CLASSTYPE'

EXPORTING

CLASSTYPE = classtype

OBTAB = objecttable

EXCEPTIONS

CLASSTYPE_NOT_FOUND = 1

INVALID_CLASSTYPE = 2

  • OTHERS = 3

.

IF SY-SUBRC = 1.

CALL FUNCTION 'BALW_BAPIRETURN_GET2'

EXPORTING

type = 'E'

cl = 'CL'

number = '014' "CLASSTYPE_NOT_FOUND

par1 = value1

IMPORTING

return = return.

APPEND return.

exit.

ELSEIF SY-SUBRC = 2.

CALL FUNCTION 'BALW_BAPIRETURN_GET2'

EXPORTING

type = 'E'

cl = 'CL'

number = '650' "INVALID_CLASSTYPE

par1 = value2

par2 = value1

IMPORTING

return = return.

APPEND return.

exit.

ENDIF. " end 1260633

Is there a way to correct this error? Is there OSS note to resolve this issue? Please help. Thanks.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
5,445

Hello

Note 1272566

We have recently upgraded our SAP system. In one of our customized programs we are using the BAPI BAPI_OBJCL_CHANGE to update the characteristics of a batch. Class type is 023.

After the upgrade we get the below error::

Class type 023 is not defined for object 0000000030200023270000206979.

Here are the parameters that the calling program passed in the BAPI:

CALL FUNCTION 'BAPI_OBJCL_CHANGE'

EXPORTING

objectkey = lv_objek

objecttable = 'MCH1'

classnum = gv_class

classtype = gv_klart

TABLES

allocvaluesnumnew = lt_num2

allocvaluescharnew = lt_char2

allocvaluescurrnew = lt_curr2

return = lt_ret2.

I check the BAPI_OBJCL_CHANGE, there is a validation added after the upgrade which returns the error message:

*check wether object and class/classtype fits together begin_1260633

value1 = classtype.

value2 = OBJECTKEY.

CALL FUNCTION 'CLCA_CHECK_CLASSTYPE'

EXPORTING

CLASSTYPE = classtype

OBTAB = objecttable

EXCEPTIONS

CLASSTYPE_NOT_FOUND = 1

INVALID_CLASSTYPE = 2

  • OTHERS = 3

.

IF SY-SUBRC = 1.

CALL FUNCTION 'BALW_BAPIRETURN_GET2'

EXPORTING

type = 'E'

cl = 'CL'

number = '014' "CLASSTYPE_NOT_FOUND

par1 = value1

IMPORTING

return = return.

APPEND return.

exit.

ELSEIF SY-SUBRC = 2.

CALL FUNCTION 'BALW_BAPIRETURN_GET2'

EXPORTING

type = 'E'

cl = 'CL'

number = '650' "INVALID_CLASSTYPE

par1 = value2

par2 = value1

IMPORTING

return = return.

APPEND return.

exit.

ENDIF. " end 1260633

Is there a way to correct this error? Is there OSS note to resolve this issue? Please help. Thanks.

10 REPLIES 10
Read only

Former Member
0 Likes
5,445

Hi,

Is it because of the table MCH1?

For a material the table should be MARA i guess.

Regards,

Ankur Parab

Read only

0 Likes
5,445

Hello Ankur,

Thanks.Yes because of MCH1 table, the CLCA_CHECK_CLASSTYPE function module looks for MCHA because it is the value in TCLA table for class type 023. But the calling program pass MCH1 in the BAPI because the batch definition is that batch unique at material level.

regards,

Aida

Read only

former_member404244
Active Contributor
0 Likes
5,445

Hi,

I think is the class type 023 exists??..Please do the change of the batch information in mSC2N and see if u rable to change the batch charcatristics....

You can also try FM 'BAPI_BATCH_sAVE_REPLICA' before try to change manuallly in mSC2N and see what your are getting.

Regards,

Nagaraj

Read only

Former Member
0 Likes
5,446

Hello

Note 1272566

Read only

0 Likes
5,445

Thanks.

Read only

0 Likes
5,445

Implementing the Note 1272566 solved the problem. Thanks.._

Read only

0 Likes
5,445

Hello Aida,

just one question.

To which SAP release did you migrate to.

I see that the note is for Rel.7. I am on the way to 6 and I have the same problem ..

Best regards

FerdiM

Read only

0 Likes
5,445

Hello Ferdi,

It's Release 6.

Sorry for the late response._

Regards,

aida

Read only

0 Likes
5,445

thank you!!! after implementing note , all works perfectly!!!!!!

Read only

0 Likes
5,445

Hi Dzed,

I also facing nearly same kind of problem. the issue is we are manually entering the long text for characteristics. but after the execution of the above function module the text will updated into the table AUSP in the jumbled manner. ie., suppose my text formated to four lines then it is updated into the table AUSP with 4th line as 1st line and 3rd line as 2nd line etc...

can u guess what is the possible rot cause for this and resolution??

Thanks,

Sankar

Edited by: Shankar6688 on Jul 29, 2011 11:05 AM