Ansicht
Dokumentation

MATERIAL_READ - Read material master

MATERIAL_READ - Read material master

PERFORM Short Reference   Vendor Master (General Section)  
This documentation is copyright by SAP AG.
SAP E-Book

Function Module Material_Read

Call
CALL FUNCTION 'MATERIAL_READ'
EXPORTING SCHLUESSEL = MTCOM
IMPORTING MATDATEN = View table
RETURN = MTCOR
TABLES SEQMAT01 = Internal table
( EXCEPTIONS Material_not_found = 4
Plant_not_found = 8 . )

Exceptions statement useful only for required tables (see below).

Required tables
If a table flagged as a required table does not exist, the function module terminates at this point and issues an error message. The error message can be suppressed with the exceptions statement, in which case a return code in SY-SUBRC is given instead. In both cases (with or without EXCEPTIONS), the function module does not return any data in the event of an error. You can inactivate all required tables for the view dynamically (as a whole, not individually) by setting the flag MTCOM-NOMUS.

Return codes
If the function module ends without an error message, a return code flag can be interrogated for each table in structure MTCOR; for example, MTCOR-RMARD = X means that the function module tried to read table MARD, but did not succeed. If the flag is not set, the table was read successfully or the function module did not try to read table MARD at all (because the table is not contained in the view or because no storage location was specified).

MTCOR-LVORM
This flag is set if the object is flagged for deletion.

MTCOR-PSTAT/MTCOR-FSTAT
If you specify a maintenance status in MTCOM, for example, MTCOM-PSTAT = BDE, the system checks whether the object has been maintained by the user departments Accounting (B), Material Requirements Planning (D), and Purchasing (E). As a result:

  • Field MTCOR-PSTAT contains the user departments that have maintained the object; for example, MTCOR-PSTAT = B means that the object has been maintained by Accounting, but not by MRP or Purchasing.
  • Field MTCOR-FSTAT contains the user departments that have not maintained the object, but that could have maintained it; that is, the system checks whether the user department is allowed by the material type.
Note
This check takes time (performance). If it is not required, the function module should always be called with MTCOM-PSTAT = space.

MTCOM-NOVOR
If a plant has been specified, but no valuation level or sales organization, the function module automatically adopts (for the plant specified) the corresponding values for the valuation level and sales organization in table T001W. You can inactivate this function by setting the flag MTCOM-NOVOR.

Locking materials
If materials are locked by function module MATERIAL_READ, MATERIAL_READ_MAKF, or by other function modules of function groups MATL or MAKF, the information on which materials were already locked is buffered for performance reasons. This buffer is reset or ignored if the two indicators (MTCOM-)KZSPR and (MTCOM-)KZRFB are set. You can also use function module MATERIAL_RESET_ENQ_BUFFER or MATERIAL_RESET_ENQ_BUFFER_MAKF to completely reset this buffer. This can, for example, be necessary if function module DEQUEUE_ALL has been executed.





Parameters

MATDATEN
MATPER
RETURN
SCHLUESSEL
SEQMAT01

Exceptions

ACCOUNT_NOT_FOUND
BATCH_NOT_FOUND
FORECAST_NOT_FOUND
INVALID_MCH1_MATNR
INVALID_MTCOM
LOCK_ON_ACCOUNT
LOCK_ON_BATCH
LOCK_ON_MATERIAL
LOCK_ON_PLANT
LOCK_ON_SALES
LOCK_ON_SLOC
LOCK_SYSTEM_ERROR
MATERIAL_NOT_FOUND
PLANT_NOT_FOUND
SALES_NOT_FOUND
SA_MATERIAL
SLOCNUMBER_NOT_FOUND
SLOCTYPE_NOT_FOUND
SLOC_NOT_FOUND
T134M_NOT_FOUND
TEXT_NOT_FOUND
UNIT_NOT_FOUND
WAART_ERROR
WV_MATERIAL

Function Group

MATL

BAL_S_LOG - Application Log: Log header data   ROGBILLS - Synchronize billing plans  
This documentation is copyright by SAP AG.

Length: 4235 Date: 20240523 Time: 060706     sap01-206 ( 98 ms )