Skip to Content
0
Former Member
Aug 30, 2007 at 06:33 AM

RFC-XI-JDBC Scenario: Help with RFC code

11 Views

HI,

I am doing RFC-XI-JDBC Scenario, where I have to poll the contents of my Ztable in SAP to Oracle.

The appraoach i am using here is :

1. Created a FM with import parameters as the fields of my Ztable and without any export parameter or source code.

2. Created a report to call that FM in background. The code of my report is as follows :

************************REPORT***********************************************************

Data: it_zrfc_read_table type table of zrfc_read_table,

wa_zrfc_read_table like line of it_zrfc_read_table.

PARAMETERS: tab_name like DD02L-TABNAME.

Data: l_tabname type DD02L-TABNAME.

At selection-screen.

select single tabname from DD02L into l_tabname where tabname = tab_name.

if sy-subrc <> 0.

message 'incorrect table name' type 'E'.

endif.

start-of-selection.

select * from (tab_name) into corresponding fields of table it_zrfc_read_table.

loop at it_zrfc_read_table into wa_zrfc_read_table.

CALL FUNCTION 'ZRFC_READ_TABLE2XI'

IN BACKGROUND TASK DESTINATION 'ORACLEGIS_RFC_SENDER'

EXPORTING

valve_id = wa_zrfc_read_table-valve_id

equnr = wa_zrfc_read_table-equnr

ernam = wa_zrfc_read_table-ernam

invnr = wa_zrfc_read_table-invnr

groes = wa_zrfc_read_table-groes

elief = wa_zrfc_read_table-elief

gwlen = wa_zrfc_read_table-gwlen

gwldt = wa_zrfc_read_table-gwldt

serge = wa_zrfc_read_table-serge

typbz = wa_zrfc_read_table-typbz.

endloop.

commit work.

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

NOw my problem is that although I am able to send a table with a single record, but when my records > 1, it is not able to poll.

Please guide me what can be altered in the code or any other suggestion.

Thanks,

Puneet