Saturday, May 31, 2008

SAP BAPI for displaying Material Data

SAP BAPI for displaying Material Data

If you wish to display Material data related to Material General Data, Material Plant Data and Material Valuation Data then you can use the following BAPI. This BAPI displays the above mentioned data for a Material.

BAPI/Function Module to display Material Data / Display Material Data BAPI/Function Module

BAPI_MATERIAL_GET_DETAIL

This BAPI has 4 input parameters

Material  (Mandatory)
Plant
Valuation Area
Valuation Type

Please find the code below.

REPORT ZEX_GETMATDET .

Parameters: p_matnr like BAPIMATDET-MATERIAL,
            p_werks like BAPIMATALL-PLANT,
            p_valara like BAPIMATALL-VAL_AREA,
            p_valtyp like BAPIMATALL-VAL_TYPE.


Data: st_matgendata like BAPIMATDOA,
      st_matplantdat like BAPIMATDOC,
      st_matvaldat like BAPIMATDOBEW,
      d_return like BAPIRETURN.


CALL FUNCTION 'BAPI_MATERIAL_GET_DETAIL'
  EXPORTING
   MATERIAL                   = p_matnr
   PLANT                       = p_werks
   VALUATIONAREA               = p_valara
   VALUATIONTYPE               = p_valtyp
 IMPORTING
   MATERIAL_GENERAL_DATA       = st_matgendata
   RETURN                      = d_return
   MATERIALPLANTDATA           = st_matplantdat
   MATERIALVALUATIONDATA       = st_matvaldat .

   If sy-subrc = 0.

   endif.


Important Transactions related to Material Management

Create General

MM01 Immediate
MM11 Schedule
____________________________________________

Create Special

MMR1 Raw Material
MMB1 Semi finished  Product
MMF1 Finished Product
MMI1 Operating Supplies
MMH1 Trading Goods
MMU1 Non Valuated Material
MMN1 Non Stock Material
MMV1 Packaging
MMl1 Empties
MMS1 Services
MMk1 Configurable Material
MMP1 Maintenance Assembly
MMW1 Competitor Product
MMG1 Returnable Packaging
______________________________________________

Change

MM02 Immediately
MM12 Schedule
MM13 Active
______________________________________________

Display

MMO3 Current
MM19 Display at Key Date




 

 



No comments:

Post a Comment