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: 

Exception CX_SY_NO_HANDLER was raised , when function module READ_TEXT called

0 Kudos
1,810

DATA : st_client TYPE SY-MANDT,
st_id TYPE THEAD-TDID,
st_language TYPE THEAD-TDSPRAS,
st_name TYPE THEAD-TDNAME,

st_object TYPE THEAD-TDOBJECT.

DATA : lt_line TYPE TABLE OF tline,

FIELD-SYMBOLS <fs_lt_line> TYPE tline.

st_client = 'sy-mandt'.
st_id = 'ST'.
st_language = 'EN'.
st_name = 'ZCOLLECTIVE'.
st_object = 'TEXT'.

CALL FUNCTION 'READ_TEXT'
EXPORTING
client = st_client
id = st_id
language = st_language
name = st_name
object = st_object
TABLES
lines = lt_line
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.
* Implement suitable error handling here
ENDIF.

I am calling READ_TEXT fm inside a method,and above is the code raising an exception when I executed.

Can anyone please help me out with this issue.....

6 REPLIES 6

MateuszAdamus
Active Contributor
965

Hello manojgurram

Remove or comment out the CLIENT parameter - it is not needed, by default it has the value of current client. If you still want to use it, then put a proper value in it.

st_client = 'sy-mandt'. " <- INCORRECT

st_client = sy-mandt. " <- CORRECT (no quotes)

Then try again. If you still get a short-dump then please paste the information contained in the short-dump, like description and the place of raising.

Kind regards,

Mateusz

matt
Active Contributor
965

I have to wonder where the OP got

st_client = 'sy-mandt' 

from.

0 Kudos
965

matthew.billingham Probably the OP didn't know that sy is a structure containing the system fields (for more information, see ABAP documentation - System Fields).

matt
Active Contributor
965

Use the code button to paste code nicely.

DATA: st_client TYPESY-MANDT,
st_id TYPE THEAD-TDID,
st_language TYPE THEAD-TDSPRAS,
st_name TYPE THEAD-TDNAME,
st_object TYPE THEAD-TDOBJECT.
DATA: lt_line TYPETABLEOF tline,
FIELD-SYMBOLS<fs_lt_line>TYPE tline.
st_client ='sy-mandt'.
st_id ='ST'.
st_language ='EN'.
st_name ='ZCOLLECTIVE'.
st_object ='TEXT'.
CALL FUNCTION 'READ_TEXT'
EXPORTING
client = st_client
id = st_id
language = st_language
name = st_name
object= st_object
TABLES
lines = lt_line
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.
* Implement suitable error handling here
ENDIF

0 Kudos
965

Thank you Matthew Billingham for your help.

Its working fine now.

Thanks for your quick solution.

Sandra_Rossi
Active Contributor
965

manojgurram I hope you understand how to use the button CODE for your next questions 🙂