Application Development and Automation 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 only

read_text , text name not maintain, update termination error.

Former Member
0 Likes
996

Hi,

i am using read_text function module, here i am passing parameters like :

CALL FUNCTION 'READ_TEXT'

EXPORTING

  • CLIENT = SY-MANDT

ID = 'ZST1'

LANGUAGE = SY-LANGU

NAME = W_NAME

OBJECT = 'TEXT'

TABLES

LINES = T_LINE

in w_name i am passing purchasing group. now functional consultant has maintained for "101" only, so if "212" comes then FM throws exception of NOT FOUND

"Text 212 ID ZST1 language EN not found " and program terminates because it exception,

so is there any solution that i can avoid this termination. i know its exception and fucn consulatn need to maintain, but if not maintain then how can we control through program?

Hi,

i am using read_text function module, here i am passing parameters like :

CALL FUNCTION 'READ_TEXT'

EXPORTING

  • CLIENT = SY-MANDT

ID = 'ZST1'

LANGUAGE = SY-LANGU

NAME = W_NAME

OBJECT = 'TEXT'

TABLES

LINES = T_LINE

in w_name i am passing purchasing group. now functional consultant has maintained for "101" only, so if "212" comes then FM throws exception of NOT FOUND

"Text 212 ID ZST1 language EN not found " and program terminates because it exception,

so is there any solution that i can avoid this termination. i know its exception and fucn consulatn need to maintain, but if not maintain then how can we control through program?

3 REPLIES 3
Read only

Former Member
0 Likes
671

Hi,

Catch the exceptions from the function module using exceptions and after the function module call, write the logic for sy-subrc check and if it is not zero then you can raise a warning message or proceed further without doing anything.

{

CALL FUNCTION 'READ_TEXT'

EXPORTING CLIENT = SY-MANDT

OBJECT = ?...

NAME = ?...

ID = ?...

LANGUAGE = ?...

ARCHIVE_HANDLE = 0

IMPORTING HEADER =

TABLES LINES = ?...

EXCEPTIONS ID =

LANGUAGE =

NAME =

NOT_FOUND =

OBJECT =

REFERENCE_CHECK =

WRONG_ACCESS_TO_ARCHIVE =

IF sy-subrc <> 0.

ENDIF.

}

Regards.,

Prasanna

Read only

Former Member
0 Likes
671

Hi Angel,

What you can do is you canwrite your piece of code which is likely to throw exception in TRY CATCH block like JAVA.

when the exceptionis raised handle it.

Cheers,

Ankitesh

Read only

Former Member
0 Likes
671

Hello Guys,

i Solved it.

actually, i checked from STXH table the entry text name, if i dont find it, i will not call read_text function module.