We have added search box. Key in SAP issue keyword to search
TopBottom

Announcement: wanna exchange links? contact me at sapchatroom@gmail.com.

RE:[sap-dev] Problems to Create Session After SAP Logon

Posted by Admin at
Share this post:
Ma.gnolia DiggIt! Del.icio.us Yahoo Furl Technorati Reddit

Reply from sapwes on Dec 17 at 12:35 PM
Michael:

Set SAPsession = oConnection.Children(0)

Wes

---------------Original Message---------------
From: Peter Müller
Sent: Monday, December 17, 2012 4:13 AM
Subject: Problems to Create Session After SAP Logon

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.
 
__.____._
Manage Settings | Unsubscribe | Create FAQ | Send Feedback
  
Copyright © 2012 Ziff Davis, Inc. and message author.
Ziff Davis, Inc. 28 E 28th Street New York, NY 10016
sapwes  

Jack
achievements
 
Mark as helpful
View this online
Ask a new question
 
In the Spotlight
Toolbox.com for iPhone & Android: Ask Questions & Get Answers Anywhere. Download the Free App

_.____.__

0 comments:

Post a Comment

T r a n s l a t e to your language