2023 Mar 13 1:04 PM
it is successful to test the connection system at sm59
But use RFC_ READ_ TABLE query failed, and sy-subrc=7, p_dest value is target system
The code is as follows:
CALL FUNCTION 'RFC_READ_TABLE' DESTINATION p_dest
EXPORTING
query_table = p_tname
IMPORTING
lines_per_record = lv_lines
TABLES
options = lt_options
fields = lt_fields
data = lt_data
EXCEPTIONS
table_not_available = 1
table_without_data = 2
option_not_valid = 3
field_not_valid = 4
not_authorized = 5
data_buffer_exceeded = 6
OTHERS = 7.
IF sy-subrc EQ 7.
ENDIF.
2023 Mar 14 9:52 AM
During a remote function call, you must add TWO exceptions - check at CALL FUNCTION DESTINATION, parameter_list
[EXCEPTIONS [exc1 = n1 exc2 = n2 ...]
[system_failure = ns [MESSAGE smess]]
[communication_failure = nc [MESSAGE cmess]]
[OTHERS = n_others]] }
I suppose that your 'OTHERS' exception will be handled with a correct error message text.
NB: p_dest is not a system name but a RFC destination, managed within transaction SM59.
2023 Mar 14 11:20 AM
Please edit your question: select your ABAP code and click the button CODE so that it's nicely displayed and we can read it easily.