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

Changing Material Classification with BAPI_OBJCL_CHANGE

Former Member
0 Likes
4,754

Dear all,

i am trying to change the classification for an material object, using BAPI_OBJCL_CHANGE and BAPI_TRANSACTION_COMMIT.

The values i am exporting are following;

OBJECTTABLE "MARA"

CLASSTYPE "001"

CLASSNUM "spezific classname"

OBJECTKEY "materialnumber"

and the tables

- ALLOCVALUESNUMNEW

- ALLOCVALUESCHARNEW

- ALLOCVALUESCURRNEW

after invoking both bapis, OBJCL_CHANGE returns a success-message (CL-506), the returnstructure from TRANSACTION_COMMIT is empty.

Even though a success is returned, the database is not updated.

(BAPI_OBJCL_GETDETAIL works fine with mentioned export-parameters).

Any idea about theProblem?

thanks and regards!

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
2,799

Hello Dominic,

does your material number already have a class assigned ?

If so and you like to change the class itself (not the values) please use BAPI_OBJCL_DELETE before as described in the SE37 function module doc for BAPI_OBJCL_CHANGE.

Sometimes BAPIs returns a S-message with content "I did nothing". So your result is void without getting a reason.

Best regards,

Matthias

6 REPLIES 6
Read only

RaymondGiuseppi
Active Contributor
0 Likes
2,799

Does SM13 report some errors.

(RETURN is usuall left empty by BAPI_TRANSACTION_COMMIT when WAIT  option not checked)

Regards,

Raymond

Read only

0 Likes
2,799

Hello Raymond,

SM13 reports no Errors.

Regards,

Dominic

Read only

0 Likes
2,799

Look first for available OSS notes for your version (at least one was released in April 2016)

Due to the BAPI behavior for existing data I would suggest following sequence

  • BAPI_OBJCL_GETDETAIL
  • BAPI_OBJCL_CHANGE
  • BAPI_TRANSACTION_COMMIT

Also is there any difference between values displayed in

  • CL20N/MM02
  • CL30N (this one doesn't take object dependency into account)

Regards,

Raymond

Read only

0 Likes
2,799

Hi Raymond,

this is the actually sequence im using.

Also, there is no difference between the two sights.

Regards,

Dominic

Read only

Former Member
0 Likes
2,801

Hello Dominic,

does your material number already have a class assigned ?

If so and you like to change the class itself (not the values) please use BAPI_OBJCL_DELETE before as described in the SE37 function module doc for BAPI_OBJCL_CHANGE.

Sometimes BAPIs returns a S-message with content "I did nothing". So your result is void without getting a reason.

Best regards,

Matthias

Read only

0 Likes
2,799

Hello Matthias,

i tried it both with  assigned class and without, getting the same result.

Interesting: when i use OBJCL_DELETE & COMMIT only, i get a success-message too, but the classification is not deleted.

(I am able to change the classifications manually in MM02)

Regards,

Dominic