Send information to an RFC in SAP with tables and type structure

0

I am doing an integration of a system in VB6 with SAP, taking in the RFC 2 tables and 2 structures. According to the consultant ABAP in one of the tables does not arrive the information, but I am doing and sending the same way. Here is the code example:

Dim vm_rfc_sap As Object
Dim t_Tab1 As Object
Dim t_Tab2 As Object
Dim Export As Object
Dim Export1 As Object
Dim callOk As Boolean
Dim Controller As Object   

Set vm_rfc_sap = CreateObject("SAP.Functions")
--procedimentos de conexão

If Not vm_rfc_sap.Connection.Logon(0, True) Then
   MsgBox ml_string(0, "Falha na conexão")
   Exit Sub
End If

Set Controller = vm_rfc_sap.Add("RFC_NAME")
Set Export = Controller.Exports("I_S_ESTRUT1")
Set Export1 = Controller.Exports("I_S_ESTRUT2")
Set t_Tab1 = Controller.Tables("I_T_TAB1")
Set t_Tab2 = Controller.Tables("I_T_TAB2")
Set t_retorno = Controller.Tables.Item("ET_RETURN")

--Adiciono os dados nas estruturas
Export("CAMPO1") = 1
Export("CAMPO2") = 2017
...n campos

Export1("CAMPO1") = 2
Export1("CAMPO2") = 2018
...n campos

--Adiciono dados nas tabelas
t_Tab1.Rows.RemoveAll
t_Tab1.freetable
t_Tab1.Rows.Add
t_Tab1.Value(1, "CAMPO1") = 61104
...n linhas

t_Tab2.Rows.RemoveAll
t_Tab2.freetable
t_Tab2.Rows.Add
t_Tab2.Value(1, "CAMPO1") = 61105
... n linhas

callOk = Controller.Call()

When I do Controller.Call() , it does not give error, that is, it does not Controller.Exception() , but in return ET_RETURN , it accuses that there is an error that no information was sent to I_T_TAB2 .     

asked by anonymous 16.03.2017 / 19:23

1 answer

0

Have you solved this issue? If not, ask ABAP to send you the function interface, for example:

function transaction_call_via_rfc.
*"----------------------------------------------------------------------
*"*"Lokale Schnittstelle:
*"       IMPORTING
*"             VALUE(TCODE) LIKE  TSTC-TCODE
*"       TABLES
*"              TRANSACTION_DATA STRUCTURE  BDI_LINE
*"       EXCEPTIONS
*"              TCODE_NOT_EXIST
*"----------------------------------------------------------------------

Just ensure that the table in question is declared as a TABLES parameter, as is the TRANSACTION_DATA in the example I passed.

    
29.03.2017 / 19:24