Guest User

Untitled

a guest
Sep 3rd, 2018
133
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.41 KB | None | 0 0
  1. from win32com.client import Dispatch
  2.  
  3. R3 = Dispatch("SAP.Functions")
  4. R3.Conn.System = 'xxx'
  5. R3.Conn.Client = '100'
  6. # other values needed to pass to R3.Conn
  7. R3.Conn.logon #here is the problem
  8.  
  9. from win32com.client import Dispatch
  10.  
  11. Functions = Dispatch("SAP.Functions")
  12.  
  13. Functions.Connection.Client = "000"
  14. Functions.Connection.ApplicationServer = "your server"
  15. Functions.Connection.Language = "EN"
  16. Functions.Connection.User = "you"
  17. Functions.Connection.Password = "your pass"
  18. Functions.Connection.SystemNumber = "00"
  19. Functions.Connection.UseSAPLogonIni = False
  20.  
  21. if (Functions.Connection.Logon (0,True) == True):
  22. print("Logon OK")
  23. RfcCallTransaction = Functions.Add("RFC_READ_TABLE")
  24. strExport1 = RfcCallTransaction.exports("QUERY_TABLE")
  25. strExport2 = RfcCallTransaction.exports("DELIMITER")
  26. strExport3 = RfcCallTransaction.exports("ROWSKIPS")
  27. strExport4 = RfcCallTransaction.exports("ROWCOUNT")
  28. tblOptions = RfcCallTransaction.Tables("OPTIONS")
  29. #RETURNED DATA
  30. tblData = RfcCallTransaction.Tables("DATA")
  31. tblFields = RfcCallTransaction.Tables("FIELDS")
  32.  
  33.  
  34. strExport1.Value = 'AGR_DEFINE'
  35. strExport2.Value = ";"
  36. strExport3.Value = 0
  37. strExport4.Value = 10
  38.  
  39. if RfcCallTransaction.Call == True:
  40. print ("Function call successful")
  41. #print (tblData.RowCount)
  42. j = 1
  43. while j < tblData.RowCount:
  44. print (tblData(j,"WA"))
  45. j = j + 1
Add Comment
Please, Sign In to add comment