GET_MATERIAL_BATCHES SAP Method Create Batch List for a Material









Below is documentation, parameters and attributes of ABAP Method GET_MATERIAL_BATCHES within SAP class /IAM/CL_ACCESS_ERP_CHA. There is also a number of example ABAP code snipts to help you use the functionality of this method.

This method is available within SAP systems depending on your version and release level, you can view further information by entering the class name /IAM/CL_ACCESS_ERP_CHA into the relevant SAP transactions such as SE24 or SE80, and then selecting the method you are interested in.


Method Type - Instance

This is an Instance Method so needs to be instantiated first before you can access any of the methods. I.e. you need to create a local variable of TYPE ref to the class.

The following technical details of method GET_MATERIAL_BATCHES can also be found below:

  • Importing parameters
  • Exporting parameters
  • Changing parameters
  • Returning parameters
  • Exceptions
  • Coding Examples


Parameters of Method GET_MATERIAL_BATCHES

.

NameTypeData TypeDescriptionDefault Value
IS_MATERIAL_EVGImportingTYPE
BAPIMGVMATNR
Bapie Structure for transfer of external material no, ver.,
IV_AVAILABLEDATEFROMImportingTYPE
BAPICHARG1-AVAILABLE
Availability date
IV_AVAILABLEDATETOImportingTYPE
BAPICHARG1-AVAILABLE
Availability date
IV_BATCHNUMBERImportingTYPE
BAPICHARG1-BATCH
Batch Number
IV_DESTINATIONImportingTYPE
RFC_DEST
SAPOSCOL destination
IV_EXPIRYDATEFROMImportingTYPE
BAPICHARG1-EXPIRYDATE
Shelf Life Expiration or Best-Before Date
IV_EXPIRYDATETOImportingTYPE
BAPICHARG1-EXPIRYDATE
Shelf Life Expiration or Best-Before Date
IV_MATERIALImportingTYPE
BAPICHARG1-MATERIAL
Material Number (18 Characters, Compatibility Mode)
IV_MATERIAL_LONGImportingTYPE
BAPICHARG1-MATERIAL_LONG
Material Number (40 Characters, required for techn. reasons)
IV_PLANTImportingTYPE
BAPICHARG1-PLANT
Plant
ES_RETURNExportingTYPE
BAPIRETURN
Return Parameter
ET_BATCHESExportingTYPE
TT_BATCHES
Transfer structure for batches (without stock)
EV_SYSUBRCExportingTYPE
SY-SUBRC
ABAP System Field: Return Code of ABAP Statements



Exceptions of Method GET_MATERIAL_BATCHES

This method does not have any exceptions

Example ABAP coding


DATA: lo_class TYPE REF TO /IAM/CL_ACCESS_ERP_CHA.
DATA: lv_ES_RETURN TYPE BAPIRETURN,
lv_ET_BATCHES TYPE TT_BATCHES,
lv_EV_SYSUBRC TYPE SY-SUBRC,
lv_IS_MATERIAL_EVG TYPE BAPIMGVMATNR,
lv_IV_AVAILABLEDATEFROM TYPE BAPICHARG1-AVAILABLE,
lv_IV_AVAILABLEDATETO TYPE BAPICHARG1-AVAILABLE,
lv_IV_BATCHNUMBER TYPE BAPICHARG1-BATCH,
lv_IV_DESTINATION TYPE RFC_DEST,
lv_IV_EXPIRYDATEFROM TYPE BAPICHARG1-EXPIRYDATE,
lv_IV_EXPIRYDATETO TYPE BAPICHARG1-EXPIRYDATE,
lv_IV_MATERIAL TYPE BAPICHARG1-MATERIAL,
lv_IV_MATERIAL_LONG TYPE BAPICHARG1-MATERIAL_LONG,
lv_IV_PLANT TYPE BAPICHARG1-PLANT,
lv_other TYPE c.

CALL METHOD lo_class=>GET_MATERIAL_BATCHES(
EXPORTING
IS_MATERIAL_EVG = lv_IS_MATERIAL_EVG
IV_AVAILABLEDATEFROM = lv_IV_AVAILABLEDATEFROM
IV_AVAILABLEDATETO = lv_IV_AVAILABLEDATETO
IV_BATCHNUMBER = lv_IV_BATCHNUMBER
IV_DESTINATION = lv_IV_DESTINATION
IV_EXPIRYDATEFROM = lv_IV_EXPIRYDATEFROM
IV_EXPIRYDATETO = lv_IV_EXPIRYDATETO
IV_MATERIAL = lv_IV_MATERIAL
IV_MATERIAL_LONG = lv_IV_MATERIAL_LONG
IV_PLANT = lv_IV_PLANT
IMPORTING
ES_RETURN = lv_ES_RETURN
ET_BATCHES = lv_ET_BATCHES
EV_SYSUBRC = lv_EV_SYSUBRC ).

Links to Related Class(s)

/IAM/CL_...
Full list of available SAP object classes

Search for further information about these or an SAP related objects



Comments on this SAP object

What made you want to lookup this SAP object? Please tell us what you were looking for and anything you would like to be included on this page!