cancel
Showing results for 
Search instead for 
Did you mean: 

Read_Text: no_found exception

Former Member
0 Kudos

Hi,

I'm working on the Smartforms, In that smartforms i'm using READ_TEXT Function Module to get the Texts.

My Requirement is, if the text is not existing for that particular Text ID and for that Material, At present it is giving the Error Message as

"Material No" "Text ID" "EN" Text does Not exist.

I want to capture this Error Message and it should not throw the Error.

I want to execute the report even though there is no text exists.

-


IN SHORT-----

in include text there is a checkbox "NO ERROR IF NO TEXT EXIT", how to copy the same fucntionality in READ_TEXT

If Possible please send the example code.

Rohan

Accepted Solutions (0)

Answers (5)

Answers (5)

Former Member
0 Kudos

This is because you are not explicitly declaring the exceptions

Declare thema nd they will not come up as a popup

Like this

all function 'READ_TEXT_INLINE'

EXPORTING

id = p_id

inline_count = 1

language = p_langu

name = p_name

object = p_object

TABLES

inlines = gt_inlines

lines = gt_lines

EXCEPTIONS

id = 1

language = 2

name = 3

not_found = 4

object = 5

reference_check = 6.

Former Member
0 Kudos

thanx anil,

Solved my problem...

anyways thanx for the reply..it was the correct one

Cheers..

points rewarded

Former Member
0 Kudos

Hi ,

Raise the Exception as given below.

If Header is initial.

Raise NOT_FOUND.

endif.

REward if useful.

Former Member
0 Kudos

Hi,

1.don't neglect the Exception tab in Read_Text.

CALL FUNCTION 'READ_TEXT'

EXPORTING

  • CLIENT = SY-MANDT

ID =

LANGUAGE =

NAME =

OBJECT =

  • ARCHIVE_HANDLE = 0

  • LOCAL_CAT = ' '

  • IMPORTING

  • HEADER =

TABLES

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.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

Use like this .It defaultly handle the exception , if we maintain the code like above.

Thanks and Regards,

Reward if helpful.

Former Member
0 Kudos

Hi Rohan

try this

CALL FUNCTION 'READ_TEXT'

EXPORTING

client = sy-mandt

id = '0001'

language = 'E'

name = fname

object = 'VBBK'

TABLES

lines = text_lines

IF sy-subrc <> 0.

MESSAGE s000(zmess) WITH text-014.

ENDIF.

Comment the code which is present between sy-subrc block

Or simply do not handle the exceptions

Edited by: Anil Mane on Apr 2, 2008 1:40 PM