Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Im looking for some advice on a SAP script

former_member604388
Discoverer
0 Kudos

This is hte report i am looking to run, its a fairly simple report and im looking to just pull the balances for 3 differnt CCs. How do i amend hte script so that it always pulls the balance of the account not just line 53 which it seems to be doing at the moment? Any help would be appreciated

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
session.findById("wnd[0]").maximize
session.findById("wnd[0]/tbar[0]/okcd").text = "/NS_ALR_87013611"
session.findById("wnd[0]").sendVKey 0
session.findById("wnd[0]/usr/ctxt$1KOKRE").text = "1000"
session.findById("wnd[0]/usr/txt$1GJAHR").text = InputBox("Enter year","")
session.findById("wnd[0]/usr/ctxt$1PERIV").text = InputBox("Enter from period","")
session.findById("wnd[0]/usr/ctxt$1PERIB").text = InputBox("Enter to period","")
session.findById("wnd[0]/usr/ctxt_1KOSET-LOW").setFocus
session.findById("wnd[0]/usr/ctxt_1KOSET-LOW").caretPosition = 0
session.findById("wnd[0]/usr/btn%__1KOSET_%_APP_%-VALU_PUSH").press
session.findById("wnd[1]/usr/tabsTAB_STRIP/tabpSIVA/ssubSCREEN_HEADER:SAPLALDB:3010/tblSAPLALDBSINGLE/ctxtRSCSEL_255-SLOW_I[1,0]").text = "381419"
session.findById("wnd[1]/usr/tabsTAB_STRIP/tabpSIVA/ssubSCREEN_HEADER:SAPLALDB:3010/tblSAPLALDBSINGLE/ctxtRSCSEL_255-SLOW_I[1,1]").text = "381420"
session.findById("wnd[1]/usr/tabsTAB_STRIP/tabpSIVA/ssubSCREEN_HEADER:SAPLALDB:3010/tblSAPLALDBSINGLE/ctxtRSCSEL_255-SLOW_I[1,2]").text = "381420"
session.findById("wnd[1]/usr/tabsTAB_STRIP/tabpSIVA/ssubSCREEN_HEADER:SAPLALDB:3010/tblSAPLALDBSINGLE/ctxtRSCSEL_255-SLOW_I[1,2]").setFocus
session.findById("wnd[1]/usr/tabsTAB_STRIP/tabpSIVA/ssubSCREEN_HEADER:SAPLALDB:3010/tblSAPLALDBSINGLE/ctxtRSCSEL_255-SLOW_I[1,2]").caretPosition = 6
session.findById("wnd[1]/tbar[0]/btn[8]").press
session.findById("wnd[0]/tbar[1]/btn[8]").press
session.findById("wnd[0]/usr").verticalScrollbar.position = 53
session.findById("wnd[0]/usr/lbl[36,32]").setFocus
session.findById("wnd[0]/usr/lbl[36,32]").caretPosition = 10
session.findById("wnd[0]").sendVKey 2
session.findById("wnd[1]/usr/lbl[1,1]").caretPosition = 11
session.findById("wnd[1]").sendVKey 2
session.findById("wnd[0]/mbar/menu[0]/menu[3]/menu[1]").select
session.findById("wnd[1]/tbar[0]/btn[0]").press
session.findById("wnd[1]/usr/subSUBSCREEN_STEPLOOP:SAPLSPO5:0150/sub:SAPLSPO5:0150/radSPOPLI-SELFLAG[0,0]").select
session.findById("wnd[1]/usr/subSUBSCREEN_STEPLOOP:SAPLSPO5:0150/sub:SAPLSPO5:0150/radSPOPLI-SELFLAG[0,0]").setFocus
session.findById("wnd[1]/tbar[0]/btn[0]").press
session.findById("wnd[1]/tbar[0]/btn[0]").press
session.findById("wnd[1]/tbar[0]/btn[0]").press
REM FINALIZATION CONTROL CHECK ************************

aux=col1 & " " & col2 & " " & col3 & " " & col4
msgbox "Process Completed"

REM FINALIZATION CONTROL CHECK ************************

1 REPLY 1

former_member604388
Discoverer
0 Kudos

Any help would be appreciated