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: 

Classification tab in BAPI_BATCH_SAVE_REPLICA

Former Member
0 Kudos

Hello Experts ,

I am currently using BAPI_BATCH_SAVE_REPLICA to create batch with characteristics . I have a requirement to fill characteristic name and value . The field names of the same are ATNAM and ATWRT respectively. The firld name of characteristic description is ATBEZ. Going through certain threads of SDN I have understood I need to pass values to CLASSALLOCATIONS and CLASSVALUATIONSCHAR . Inspite of doing the same I able to create a batch but without characteristics. I am posting here the values i passed please tell how to resolve this issue.

For CLASSALLOCATIONS

CLASS_TYPE 022

STATUS 1

CLASSNUM RM_LIFE_BATCH

For CLASSVALUATIONSCHAR

CLASS_TYPE 022

CHARACT TACK_LIFE

VALUE_CHAR 200

CHARACT_DESCR TACK LIFE

-Thanks

Trishna

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi!

try to set field BAPIBATCHCTRL-DOCLASSIFY = 'X'

6 REPLIES 6

Former Member
0 Kudos

Hi!

try to set field BAPIBATCHCTRL-DOCLASSIFY = 'X'

0 Kudos

Hey Andrey!

Thanks alot! Now i can see the characteristic. But , there is a slight problem while i have passed only one characteristic , it is still picking up other characteristics which are unassigned. Also , the value for given characteristic was not updated through BAPI. Please tell how to go ahead.

0 Kudos

Hey!!!

Its solved! Thank you !

former_member248300
Participant
0 Kudos

Hi Trishna,

I am facing similar issue to update classification value using BAPI: BAPI_BATCH_SAVE_REPLICA. But unable to update the same, Please can u send me your code, or what are the mandatory values need to pass in classification tables in BAPI.

Please find my code. and help me where I need to correct.

WA_BATCHCONTROLFIELDS-DOCLASSIFY = 'X'.

WA_CLASSALLOCATIONS-CLASS_TYPE = '023'.

WA_CLASSALLOCATIONS-STATUS = '1'.

WA_CLASSALLOCATIONS-CLASSNUM = 'BATCH_CLASS_RM'.

APPEND WA_CLASSALLOCATIONS TO I_CLASSALLOCATIONS.

WA_CLASSVALUATIONSCHAR-CLASS_TYPE = '023'.

WA_CLASSVALUATIONSCHAR-CHARACT = 'VOLUME'.

WA_CLASSVALUATIONSCHAR-VALUE_CHAR = '90.10'.

WA_CLASSVALUATIONSCHAR-CHARACT_DESCR = 'VOLUME'.

APPEND WA_CLASSVALUATIONSCHAR TO I_CLASSVALUATIONSCHAR.

wa_batchatt-expirydate = '20200909'.

wa_batchattx-expirydate = 'X'.

wa_batchstatus-restricted = ' '.

wa_batchstatusx-restricted = 'X'.

l_matnr = '3401031500200'.

l_charg = 'ABC0000003'.

l_werks = 'X100'.

CALL FUNCTION 'BAPI_BATCH_SAVE_REPLICA'

EXPORTING

material = l_matnr

batch = l_charg

plant = l_werks

batchattributes = wa_batchatt

batchattributesx = wa_batchattx

batchstatus = wa_batchstatus

batchstatusx = wa_batchstatusx

BATCHCONTROLFIELDS = WA_BATCHCONTROLFIELDS

TABLES

return = i_batch_ret

CLASSALLOCATIONS = I_CLASSALLOCATIONS

CLASSVALUATIONSCHAR = I_CLASSVALUATIONSCHAR.

CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.

Thanks,

Shreekant

0 Kudos

Hi Shreekant,

In addition to the data you pass, below fields

OBJECTKEY = concatenate 'Internal Material number' & plant & batch number

OBJECTTABLE = MCHA

in bothe the structures CLASSALLOCATIONS and CLASSVALUATIONSCHAR. It will udpate.

Cheers,

Luri

0 Kudos

Hi,

Can I use this FM to create batch with classification and If yes how can I do it?

Cheers,

Lechoo