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: 

RFC passing table data

Former Member
0 Kudos

Hi, all.

To get another system data, I write a RFC function.

I have to receive 2 tables result. However, the RFC function call just sends me only first table result, second table is emtpy.

i will show you the program. Please, tell me what's wrong in the RFC function call.

*----


CALL FUNCTION 'Z_RFC_ACC_DOC_INTERFACE1'

DESTINATION 'DEVCLNT400'

EXPORTING

f_date = s_budat-low

t_date = s_budat-high

f_hkont = p_hkont

TABLES

t_bseg = it_bseg <b>=> this table is emtpy after finishing RFC</b>.

t_bkpf = it_bkpf. <b>=> this table has data after finishing RFC</b>

*----


FUNCTION Z_RFC_ACC_DOC_INTERFACE1.

DATA: it_bkpf LIKE bkpf OCCURS 0,

it_bseg LIKE bseg OCCURS 0.

DATA: wa_bkpf TYPE bkpf,

wa_bseg TYPE bseg.

DATA: it_ztifec03 TYPE ztifec03 OCCURS 0,

wa_ztifec03 TYPE ztifec03.

  • STEP 1. ----------------------------------------------

  • to select ztifec03

SELECT SINGLE * FROM ztifec03

INTO CORRESPONDING FIELDS OF wa_ztifec03

WHERE old_hkont EQ f_hkont.

  • STEP 2. ----------------------------------------------

  • to select bkpf in midas

SELECT * INTO TABLE it_bkpf

FROM bkpf

WHERE bukrs EQ 'OZ01'

AND gjahr EQ f_date(4)

AND budat BETWEEN f_date AND t_date

AND blart IN ('MD', 'MB', 'MC', 'ZZ', 'MA').

CHECK it_bkpf[] IS NOT INITIAL.

  • to select bseg

SELECT * INTO TABLE it_bseg

FROM bseg

FOR ALL ENTRIES IN it_bkpf

WHERE bukrs EQ 'OZ01'

AND gjahr EQ f_date(4)

AND belnr EQ it_bkpf-belnr

AND hkont EQ wa_ztifec03-hkont.

  • STEP 3. -----------------------------------------------

LOOP AT it_bkpf INTO wa_bkpf.

MOVE-CORRESPONDING wa_bkpf TO t_bkpf.

APPEND t_bkpf.

ENDLOOP.

LOOP AT it_bseg INTO wa_bseg.

MOVE-CORRESPONDING wa_bseg TO t_bseg.

APPEND t_bseg.

ENDLOOP.

ENDFUNCTION.

1 REPLY 1

Former Member
0 Kudos
  • to select bseg

SELECT * INTO TABLE it_bseg

FROM bseg

FOR ALL ENTRIES IN it_bkpf

WHERE bukrs EQ 'OZ01'

AND gjahr EQ f_date(4)

AND belnr EQ it_bkpf-belnr

AND hkont EQ wa_ztifec03-hkont. <b><This could be culprit. Take this line out and test aga</b>in