Most of text in SAP are stored in STXH and STXL tables.
We can read text by read_text fm. If you can not find input parameters of the fm , you can use STXH tables.
Example :
Read text purchase requisition header note
T-code : ME52N (Change Purchase Req.)
Find READ_TEXT import parameters :
CLIENT = SY-MANDT
ID = ?
LANGUAGE = sy-langu
NAME = ?
OBJECT = ?
Now go to SE16N and look for the table STXH , give your key parameter( banfn – purchasing req. number) into TDNAME field.
ID = ‘B01’
NAME = ‘5000000112’
OBJECT = ‘EBANH’
Now we have all import parameter to call read_text.( If you don’t want to call the read_text , use the table STXL for getting text lines.)
CODES :
BREAK xasag.
DATA : lv_name type THEAD-TDNAME,
gt_lines type table of tline,
gs_line type tline.
lv_name = '50000000112'.
CALL FUNCTION 'READ_TEXT'
EXPORTING
CLIENT = SY-MANDT
id = 'B01'
language = sy-langu
NAME = lv_name
OBJECT = 'EBANH'
* ARCHIVE_HANDLE = 0
* LOCAL_CAT = ' '
* IMPORTING
* HEADER =
* OLD_LINE_COUNTER =
TABLES
lines = gt_lines
EXCEPTIONS
ID = 1
LANGUAGE = 2
NAME = 3
NOT_FOUND = 4
OBJECT = 5
REFERENCE_CHECK = 6
WRONG_ACCESS_TO_ARCHIVE = 7
OTHERS = 8
.
IF sy-subrc <> 0.
* Implement suitable error handling here
ENDIF.loop at gs_lines into gs_line.
*gs_line-tdline.endloop.
You can see header note rows in the debug mode.