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 BAPI_BATCH_SAVE_REPLICA deleting other characteristics

former_member812225
Discoverer
0 Likes
2,414

Hi All,

We are using BAPI 'BAPI_BATCH_SAVE_REPLICA' to update the manufacturing date 'BATCHATTRIBUTES-HSDAT & BATCHATTRIBUTES-VFDAT' and parallelly it should update the corresponding batch characteristics 'LOBM_HSDAT' & 'LOBM_VFDAT'.

For batch characteristics update, have maintained the parameter 'CLASSALLOCATIONS' & CLASSVALUATIONSNUM' with below values

CLASSALLOCATIONS -

Class_type = 023

Objectkey = concatenated matnr & batch

Objecttable = MCH1

Classnum = ZCLASS

Classtype = 023

CLASSVALUATIONNUM

Class_type = 023

Objectkey = concatenated matnr & batch

Objecttable = MCH1

Charact = LOBM_VFDAT

Value_from = sy-datum

Similarly , have maintained for LOBM_HSDAT.

The manufacturing date and expiry date with batch characteristics are updated successfully but in addition it is deleting the other batch characteristics.

Please need inputs here urgently why it is deleting other batch characteristics. Is anything missing in BAPI.

Regards,

Mohammed

1 ACCEPTED SOLUTION
Read only

Dominik_Tylczynski
SAP Champion
SAP Champion
2,288

Hello shahabansari

I guess that is how BAPI_BATCH_SAVE_REPLICA works - it saves the replica of a batch, ie. saves all the batch data as transferred to the function. So if you don't transfer characteristics data when calling the function, the characteristics are not saved in the batch replica or in other words the characteristics are deleted from an existing batch.

Why don't you use BAPI_BATCH_CHANGE instead to update batch data selectively? You need to update only two batch fields i.e. expiration and manufacturing dates.

Best regards

Dominik Tylczynski

Hi All,

We are using BAPI 'BAPI_BATCH_SAVE_REPLICA' to update the manufacturing date 'BATCHATTRIBUTES-HSDAT & BATCHATTRIBUTES-VFDAT' and parallelly it should update the corresponding batch characteristics 'LOBM_HSDAT' & 'LOBM_VFDAT'.

For batch characteristics update, have maintained the parameter 'CLASSALLOCATIONS' & CLASSVALUATIONSNUM' with below values

CLASSALLOCATIONS -

Class_type = 023

Objectkey = concatenated matnr & batch

Objecttable = MCH1

Classnum = ZCLASS

Classtype = 023

CLASSVALUATIONNUM

Class_type = 023

Objectkey = concatenated matnr & batch

Objecttable = MCH1

Charact = LOBM_VFDAT

Value_from = sy-datum

Similarly , have maintained for LOBM_HSDAT.

The manufacturing date and expiry date with batch characteristics are updated successfully but in addition it is deleting the other batch characteristics.

Please need inputs here urgently why it is deleting other batch characteristics. Is anything missing in BAPI.

Regards,

Mohammed

2 REPLIES 2
Read only

Dominik_Tylczynski
SAP Champion
SAP Champion
2,289

Hello shahabansari

I guess that is how BAPI_BATCH_SAVE_REPLICA works - it saves the replica of a batch, ie. saves all the batch data as transferred to the function. So if you don't transfer characteristics data when calling the function, the characteristics are not saved in the batch replica or in other words the characteristics are deleted from an existing batch.

Why don't you use BAPI_BATCH_CHANGE instead to update batch data selectively? You need to update only two batch fields i.e. expiration and manufacturing dates.

Best regards

Dominik Tylczynski

Read only

2,288

Thanks Dominik. You are right here.

Regards,

Mohammed