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

Error using BAPI_OBJCL_GETCLASSES

manuelhildemaro_ramossanc
Active Participant
0 Likes
1,814

Hi,

I have a problem using BAPI_OBJCL_GETCLASSES. This is a piece of code:

CLEAR: objectkey,

alloclist,

i_return.

CONCATENATE i_mcha-matnr i_mcha-charg INTO objectkey.

CALL FUNCTION 'BAPI_OBJCL_GETCLASSES'

EXPORTING

objectkey_imp = objectkey

objecttable_imp = objecttable

classtype_imp = classtype

TABLES

alloclist = alloclist

return = i_return.

The problem is that sometimes it function return me the class correctly and

no others (not found it).

However i test in the se37 'BAPI_OBJCL_GETCLASSES' the objectkey not found

previously and it exist.

regards,

Manuel H.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,108

I believe that while concatenating MATNR and CHARGE, it is missing leading zeroes for material. I suggest you to use CONVERSION_EXIT_MATN1_INPUT to get correct Material no, concatenate this with Batch no and then pass to the fm. Hopefully it will work.

2 REPLIES 2
Read only

Former Member
0 Likes
1,109

I believe that while concatenating MATNR and CHARGE, it is missing leading zeroes for material. I suggest you to use CONVERSION_EXIT_MATN1_INPUT to get correct Material no, concatenate this with Batch no and then pass to the fm. Hopefully it will work.

Read only

Former Member
0 Likes
1,108

Are you using a class type of '023', If yes you might have to get the objectkey first by using BAPIGETKEYOBJ.

Please search for the exact BAPI name.

Regards,

Srihari