Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
.vbs script error when trying to insert a value in a sapguitable
#1
hi friends,

i create this piece of code and it is running ok as a .vbs script. the problem is only the last line of code. It is saying that the method is not supported, how can i fixed this problem ?..now the code:

Code:
set WshShell = CreateObject("WScript.Shell") Set proc = WshShell.Exec("C:\Archivos de Programa\SAP\FrontEnd\SAPgui\saplogon.exe") Do While proc.Status = 0 WScript.Sleep 500 Loop Set SapGui = GetObject("SAPGUI") Set Appl = SapGui.GetScriptingEngine Set Connection = Appl.Openconnection("BST - Integracion", True) Set session = Connection.Children(0) session.findById("wnd[0]/usr/txtRSYST-BNAME").Text = "l0609285" session.findById("wnd[0]/usr/pwdRSYST-BCODE").Text = "dm5srH5c" session.findById("wnd[0]/usr/txtRSYST-LANGU").Text = "ES" session.findById("wnd[0]").sendVKey 0 session.findById("wnd[0]/tbar[0]/okcd").Text = "/n/BGBA/LM_LOAN_01" session.findById("wnd[0]").sendVKey 0 session.findById("wnd[0]/usr/ctxtGV_TIPO_DOC").Text = "CUIL" session.findById("wnd[0]/usr/txtGV_NRO_DOC").Text = "30515838399" session.findById("wnd[0]/usr/btnLC_BUSCAR").press Do While proc.Status = 0 WScript.Sleep 100 Loop session.findById("wnd[0]/usr/ctxtCN_BEGIN_D").Text = "20.11.2008" session.findById("wnd[0]/usr/ctxtGV_DATA-VTA_ORGUNIT").Text = "0063" session.findById("wnd[0]/usr/ctxtGV_DATA-PROD_COM").Text = "SF_FIJOFUL" session.findById("wnd[0]/usr/ctxtGV_DATA-INST_ORGUNIT").Text = "0063" session.findById("wnd[0]/usr/btnLC_SAVE").press Do While proc.Status = 0 WScript.Sleep 100 Loop session.findById("wnd[0]/usr/tabsFICHA/tabpFICHA_FC1/ssubFICHA_SCA:/BGBA/SAPMLM_LOAN_CREATE:0201/ctxtGV_DATA-DESTINO").Text = "CAP" session.findById("wnd[0]/usr/tabsFICHA/tabpFICHA_FC1/ssubFICHA_SCA:/BGBA/SAPMLM_LOAN_CREATE:0201/ctxtGV_DATA-COND_GAR").Text = "PAG" session.findById("wnd[0]/usr/tabsFICHA/tabpFICHA_FC1/ssubFICHA_SCA:/BGBA/SAPMLM_LOAN_CREATE:0201/ctxtGV_DATA-DOC_LEG_GAR").Text = "PAGARE" session.findById("wnd[0]").sendVKey 0 session.findById("wnd[0]/usr/tabsFICHA/tabpFICHA_FC3").select session.findById("wnd[0]/usr/tabsFICHA/tabpFICHA_FC3/ssubFICHA_SCA:/BGBA/SAPMLM_LOAN_CREATE:0203/cmbGV_DATA-FIN_COND-AC_CONTRACT-DIVISOR").key = "365" set session.findById("wnd[0]/usr/tabsFICHA/tabpFICHA_FC3/ssubFICHA_SCA:/BGBA/SAPMLM_LOAN_CREATE:0203/tbl/BGBA/SAPMLM_LOAN_CREATETASAS").SetCellData 1, "Tasa","14"

the message: "the object does not support setcelldata method"... it seems that the operations are different than in qtp..
Reply
#2
set will return an object, you simply can not use setcelldata for that.

it shld be something like

Code:
Set variable=session.findById("wnd[0]/usr/tabsFICHA/tabpFICHA_FC3/ssubFICHA_SCA:/BGBA/SAPMLM_LOAN_CREATE:0203/tbl/BGBA/SAPMLM_LOAN_CREATETASAS")

now you should check the property of the 'variable ' to see the possible option to be used.

Regards,
Ankesh
Reply
#3
i also tried :
Code:
session.findById("wnd[0]/usr/tabsFICHA/tabpFICHA_FC3/ssubFICHA_SCA:/BGBA/SAPMLM_LOAN_CREATE:0203/tbl/BGBA/SAPMLM_LOAN_CREATETASAS/ctxt/BGBA/CA_TASAS_T-TASA[3,0]").text = "14"

[3,0] means column and row

and it works fine.
Reply
#4
good to know that it worked for you... Smile
Reply
#5
@ frebuffi / Ankesh

Code:
session.findById("wnd[0]/usr/tabsFICHA/tabpFICHA_FC3/ssubFICHA_SCA:/BGBA/SAPMLM_LOAN_CREATE:0203 /tbl/BGBA/SAPMLM_LOAN_CREATETASAS

this is the id of the table, but how the fallowing string is derived ?


Code:
/ctxt/BGBA/CA_TASAS_T-TASA
Reply
#6
Please ensure to include your code between [code] tags while asking or replying to questions. I have done this for you for this time.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Using SAPGuiTable).SetCellData to Active cell. rhozeski 2 3,161 02-10-2020, 10:44 PM
Last Post: rhozeski
  Error while creating object using description.create object in VB script SarodeGirish 5 7,209 06-19-2012, 05:30 PM
Last Post: ssvali
  VBS to DLL to QTP ssco77 5 13,333 12-16-2011, 01:21 PM
Last Post: prashants1
Exclamation how to Pass Optional Parameters in VBS? ShrikantBiradar3449 1 9,071 06-13-2011, 03:12 AM
Last Post: Skepsis
  Receiving an IIS authentication error when replaying a.net windows application script nithya.cov@gmail.com 0 2,924 04-16-2011, 10:58 AM
Last Post: nithya.cov@gmail.com

Forum Jump:


Users browsing this thread: 1 Guest(s)