ABAP Forum
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Material Classification using BAPI_OBJCL_CREATE

iamnaveen
Participant
0 Likes
305

Hi All,

I want to create material classification using BAPI_OBJCL_CREATE (CV01N) with characteristics values. But I'm getting the below error. 'Assignment exists and is valid' .

I already have the class num and class type. But When I trying to change the values of the characteristics, I can change that value successfully using this BAPI_OBJCL_CHANGE.

Suggest me a correct and proper values to the BAPI. correct me if I'm using the wrong BAPI.

Thanks,

Naveen

Hi All,

I want to create material classification using BAPI_OBJCL_CREATE (CV01N) with characteristics values. But I'm getting the below error. 'Assignment exists and is valid' .

I already have the class num and class type. But When I trying to change the values of the characteristics, I can change that value successfully using this BAPI_OBJCL_CHANGE.

Suggest me a correct and proper values to the BAPI. correct me if I'm using the wrong BAPI.

Thanks,

Naveen

1 REPLY 1
Read only

yashoratna
Active Participant
0 Likes
17

The error 'Assignment exists and is valid' means a classification assignment already exists for this material/class/class type combination. BAPI_OBJCL_CREATE is designed to create a classification only if it does not yet exist — it will fail with this message if the assignment is already present. Please refer below link.

https://help.sap.com/docs/SUPPORT_CONTENT/sapclass/3363505960.html


The best practice is to call BAPI_OBJCL_GETDETAIL first to determine whether the assignment exists, then branch to BAPI_OBJCL_CREATE or BAPI_OBJCL_CHANGE accordingly. Check below article for detail.

https://sapabapcentral.blogspot.com/2021/12/tips-about-material-classification-mass.html