Announcement:
wanna exchange links? contact me at sapchatroom@gmail.com.
Posted by
Admin at
Question from friedmi on Dec 17 at 4:13 AM Dear all, With following code I do Silent Login to SAP via Scrip, but I can't create session: '***Create the Logon Control Set SAPLogonControl = CreateObject("SAP.Logoncontrol.1") '***Save Connection object to your global variable Set oConnection = SAPLogonControl.NewConnection ' ***These are the system parameters oConnection.System ="052 LYB PRD - SAP Production - Login Required" 'Name (SystemID) 'oConnection.ApplicationServer = "hs2001" 'Applic.Server of R/3 System 'oConnection.SystemNumber = 0 'SystemNumber of your R/3 System ' ***User specific data oConnection.User = "#######" oConnection.Password = "########" oConnection.Client = "010" oConnection.Language = "E" ' ***Try to connect to the R/3 System 'connect = oConnection.Logon (hWnd, True) 'Test = InputBox("SystemID",,oConnection.SystemI D) If oConnection.Logon (hWnd, True) = False Then MsgBox "R/3 connection failed" Else 'MsgBox "Now the connection is established: you can call your functions" End If ' ***Now the connection is established: you can call your functions Set Session = ???????????????? MATNR = InputBox("Enter Materialnumber (for example 10031A00)",,"10031A00") SAPsession.findById("wnd[0]/tbar[0]/okcd" ;).text = "/nmm02" SAPsession.findById("wnd[0]").sendVKey 0 SAPsession.findById("wnd[0]").sendVKey 0 External_Material_Group = Session.findById("wnd[0]/usr/tabsTABSPR1/tabp SP01/ssubTABFRA1:SAPLMGMM:2005/subSUB3:SAPLMGD1:2001/c txtMARA-EXTWG").text Check = Mid(External_Material_Group,5,1) Select Case Check Case "P" Powder = "Material " &MATNR& " is Powder. Please use Antistatic Liner / Shipping Type T9 or B7!" MsgBox Powder Case "G" Granual = ("Material " &MATNR& " is Granual. No use of Antistatic Liner nessecary !") MsgBox Granual End Select oConnection.Logoff Hope someone can help me with this issue. Regards Michael | Reply to this email to post your response. __.____._ | In the Spotlight Become a blogger at Toolbox.com and share your expertise with the community. Start today. _.____.__ |