Monday, June 30, 2008

SAP Plant Material and Storage Location

SAP Plant Material and Storage Location

For retrieving Storage Location related data for a Material, you can use the following SAP ABAP function module.

SAP Storage Location related data for a Material.

MARD_GENERIC_READ_MATNR_PLANT
___________________________________________________________


The following are the IMPORT parameters:

KZRFB            Indicator: Lock
MATNR           Material
WERKS            Plant
MAXTZ            Maximum number of table lines
____________________________________________________________


The following values are retrieved.

Values from Table
MARD     Storage Location Data for Material
_____________________________________________________________



Code is given below.

REPORT ZEX_STORAGELOC .


Parameter: p_matnr like MARD-MATNR,
           p_werks like MARD-WERKS.


data: int_MARD TYPE TABLE OF MARD.


CALL FUNCTION 'MARD_GENERIC_READ_MATNR_PLANT'
  EXPORTING
*   KZRFB            = ' '
    MATNR            = p_matnr
    WERKS            = p_werks
*   MAXTZ            = 0
  TABLES
    MARD_TAB         = int_MARD
 EXCEPTIONS
   WRONG_CALL       = 1
   NOT_FOUND        = 2
   OTHERS           = 3
          .
IF SY-SUBRC <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.

See Also:
SAP Locating Plants for a Given Material
SAP get Plant Description For a given Material

No comments:

Post a Comment