‎2009 Oct 08 12:43 PM
Hi Folks,
I am using the above mentioned FM to fetch the batch charctersitics.Here I came across a case where two vendors are having the same batch and same materials as well during which I want to know how to differentiate it to get the desired characateristics.I checked MCHA,MCHB and MCH1 but in vain.
FYI,we are passing material,plant and charg to fetch the data from the FM.The output of this table
Vendor A----- Charg XYZ-A
plant ABC
Vendor A----- Charg XYZ-B
plant ABC
VendorB--
plant ABC
VendorB--
plant ABC
In the above case the VARIETY is having two entries.
Any clue ?
Thanks,
K.Kiran
‎2009 Oct 08 12:54 PM
Hi Kiran!
I don't understand exactly what the problem you have. But i just give you code that i use for reading batch characterisitics.
data: lit_allocvaluesnum like BAPI1003_ALLOC_VALUES_NUM occurs 0,
lit_allocvalueschar like BAPI1003_ALLOC_VALUES_CHAR occurs 0,
lit_allocvaluescurr like BAPI1003_ALLOC_VALUES_CURR occurs 0.
data: lit_return like bapiret2 occurs 0,
data: lf_OBJEK TYPE OBJNUM,
lf_OBTAB TYPE TABELLE,
lf_KLART TYPE KLASSENART,
lf_class type klasse_d.
* Get batch object key
CALL FUNCTION 'VB_BATCH_2_CLASS_OBJECT'
EXPORTING
I_MATNR = ls_mseg-matnr
I_CHARG = ls_mseg-charg
I_WERKS = ls_mseg-werks
IMPORTING
E_OBJEK = lf_objek
E_OBTAB = lf_obtab
E_KLART = lf_klart
E_CLASS = lf_class.
* Get batch classification details
CALL FUNCTION 'BAPI_OBJCL_GETDETAIL'
EXPORTING
OBJECTKEY = lf_objek
OBJECTTABLE = lf_obtab
CLASSNUM = lf_class
CLASSTYPE = lf_klart
TABLES
allocvaluesnum = lit_allocvaluesnum
allocvalueschar = lit_allocvalueschar
allocvaluescurr = lit_allocvaluescurr
return = lit_return.
‎2009 Oct 08 1:00 PM
Petr,
Charg XYZ-A--
I passed the above entries to the FM to fetch the VARIETY where in I got two entries.I guess here there should be a concept of Validity start date and validity end date here which I was not able to figure out.MCHA,MCHB and MCH1 I checked but it didn't help me much.
‎2009 Oct 08 1:37 PM
I don't think that BAPI_OBJCL_GETDETAIL will return several characteristics, because it has an optional parameter keydate which is equal to sy-udate if is not defined. If u want to check it rigth in the database u need to look into AUSP table with CUOBJ from MCH1.