06-18-2009 10:42 AM
Hello friends,
I'm facing the following problem : A specific BTCI wich simulates MB01 was calling another program called SAPLCTMS to update Batch classification for a Material, this program (SAPLCTMS ) seems to be not necessary after the support package Level 57 (we just installed SAP4.6C). I didn't find any note on OSS for this...
Now i'm trying to use this BAPI instead of BTCI for the Material batch classification :
CALL FUNCTION 'BAPI_OBJCL_CHANGE'
EXPORTING
objectkey = l_objnum
objecttable = 'MCH1'
classnum = 'ZGB_TIDCLASS'
classtype = '022'
status = '1'
keydate = sy-datum
TABLES
allocvaluesnumnew = t_valuesnum
allocvaluescharnew = t_valueschar
allocvaluescurrnew = t_valuescurr
return = t_return.
But its not working, it keeps asking for a batch number. I guess i'm not using the right FM ?
Any ideas about this ?
Thank you in advance for your help !
Best Regards.
Edited by: Soufiane FAYSSAL on Jun 18, 2009 11:42 AM
06-18-2009 10:48 AM
Hello
You need concatenate material number (with leading zeros) and batch number into l_objnum.
06-18-2009 10:50 AM
Hi,
Please check that the entire 18 digit material number is being passed.
Regards,
Ankur Parab
06-18-2009 11:34 AM
Concatenate is not working. And Yes its a 18 digit passed.
For example:
l_objnum(18) = p_matnr.
l_objnum+18(10) = p_charg.
I'm getting object EFT930G-001-GEN 0098765480 doesn't exist...
Any other suggestions please ?
06-18-2009 4:02 PM
Hi,
Incase you want to change the characteristics value assigned with the material for the class type as batch then you have to pass data as follows:-
CALL FUNCTION 'BAPI_OBJCL_CHANGE'
EXPORTING
objectkey = lv_object
objecttable = 'MARA'
classnum = 'ZTEST'
classtype = '023'
tables
allocvaluesnumnew = num
allocvaluescharnew = char
allocvaluescurrnew = curr
return = ret
The objectkey will just contain the 18 digit material number.
The objecttable will be MARA
The classtype will be 023 and the classnum will be the name of the class.
Regards,
Ankur Parab
06-18-2009 3:43 PM
HI,
Are you sure the class type is '022'.
It should be '023' for batch
Regards,
Ankur Parab
06-18-2009 5:33 PM
Hello Ankur,
Thank you for your help.Its 022 in my case. Here a piece of code wich i'm using :
l_objnum(18) = p_matnr.
l_objnum+18(4) = p_werks.
l_objnum+22(10) = p_charg.
CALL FUNCTION 'BAPI_OBJCL_CREATE'
EXPORTING
objectkeynew = l_objnum
objecttablenew = 'MARA'
classnumnew = 'ZGB_TIDCLASS'
classtypenew = '022'
status = '1'
* keydate = sy-datum
TABLES
allocvaluesnum = t_valuesnum
allocvalueschar = t_valueschar
allocvaluescurr = t_valuescurr
return = t_return.
After a COMIT WORK. The Batch classification is created in MSC2N with my material/Plant/Batch but the values are not even if t_valueschar table is filled with the correct values...
Moreover, after the batch classification creation, when i run a se37 with BAPI_OBJCL_GETDETAIL, its giving the values wich are not displayed in MSC2N.
Any idea ?
Thanks again.
Best Regards.
10-29-2012 1:43 PM
Hello,
I am Ashok Chelikani. I am working on the same Issue.
i am getting following message:
TYPE ID NUMBER MESSAGE
E |C1 |003 |Characteristic DIMENSIONSCOLOR not found or not valid
I |CL |736 |Assignment was not created
my procedure as follows:
CLEAR: lv_objnum.
lv_objnum = I_MSEG-MATNR.
**Get Object Details
CALL FUNCTION 'BAPI_OBJCL_GETDETAIL'
EXPORTING
objectkey = lv_objnum
objecttable = 'MARA'
classnum = 'Z_RMBCH1'
classtype = '001'
TABLES
allocvaluesnum = lt_alloc_num
allocvalueschar = lt_alloc_char
allocvaluescurr = lt_alloc_curr
return = lt_return.
IF NOT lt_return IS INITIAL.
CLEAR: lv_objnum.
lv_objnum(18) = I_MSEG-MATNR.
lv_objnum+18(10) = I_MSEG-CHARG.
CALL FUNCTION 'BAPI_OBJCL_CHANGE'
EXPORTING
objectkey = lV_objnum
objecttable = 'MCH1'
classnum = 'Z_RMBCH1'
classtype = '023'
tables
allocvaluesnumnew = lt_alloc_num
allocvaluescharnew = lt_alloc_char
allocvaluescurrnew = lt_alloc_curr
return = lt_return.
lt_return returing error message. Kindly help me.
06-18-2009 10:19 PM
06-19-2009 11:50 AM
08-25-2009 11:51 AM
08-25-2009 2:45 PM
Hello Anna,
I've wrote a classic BTCI on MSC1 using SHDB T-code.
Regards,
Soufiane
08-25-2009 2:47 PM