How To Print a Header Text

How to print a header text in classical report?

By : Varun Walia

You have to use the function module  like this, this is just only as a example:

*&---------------------------------------------------------------------*
*& Form FETCH_TEXT_INFO
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* --> p1 text
* <-- p2 text
*----------------------------------------------------------------------*
form fetch_text_info .
refresh : istxh.
select * from stxh into corresponding fields of table istxh
where tdname = ivbak-vbeln.
loop at istxh.
perform fetch_text_information.
endloop.
endform. " FETCH_TEXT_INFO
*&---------------------------------------------------------------------*
*& Form FETCH_TEXT_INFORMATION
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* --> p1 text
* <-- p2 text
*----------------------------------------------------------------------*
form fetch_text_information .
call function 'READ_TEXT'
exporting
id = istxh-tdid
language = istxh-tdspras
name = istxh-tdname
object = istxh-tdobject
importing
header = header
tables
lines = itf_text
exceptions
id = 1
language = 2
name = 3
not_found = 4
object = 5
others = 8.
if istxh-tdid = 'ZINF' and istxh-tdobject = 'VBBK'.
loop at itf_text.
info_order = itf_text-tdline.
endloop.
endif.
if istxh-tdid = 'ZCBG' and istxh-tdobject = 'VBBK'.
loop at itf_text.
c_bags = itf_text-tdline.
endloop.
endif.
if istxh-tdid = 'ZPPB' and istxh-tdobject = 'VBBK'.
loop at itf_text.
p_bags = itf_text-tdline.
endloop.
endif.
if istxh-tdid = 'ZADG' and istxh-tdobject = 'VBBK'.
loop at itf_text.
ad_mat = itf_text-tdline.
*write : /1 ad_mat.
endloop.
endif.
* if sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
* endif.
* write : /1 AD_MAT.
endform. " FETCH_TEXT_INFORMATION

Get help for your ABAP problems
Do you have a ABAP Question?

ABAP Books
ABAP Certification, BAPI, Java, Web Programming, Smart Forms, Sapscripts Reference Books

More ABAP Tips

Best regards,
SAP Basis, ABAP Programming and Other IMG Stuff
http://www.erpgreat.com

All the site contents are Copyright © www.erpgreat.com and the content authors. All rights reserved.
All product names are trademarks of their respective companies.  The site www.erpgreat.com is in no way affiliated with SAP AG. 
Every effort is made to ensure the content integrity.  Information used on this site is at your own risk. 
 The content on this site may not be reproduced or redistributed without the express written permission of 
www.erpgreat.com or the content authors.