hi can anybody help me regarding read_text FM ,iam using this FM in my report and want to print the text in ME41 in my sapscript, text is getting printed but only one text is getting printed for other items also ,where as it is different for other items . Ex for item no 0010 its text is AS PER SUPPLY and for item no 0020 it is HEAD : 45 but for item no 0020 it printing AS PER SUPPLY.
pls chek my coding
loop at itab .
CALL FUNCTION 'READ_TEXT'
EXPORTING
CLIENT = SY-MANDT
id = 'A01'
language = 'E'
name = ITAB-TDNAME
object = 'EKPO'
IMPORTING
HEADER = TESTFLD
tables
lines = TLINE
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.
IF sy-subrc <> 0.
flag = 1.
ELSEIF sy-subrc = 0.
flag = 0.
if not tline[] is initial.
LOOP AT tline into wa_tline .
read table tline with key tdname.
TLINE-tdline = wa_tline-TDLINE.
append tline1.
ENDLOOP.
ENDIF.
ENDIF.
ENDLOOP.
and passing &tline& to sapscipt
Thank.