How to get header text in SAP ABAP.
By using READ_TEXT we can able to read the header text of any standard transaction.
DATA: text_name TYPE tdobname,
lvlang TYPE tdspras,
textid TYPE tdid,
textobj TYPE tdobject,
ittline TYPE STANDARD TABLE OF tline.
lvlang = 'EN'.
textobj = 'VBBK'.
textid = 'Z022'.
textname = document number.
CALL FUNCTION 'READ_TEXT'
EXPORTING
client = sy-mandt
id = textid
language = lvlang
name = textname
object = textobj
TABLES
lines = ittline
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.
ENDIF.
sy-mandt = Client name.
pass the document number in textname.
Header text will appear in ittline table.
Text object and Text id we can able to find from Detail option.

IDE Used To Test This Code : SAP ABAP Editor.
Try this code in your computer for better understanding. Enjoy the code. If you have any Question you can contact us or mail us. We will reply you as soon as possible.