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

Usage of function module Material_Read

Former Member
0 Likes
3,355

hi

Can anybody explain me how to use function module Material_Read with various necessary parameters .

You can also mail me on jiteshkohli@gmail.com

Thanx n Regards

Jitesh

3 REPLIES 3
Read only

Former Member
0 Likes
1,966

You check the function module by checking the function module help in SE37.

The following is the details of 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

SCHLUESSEL

MATDATEN

RETURN

MATPER

SEQMAT01

Exceptions

ACCOUNT_NOT_FOUND

BATCH_NOT_FOUND

FORECAST_NOT_FOUND

LOCK_ON_ACCOUNT

LOCK_ON_MATERIAL

LOCK_ON_PLANT

LOCK_ON_SALES

LOCK_ON_SLOC

LOCK_ON_BATCH

LOCK_SYSTEM_ERROR

MATERIAL_NOT_FOUND

PLANT_NOT_FOUND

SALES_NOT_FOUND

SLOC_NOT_FOUND

SLOCNUMBER_NOT_FOUND

SLOCTYPE_NOT_FOUND

TEXT_NOT_FOUND

UNIT_NOT_FOUND

INVALID_MCH1_MATNR

INVALID_MTCOM

SA_MATERIAL

WV_MATERIAL

WAART_ERROR

T134M_NOT_FOUND

Reward Points if useful.

Read only

0 Likes
1,966

All this documentation is already available in the FM documentation.Could you update any information about MTCOR-RMAWEV flag. When this flag gets set etc.

Read only

Former Member
0 Likes
1,966

Hi Jitesh,

Check the link below, its very good site to find out info on any function module and their description:

www.se37.com

<b>Kindly Reward Points If You Found The Reply Usefull<b>,

Cheers,

Chaitanya.