Fonction SAP BAPI_MATERIAL_GETBATCHES - Create Batch List for a Material

Paramètre Reférence Type Long. Valeur par déf. Facultatif Description
AVAILABLEDATEFROM BAPICHARG1-AVAILABLE D 8 X Availability date from which selection is made
AVAILABLEDATETO BAPICHARG1-AVAILABLE D 8 99991231 X Availability date to which selection is made
BATCHNUMBER BAPICHARG1-BATCH C 10 X Batch number
EXPIRYDATEFROM BAPICHARG1-EXPIRYDATE D 8 X Expiration date from which selection is made
EXPIRYDATETO BAPICHARG1-EXPIRYDATE D 8 99991231 X Expiration date to which selection is made
MATERIAL BAPICHARG1-MATERIAL C 18 Material No.
MATERIAL_EVG BAPIMGVMATNR u 82 X
PLANT BAPICHARG1-PLANT C 4 X Plant for batch

Paramètre Reférence Type Long. Description
RETURN BAPIRETURN u 452 Return parameters

Paramètre Reférence Long. Facultatif Description
BATCHES BAPICHARG1 186 X Table of batches

Functionality
This method is used to create a list of batches for a material. You canrestrict this list by specifying input parameters.
For example, you can create a list of the batches whose shelf lifeexpiration date is not yet exceeded.

Notes
Messages are returned in the
RETURN parameter.
For the return values and their meanings, see the documentation for theRETURN parameter.
You can combine the parameters EXPIRYDATEFROM and EXPIRYDATETO (orAVAILABLEDATEFROM and AVAILABLEDATETO) as follows:

  • If you enter an earliest and a latest availability date,

  • the system selects only the batch records whose availability date iswithin this interval.
    • If you enter an earliest and a latest shelf life expiration date,

    • the system selects only the batch records whose shelf life expirationdate is within this interval.

      Description
      The return parameter informs the user whether batches were found in theR/3 System for the specified criteria.

      Value range
      TYPE = "S" CODE = " ": Batches successfully found
      TYPE = "E" CODE = "QC157": No batches were found

      Description
      The system only selects those batches with availability dates in thebatch master record that are the same as, or that fall after the datespecified in this parameter.

      Default
      The default value for this parameter is the initial date value.

      Description
      The system only selects those batches with availability dates in thebatch master record that are the same as, or that fall before the datespecified in this parameter.

      Default
      The default value for this parameter is 31.12.9999.

      Description
      Key that clearly identifie the batch.
      If you enter a batch number, the system only returns the batches withthis number.

      Description
      If you make an entry for this parameter, the system only selects thebatches with expiry dates that are the same as, or that fall after thedate specified in the parameter.

      Default
      The default value for this parameter is the initial date value.

      Description
      The system only selects those batches with expiry dates that are thesame as, or that fall before the date specified in this parameter.

      Default
      The default value for this parameter is 31.12.9999.

      Description
      Alphanumeric key clearly identifying the material, for the batch thatis to be found.

      Value range
      This method does not check whether the material number already existsin the system.

      Description
      Parameter for the long material number
      This parameter can be used to transfer long material numbers that cancontain a maximum of 40 characters.
      To use this parameter, you must activate the switch for the LAMA (longmaterial number) business function in the system.
      The LAMA business function is available as part of the business functionset for DIMP.

      Value range
      None

      Default
      None

      Description
      If batch management takes place at plant level, this parameter limitsthe selection to batches from the specified plant.
      If batch management does not take place at plant level the parametercan be ignored.

      Description
      Table of batches that were found on the basis of the import parameters.The table contains details on the batch master records, but not stockinformation. It consists of the following fields:

      • MATERIAL,,,,Material number

      • PLANT,,,,Plant

      • BATCH,,,,Batch number

      • VAL_TYPE,,Valuation type

      • RESTRICTED,,Batch in restricted-use stock

      • STATUSKEY,,Batch status key

      • AVAILABLE,,Availability date

      • EXPIRYDATE,,Shelf life expiration date

      • DELETEFLAG,,Deletion flag for all data

      • REGIONORIG,,Region of origin

      • COUNTRYORI,,Material's country of origin

      • EXPIMPGRP,,Import/export material group

      • VENDOR,,,,Vendor account number

      • VENDRBATCH,,External batch number

      • NEXTINSPEC,,Next inspection date