Skip to Content
0
Former Member
Mar 18, 2009 at 01:54 PM

error in function

26 Views

i am using read_text function , but if for some reason the data is not mensioned for any object the report terminate abnormally, without any output.

but i want the text may be blank if it is not fetching.

the code is as below.

lv_objid = 'LTXT'.

lv_obj = 'ISMP'.

CALL FUNCTION 'READ_TEXT'

EXPORTING

id = lv_objid

language = sy-langu

name = name1

object = lv_obj

TABLES

lines = ltext.

DELETE ltext WHERE tdline IS INITIAL.

READ TABLE ltext.

IF sy-subrc = 0.

wa_sym-text1 = ltext-tdline.

ENDIF.

CLEAR ltext.

with regards and thanks

ajay