2020 Jun 30 9:48 AM
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.....
2020 Jun 30 10:04 AM
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,
Mateusz2020 Jun 30 10:10 AM
I have to wonder where the OP got
st_client = 'sy-mandt'
from.
2020 Jun 30 11:36 AM
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).
2020 Jun 30 10:09 AM
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
2020 Jun 30 11:19 AM
Thank you Matthew Billingham for your help.
Its working fine now.
Thanks for your quick solution.
2020 Jun 30 11:33 AM
manojgurram I hope you understand how to use the button CODE for your next questions 🙂