Question:
Hi every body
i can't understand what's wrong with this....
At the end of the program, i have some problem.... it doesn't work properly....
Sniffff
Can you help me ???
Naos
Public Sub add_bdcdata(BdcTable As Object, program As String, dynpro As String, dynbegin As String, fnam As String, fval As String)
Dim vField As Variant
Static j As Integer
j = j + 1
BdcTable.Rows.Add
BdcTable.Value(j, "PROGRAM") = program ' Program Name
BdcTable.Value(j, "DYNPRO") = dynpro ' Dynpro Number
BdcTable.Value(j, "DYNBEGIN") = dynbegin ' X if a screen
BdcTable.Value(j, "FNAM") = fnam ' Field Name
BdcTable.Value(j, "FVAL") = fval ' Field Value
End Sub
Public Sub rfc_call_transaction()
Dim Functions As Object
Dim RfcCallTransaction As Object
Dim Messages As Object
Dim BdcTable As Object
' Create the Function control (that is, the high-level Functions collection):
Set Functions = CreateObject("SAP.Functions")
' Set the rest of Connection object values:
Functions.Connection.System = "Erstein"
Functions.Connection.client = "110"
Functions.Connection.user = "ALGUE"
Functions.Connection.password = ""
Functions.Connection.Language = "FR"
If Functions.Connection.Logon(0, False) <> True Then
Exit Sub
End If
' Retrieve the Function object (the Connection object must be set up before Function objects can be created):
Set RfcCallTransaction = Functions.Add("RFC_CALL_TRANSACTION")
' Set the export parameters (here, get all customers whose names start with J):
RfcCallTransaction.exports("TRANCODE") = "ZJOD"
RfcCallTransaction.exports("UPDMODE") = "S"
Set BdcTable = RfcCallTransaction.Tables("BDCTABLE")
Sheets("Paramétrage").Select
Cells.Select
Selection.Copy
Cells.Select
Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:=False, Transpose:=False
Range("C6").Select
DATA = ActiveCell.FormulaR1C1
Range("C7").Select
MAP = ActiveCell.FormulaR1C1
Range("C8").Select
FICHIER = ActiveCell.FormulaR1C1
' Set the tables parameter and add the data for the call transaction
add_bdcdata BdcTable, "ZRITSJOD", "1000", "X", "", ""
add_bdcdata BdcTable, "", "", "", "BDC_CURSOR", "P_BTCI"
add_bdcdata BdcTable, "", "", "", "BDC_OKCODE", "/00"
add_bdcdata BdcTable, "", "", "", "P_BTCI", "C:\reprise\coucou.dat"
add_bdcdata BdcTable, "ZRITSJOD", "1000", "X", "", ""
add_bdcdata BdcTable, "", "", "", "BDC_CURSOR", "P_TEST"
add_bdcdata BdcTable, "", "", "", "BDC_OKCODE", "=ONLI"
add_bdcdata BdcTable, "", "", "", "P_SESS", "ALGUE"
add_bdcdata BdcTable, "", "", "", "P_TEST", ""
add_bdcdata BdcTable, "", "", "", "P_KEEP", "X"
add_bdcdata BdcTable, "SAPMSSY0", "0120", "X", "", ""
add_bdcdata BdcTable, "", "", "", "BDC_OKCODE", "=BACK"
add_bdcdata BdcTable, "ZRITSJOD", "1000", "X", "", ""
add_bdcdata BdcTable, "", "", "", "BDC_OKCODE", "/EBACK"
add_bdcdata BdcTable, "", "", "", "BDC_CURSOR", "P_BTCI"
Functions.Connection.Logoff
End Sub
Answer:
Hi ,
I don't see the VBA code for calling the RFC itself .
use RfcCallTransaction.call method for RFC call .
Regards
Poonam
Answer:
hello,
That i don't understand is that in an other program it's working properly...
i must be an idiot to not understand why it doesn't work...
Naos