‎2011 May 17 3:59 PM
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.
‎2011 May 17 4:02 PM
If you want to change..should you be using 'BAPI_OBJCL_CHANGE'?
‎2011 May 17 4:13 PM
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.
‎2011 May 19 3:16 PM
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.
‎2011 May 19 4:17 PM
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 ).