Application Development 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: 

create /change classification of a batch

Former Member
0 Kudos

HI,

I run in some trouble by using the 'BAPI_OBJCL_CREATE'.

What I try to do:

- I have a material M1 and one batch B1 (as batch of material M1) both are assigned to class "C_A".

- I read the classification data of Material and Batch from class C_A and store the values in an internal table.

- delete batch class C_A from the batch B1 (done with BAPI_OBJCL_DELETE) ; commit;

- delete batch class C_A from material M1 (done with BAPI_OBJCL_DELETE) ; commit;

- now I assign a new batch class C_B to the material M1 'BAPI_OBJCL_CREATE' (value tables are filled with data that was stored in internal table.; commit

- as last step the batch class C_B is assigned to the batch B1 by BAPI_OBJCL_CREATE too, commit

If I check my material i get the new class B. If I open the batch in MSC3N, I get a message, that the classification is inconsistent.

I found following reason for this :

MCH1 has the field cuobj_BM to hold the key for table INOB. The value in the batch is different to the value that is stored in INOB itself.(is updated in the right way after my comit.) The value that is still seen, is my old value that was valid during assignment to batch class C_A.

I checked the changedocuments of the batch B1 and I get the information about the new class C_B in changdoc of classification. I I check the changedoc of the batch itself, I see nothing. (FYI: If I do all the steps above in MSC2N /MM02 I get the update of the CU_OBJ (from INOB) in the changedoc of the batch.

Question:

Is this something normal and I have to write the change doc to the batch by myself (including cuobj_BM change) or could it be that this is a bug with ECC6? I think the BAPI_OBJCL_CREATE should make all necessary changes to the system (changedoc, INOB , MCH1)

(FYI: i run the same function in 4.6c without problems. Based on some ECC changes, it was required to do a comit after batch class is delete from batches and after material. In 4.6c I use still the old CUOBJ with the old and new class.)

Thanks a lot for your help.

Jens

3 REPLIES 3

Former Member
0 Kudos

FYI;

I updated the cuobj_bm in MCH1 manually and created the changedocuments for the batch manually also. With this additional step the inconsistency of the batch is gone and all work well.

Regards

Jens

dhirendra_pandit
Active Participant
0 Kudos

Hi Jens,

I have to do the same but for the diffrent transaction.

i my case i want to create the classification for Batch search strategy transaction code VCH1.

i had try use the function module BAPI_OBJCL_CREATE to assign the classification it shows the classification created sucessfully, but that value is not come in the transaction.

can you resilve that issue.

Regards

Dhirendra

0 Kudos

Hi,

Try to call 'BAPI_TRANSACTION_COMMIT' after all.

Best Regards,

Fabio Purcino