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

Data transfer using RFC

Former Member
0 Likes
1,009

Hi Experts,

I call RFC from VB (VS 2005) for uploading data from SQL Server to SAP Ztable. Connection and even RFC call works fine but I dont understand how I can pass SQL table to RFC in my VB code.

Can you give me your thoughts or any links for sending table to RFC...it is array insert..

Thanks in advance..

Yogesh

7 REPLIES 7
Read only

Former Member
0 Likes
781

Hello,

Create a internal table in SAP which is having the same format of SQL table and assign this table as input paratmer in RFC.

Regards,

Mukund

Read only

Former Member
0 Likes
781

Hello,

In RFC function module there is an option of "Tables". Assign your SQL table to internal table of SAP in this parameter.

Regards,

Mukund

Read only

0 Likes
781

Thanks Mukund for your reply,

I have tested RFC in Zprogram & it works fine when I pass ITAB to it..but i dont understand How I can pass my SQL table in VB code.

*****CODE IN ABAP*

*CALL FUNCTION 'Z_REMOTE_FUNCTION'*
  *TABLES*
    *it_tables                  = <TABLE_NAME_FROM_SQL>*
 *EXCEPTIONS*
   *NOT_FOUND            = 1*
   *INSERT_FAILURE     = 2*
   *OTHERS                  = 3*

Awaiting for your reply,

Read only

0 Likes
781

Hello Yogesh,

****CODE IN ABAP

CALL FUNCTION 'Z_REMOTE_FUNCTION'

TABLES

it_tables = <TABLE_NAME_FROM_SQL>

EXCEPTIONS

NOT_FOUND = 1

INSERT_FAILURE = 2

OTHERS = 3

Are u calling this RFC in VB code. If yes then create a table of same strucutre of SAP table in VB code and pass that table to "it_tables". Only the structure should be the same.

regards,

mukund

Read only

0 Likes
781

Yes, Mukund I did the same.

We pass ITAB in ABAP to RFC, in VB it is recordset (dataset, runtime work area with data from SQL) but it gives error...as no data found ..

Do you have any idea about this ?

Read only

0 Likes
781

Check these threads.

[Thread1|http://www.programmingtalk.com/showthread.php?t=21399]

[Thread2|http://sap.ittoolbox.com/groups/technical-functional/sap-dev/calling-customized-rfc-function-module-via-vb-548294]

Rhea.

Read only

0 Likes
781

thank you rhea..its useful

Edited by: Yogesh Umtol on Apr 3, 2009 2:49 PM