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: 

How to find batch class based on material number

Former Member
0 Kudos

Hi experts,

Can any one say how to get Batch class number by giving material number as input

regards

subbu

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi Subbu,

Find the link below where there is some discussion on batch class

based on material i hope you will get your answer.

Cheers!!

VEnk@

3 REPLIES 3

Former Member
0 Kudos

Hi Subbu,

Find the link below where there is some discussion on batch class

based on material i hope you will get your answer.

Cheers!!

VEnk@

Former Member
0 Kudos

Hi ,

check in MCH1 table.....

or try this way..

By using this function module you can get the batch class related to material..


* Retrieve Material Batch Classes
  CALL FUNCTION 'CLAF_CLASSIFICATION_OF_OBJECTS'
    EXPORTING
      classtype          = zc7b1_batch_class_type
      features           = 'X'
      language           = 'E'
      object             = w_object             "Pass material Number with leading zeros
      objecttable        = 'MCH1'              "Pass table MCH1
      initial_charact    = 'X'
    TABLES
      t_class            = t_lclass             " check here what are all the classes related to material
      t_objectdata       = t_objectdata
    EXCEPTIONS
      no_classification  = 1
      no_classtypes      = 2
      invalid_class_type = 3
      OTHERS             = 4.

Prabhudas

former_member585865
Contributor
0 Kudos

Hi Subbu,

Try this Fucntion Module,


CALL FUNCTION 'BAPI_OBJCL_GETCLASSES'
    EXPORTING
      OBJECTKEY_IMP   = OBJECTKEY_IMP--------->pass your material number here
      OBJECTTABLE_IMP = 'MARA'
      CLASSTYPE_IMP   = '023'
    TABLES
      ALLOCLIST       = ALLOCLIST
      RETURN          = RETURN.
  if sy-subrc = 0.
    v_class = alloclist-classnum.
  endif.