Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from win32com.client import Dispatch
- R3 = Dispatch("SAP.Functions")
- R3.Conn.System = 'xxx'
- R3.Conn.Client = '100'
- # other values needed to pass to R3.Conn
- R3.Conn.logon #here is the problem
- from win32com.client import Dispatch
- Functions = Dispatch("SAP.Functions")
- Functions.Connection.Client = "000"
- Functions.Connection.ApplicationServer = "your server"
- Functions.Connection.Language = "EN"
- Functions.Connection.User = "you"
- Functions.Connection.Password = "your pass"
- Functions.Connection.SystemNumber = "00"
- Functions.Connection.UseSAPLogonIni = False
- if (Functions.Connection.Logon (0,True) == True):
- print("Logon OK")
- RfcCallTransaction = Functions.Add("RFC_READ_TABLE")
- strExport1 = RfcCallTransaction.exports("QUERY_TABLE")
- strExport2 = RfcCallTransaction.exports("DELIMITER")
- strExport3 = RfcCallTransaction.exports("ROWSKIPS")
- strExport4 = RfcCallTransaction.exports("ROWCOUNT")
- tblOptions = RfcCallTransaction.Tables("OPTIONS")
- #RETURNED DATA
- tblData = RfcCallTransaction.Tables("DATA")
- tblFields = RfcCallTransaction.Tables("FIELDS")
- strExport1.Value = 'AGR_DEFINE'
- strExport2.Value = ";"
- strExport3.Value = 0
- strExport4.Value = 10
- if RfcCallTransaction.Call == True:
- print ("Function call successful")
- #print (tblData.RowCount)
- j = 1
- while j < tblData.RowCount:
- print (tblData(j,"WA"))
- j = j + 1
Add Comment
Please, Sign In to add comment