Skip to Content
0
Former Member
Mar 25, 2009 at 03:25 PM

RFC Function Module

36 Views

Hello,

I am trying to get the records using RFC FM in IT_DATA[] using the following. But I am not getting any records in it. it_data is declared as (DATA: it_data TYPE tab512 OCCURS 0 WITH HEADER LINE.)

LOOP AT it_rseg_data.

it_options-text = 'BELNR = '.

CONCATENATE ' '' ' it_rseg_data-belnr ''' AND ' INTO objid.

CONDENSE objid NO-GAPS.

CONCATENATE it_options-text objid INTO it_options-text

SEPARATED BY space.

APPEND it_options.

ENDLOOP.

******************************************************************************

IT_OPTIONS gets built with different values of BELNR from it_rseg_data table.

For Ex. BELNR = 1234

BELNR = 5678

*******************************************************************************

PERFORM read_rbkp_belnr_details USING p_logsys bldat bldat_to.

********************************************************************************

FORM read_rbkp_belnr_details USING p_logsys LIKE rfcdes-rfcdest bldat bldat_to.

DATA: l_errflg TYPE char1. CLEAR: it_data. REFRESH: it_data.

CHECK NOT vt_fields[] IS INITIAL.

  • read data from backend

PERFORM read_table_rbkp_for_belnr USING 'RBKP'

p_logsys bldat bldat_to

CHANGING l_errflg.

ENDFORM.

***********************************************************************************

FORM read_table_rbkp_for_belnr USING pi_tabname LIKE dd02l-tabname

pi_logsys bldat bldat_to

CHANGING pc_errflg.

REFRESH it_data. CLEAR it_data.

CALL FUNCTION 'RFC_READ_TABLE'

DESTINATION PI_LOGSYS

EXPORTING

query_table = 'RBKP'

TABLES

OPTIONS = it_options

fields = vt_fields

data = it_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.

it_rbkp_data [] = it_data [].

Shall appreciate if anyone can tell me where I am doing wrong and how do I correct it.

Thks,

Hemal

Edited by: hemalgandhi on Mar 25, 2009 4:25 PM

Edited by: hemalgandhi on Mar 25, 2009 4:26 PM

Edited by: hemalgandhi on Mar 25, 2009 4:26 PM