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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
5 | |
3 | |
2 | |
2 | |
2 | |
2 | |
2 | |
1 | |
1 |