Application Development Blog Posts
Learn and share on deeper, cross technology development topics such as integration and connectivity, automation, cloud extensibility, developing at scale, and security.
cancel
Showing results for 
Search instead for 
Did you mean: 
Former Member

Introduction


Case 1 - Create a material with reference to some existing material in the ECC system.

Case 2 - Create a report with data from MARC, MARD, MVKE, MBEW, etc.

Case 3 - Get the existing Purchase Order text of any material.

To suit the above needs, SAP has given a wonderful Function Module 'CRS_MATERIAL_READ_ALL'. Using this function module we can pass the Material Number and get all the details of that material.

Code example for the same is :-

Form get_material_details.

DATA :

*-for CRS_MATERIAL_READ_ALL Function Module --------------*

*-- Sales Data

               lt_mvke    TYPE STANDARD TABLE OF    mvke,

*-- Valuation Data

               lt_mbew    TYPE STANDARD TABLE OF    mbew,

*-- Plant Data

               lt_marc    TYPE STANDARD TABLE OF    marc,

*-- Storage Location Data

               lt_mard    TYPE STANDARD TABLE OF    mard,

*-- Material Description Data

               lt_makt    TYPE STANDARD TABLE OF    makt,

*-- Units oF Measure Data

               lt_marm    TYPE STANDARD TABLE OF    marm,

*-- International Article Numbers Data

               lt_mean    TYPE STANDARD TABLE OF    mean,

*-- Tax Classifications Data

               lt_mlan    TYPE STANDARD TABLE OF    mlan,

*-- Purchase Order Text Data

               lt_cdtxt   TYPE STANDARD TABLE OF    cdtxt.

CALL FUNCTION 'CRS_MATERIAL_READ_ALL'

   EXPORTING

     iv_matnr           = '000000000000000010'  " Pass the material Number here.

   TABLES

     et_mvke            = lt_mvke

     et_mbew            = lt_mbew

     et_marc            = lt_marc

     et_mard            = lt_mard

     et_makt            = lt_makt

     et_marm            = lt_marm

     et_mean            = lt_mean

     et_mlan            = lt_mlan

     et_icdtxt_material = lt_cdtxt.

Endform.

Disclaimer :- The simple reason for posting this was that i was unable to find proper example of this very powerful function module. It can reduce lots of Inner Joins and FAE on the concerned tables.

Also if you are planning to use this for Case 1 it can be used a sub step for it.


Thanks.



8 Comments
Labels in this area