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

About the abap function CALL FUNCTION RFC_ READ_ TABLE DESTINATION failed to read other system data

0 Likes
1,832

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.

2 REPLIES 2
Read only

RaymondGiuseppi
Active Contributor
1,671

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.

Read only

Sandra_Rossi
Active Contributor
0 Likes
1,671

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.