2008 Mar 20 8:18 AM
Hi,
I want to use BAPI BAPI_OBJCL_GETDETAIL, to get the class details of the material.
But I am not sure how to pass the material number to this BAPI.
Could you please let me know what to pass to the parameter OBJKEY.
Thanks
Sankar
2008 Mar 20 8:59 AM
Hi ,
Build the object key like below.i.e. Concatenation of Material , Plant and Batch name.
it_object-key_field = 'MATNR'.
it_object-value_int = p_matnr.
append it_object.
it_object-key_field = 'WERKS'.
it_object-value_int = p_werks.
append it_object.
it_object-key_field = 'CHARG'.
it_object-value_int = p_charg.
append it_object.
call function 'BAPI_OBJCL_CONCATENATEKEY'
exporting
objecttable = 'MCHA'
importing
objectkey_conc = w_object
tables
objectkeytable = it_object
after this call the FM BAPI_OBJCL_GETDETAIL .
table name: MCHA
and class name , class type.
Hope this helps you.
Kind Regards,
Ravi Sankar.Z
2008 Mar 20 8:59 AM
Hi ,
Build the object key like below.i.e. Concatenation of Material , Plant and Batch name.
it_object-key_field = 'MATNR'.
it_object-value_int = p_matnr.
append it_object.
it_object-key_field = 'WERKS'.
it_object-value_int = p_werks.
append it_object.
it_object-key_field = 'CHARG'.
it_object-value_int = p_charg.
append it_object.
call function 'BAPI_OBJCL_CONCATENATEKEY'
exporting
objecttable = 'MCHA'
importing
objectkey_conc = w_object
tables
objectkeytable = it_object
after this call the FM BAPI_OBJCL_GETDETAIL .
table name: MCHA
and class name , class type.
Hope this helps you.
Kind Regards,
Ravi Sankar.Z
2008 Mar 20 9:10 AM
Hi Ravi,
Please tell me what is the table or structure we need to refer for internal table it_object.
Regards,
Sankar
2008 Mar 20 9:29 AM
Hi ,
Delcare like below.
data: w_object like bapi1003_key-object.
data: begin of it_object occurs 0.
include structure bapi1003_object_keys.
data: end of it_object.
data: p_class like klah-class,
p_klart like klah-klart.
data: begin of numtab occurs 0.
include structure bapi1003_alloc_values_num.
data: end of numtab.
holds data for charcateristics with type CHAR/DATE
data: begin of chatab occurs 0.
include structure bapi1003_alloc_values_char.
data: end of chatab.
data: begin of curtab occurs 0.
include structure bapi1003_alloc_values_curr.
data: end of curtab.
Error return table
data: begin of rettab occurs 0.
include structure bapiret2.
data: end of rettab.
Kind Regards,
Ravi Sankar.Z
2008 Mar 21 5:51 AM
Hi Ravi,
Thanks.
I need to pass only material number, so i formed 18 characters length material number with leading zeros, then i passed to the BAPI , it returns the expected characteristics for a material.
Thanks for your help.
Regards,
Sankar