Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

READ

Former Member
0 Kudos

Hi all

Im using the Read Text FM in a user exit like the code below.

The problem is when no data is found in the table STXH pops up a error msg that no data was found (a error msg from the Read Text FM).

But I want to ignore this msg and treat this case outside the FM.

Like below

call function 'READ_TEXT'

exporting

client = sy-mandt

id = 'B03'

language = p_langu

name = p_name

object = 'EBAN'

archive_handle = 0

  • LOCAL_CAT = ' '

  • IMPORTING

  • HEADER =

tables

lines = itab_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.

  • msg

endif.

        • I need to test here if no data was found.

if itab_lines[] is initial.

message e264(zmm).

endif.

I hope you understand what I mean.

Many thanks.

Ann

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi,

Uncomment the exceptions..Then it will set the sy-subrc.

<b> 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.</b>

Thanks,

Naren

2 REPLIES 2

Former Member
0 Kudos

Hi,

Uncomment the exceptions..Then it will set the sy-subrc.

<b> 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.</b>

Thanks,

Naren

0 Kudos

Many Thanks, Naren !

It is working now !