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

BAPI_OBJCL_CREATE

karuna_gangireddy
Contributor
0 Likes
2,149

Hi All,

We have a requirement to change classification for the customer. I am using the BAPI 'BAPI_OBJCL_CREATE'. But i am getting an error message in return as 'Class type 011 : class BUS3060 not found'. Here is the code i am using:

v_object = itab_cust-kunnr.

v_class = 'BUS3060'.

ls_valuechar-charact = 'KUKLA'.

ls_valuechar-value_char = zkukla-low.

ls_valuechar-value_neutral = zkukla-low.

APPEND ls_valuechar to v_valuechar.

CALL FUNCTION 'BAPI_OBJCL_CREATE'

EXPORTING

OBJECTKEYNEW = v_object

OBJECTTABLENEW = 'KNA1'

CLASSNUMNEW = v_class

CLASSTYPENEW = '011'

TABLES

ALLOCVALUESNUM = v_valuenum

ALLOCVALUESCHAR = v_valuechar

ALLOCVALUESCURR = v_valuecurr

RETURN = v_return.

READ TABLE v_return into ls_return WITH KEY type = 'E'.

IF sy-subrc EQ 0.

CALL FUNCTION 'BAPI_TRANSACTION_ROLLBACK'

  • IMPORTING

  • RETURN =

.

write:/50 ' Failled'.

ELSE.

CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'

EXPORTING

wait = 'X'.

write:/10 v_object.

write:/50 'Changed Successfully'.

ENDIF.

Thanks in advance,

Karuna.

4 REPLIES 4
Read only

Former Member
0 Likes
1,723

If you want to change..should you be using 'BAPI_OBJCL_CHANGE'?

Read only

0 Likes
1,723

Correct. I thought of that. But initially we do not have any classification for the customer at all. So i chose to create. Even if the customer classification is BLANK we need to use CHANGE?

Thanks,

Karuna.

Read only

0 Likes
1,723

I changed to 'BAPI_OBJCL_CHANGE' still the same message. It is complaining about the class and object type. I have looked many forums but am not able to figure out what is wrong.

I am using classtype as '011' as the classtable is ''KNA1' and am using the class as 'BUS3060'. I am trying to change the characteristic of customer which is 'Customer class (KNA1-KUKLA)'. I am also giving this character name to CHARACT in ALLOCVALUESCHAR.

Any help or docs that help regarding this would be a great help.

Thanks,

Karuna.

Read only

0 Likes
1,723

Are you able to enter the classification with the name you mentioned in XD02 -> Extras -> Classification and save it?

If you are able to, Get the details from 'BAPI_OBJCL_GETDETAIL' and try to pass the same 'BAPI_OBJCL_CREATE' / 'BAPI_OBJCL_CHANGE' ( if it already exist ).