Use the SQL trace tool : ST05
1°) Active the trace (trace on)
2°) Run your transaction
2°) Desactive the trace (trace off)
3°) Display the trace (list trace)
It will display the accessed tables, their structure, the abap code,
You have to use READ_TEXT function module to get the material memo. Once u go to sapscript editor go to HEADER. Here you can see the parameters
TEXT NAME = material + storage location
language
text id
textobject.
You have to pass all these to read_text function module to retreive the information.
First, in your program, define the internal table to store the data of the text like below. Also, define a variable to store the textname for searching text.
DATA: BEGIN OF T_TLINE OCCURS 1,
TDFORMAT LIKE TLINE-TDFORMAT,
TDLINE LIKE TLINE-TDLINE,
END OF T_TLINE.
DATA: TEXTNAME(70).
Second, call the function to read the text just like below.
CALL FUNCTION 'READ_TEXT'
EXPORTING
ID = 'S002'
LANGUAGE = 'M'
NAME = TEXTNAME
OBJECT = 'VBBK'
TABLES
LINES = T_TLINE
EXCEPTIONS
ID = 1
LANGUAGE = 2
NAME = 3
NOT_FOUND = 4
OBJECT = 5
REFERENCE_CHECK = 6
WRONG_ACCESS_TO_ARCHIVE = 7
OTHER = 8.
LOOP AT T_TLINE.
IF SY-TABIX = 1.
WRITE: T_TLINE-TDLINE+0(20) TO ZTEXT1.
ELSEIF SY-TABIX = 2.
WRITE: T_TLINE-TDLINE+0(20) TO ZTEXT2.
ENDIF.
ENDLOOP.
Pls note that ID, OBJECT and NAME is reference to the key that can find the text. Look into table STXH to have some ideas on the values of them.
P.S.: Text is not stored in table. You must go to table STXH to check the existence of the text. Then, use the function READ_TEXT to read the text content into your internal table. Finally, you output the values stored in your internal table will do. This is the coding for ABAP pogram only.