on 07-08-2015 6:36 PM
strName =session.findById("wnd[0]/usr/tabsTABSTRIP_2000/tabpKOSL/ssubSUBSCR_2000:SAPLCOVG:2054/tblSAPLCOVGTCTRL_2054/ctxtAFVGD-VORNR[0,0]").text
will not this assign the value from row and column to string value called Name?
Have you tried it?
What you want to achieve?
For me it seems like you want to Transfer a cell value from a dynamic Sub table to an string variable. So it should work
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
yes I have the field with the Scripting tracker and the field is available and can see what the value is. I think it is something to do with the assignment to the variable that is the problem but I have no idea why it does not like the way I declare the variable that is to hold the value returned from the script.
here is the code that I am working on
If Not IsObject(application) Then
Set SapGuiAuto = GetObject("SAPGUI")
Set application = SapGuiAuto.GetScriptingEngine
End If
If Not IsObject(connection) Then
Set connection = application.Children(0)
End If
If Not IsObject(session) Then
Set session = connection.Children(0)
End If
If IsObject(WScript) Then
WScript.ConnectObject session, "on"
WScript.ConnectObject application, "on"
End If
strNetwork = InputBox("Please enter a network number", _ "Network #") rem This will get the network you want to move
strActivity = InputBox("Please enter the activity you want to Move") Rem this will give you the activity you want to move in this case DCRV
strWorkCentre = InputBox("Please enter the new work centre to move the activity to") rem in this case the work centre to move to is DSOPENN
rem the next block of statements takes the network number and goes to internal activity Screen
session.findById("wnd[0]/usr/ctxtCAUFVD-AUFNR").text =strNetwork rem using input box for network but will eventually use spreadsheet of network numbers as input
session.findById("wnd[0]").resizeWorkingPane 173,32,false
session.findById("wnd[0]/usr/ctxtCAUFVD-AUFNR").caretPosition = 7
session.findById("wnd[0]").sendVKey 0
session.findById("wnd[0]/tbar[1]/btn[7]").press
'find activity, select row, go into it
strName = session.findById("[/wnd[0]/usr/tabsTABSTRIP_2000/tabpARBL/ssubSUBSCR_2000:SAPLCOVG:2030/tblSAPLCOVGTCTRL_2030/txtAFVGD-VORNR[0,0]").text
Everything works great except the last line of code
As your code is not calling any Transaction I guess you call first correct Transaction and Screen Manual. If you have more than one session open it might be that your code is adopt to wrong session. Or you have not correct Sub tab open in Transaction.
Is your code defintely stopping when correct session got used and field is visible?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.