Development resources, articles, tutorials, code samples, tools and downloads for SAP HANA and ABAP, HANA Database, SQLScript, SAP UI5, Screen Personas, Web Dynpro, Workflow
Read Material Memo using READ_TEXT Function Module in ABAP
Call MD04 transaction code and run the program for a specific material code, MRP area and plant.
You will see Material Memo button that will enable SAP users to define text for this material.
Material text can be displayed as menu options "Goto > Material Memo (Shift+F4)"
Material text defined could be fetched using ABAP function module READ_TEXT as shown in this ABAP tutorial.
To read material memo, read_text ABAP function module accepts following parameter values:
Id is 'LTXT,
Object is 'MDTXT',
Name parameter value can be formed of material number and plant with a space character between them. (MATNR + SPACE + WERKS)
Here is the ABAP code that can be used to form name parameter value of read_text function module
Since I want to read material memo in login language of the SAP user at first, if it does not exist I prefer the material text in English.
If I fail to find a text again, I'll use the German language for READ_TEXT function module.
Here is the function module, I used.
Z_READ_MATERIAL_MEMO function module ABAP source code is as follows:
And the ABAP code of function module Z_READ_MATERIAL_MEMO_LANG is simple only calling READ_TEXT fm.
This sample ABAP code can be used to create function modules that can help SAP programmers to read material memo programmatically.