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

Batch Characterisitcs-QC01_BATCH_VALUES_READ-Validity date

kiran_k8
Active Contributor
0 Likes
1,094

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


Material 1234--


plant ABC

Vendor A----- Charg XYZ-B


Material 1234--


plant ABC

VendorB--


Charg XYZ-A
Material 5678
--


plant ABC

VendorB--


Charg XYZ-B
Material 5678
--


plant ABC

In the above case the VARIETY is having two entries.

Any clue ?

Thanks,

K.Kiran

3 REPLIES 3
Read only

Petr_Plenkov
Active Participant
0 Likes
748

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.

Read only

0 Likes
748

Petr,

Charg XYZ-A--


Material 5678
plant ABC
Sy-datum

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.

Read only

0 Likes
748

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.