Skip to Content
-2

Register street SAP

Mar 17, 2017 at 01:08 PM

141

avatar image
Script:
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 = "/NZMED95"
session.findById("wnd[0]/tbar[0]/btn[0]").press
session.findById("wnd[0]/usr/ctxtADRSTREET-CITY_CODE").text = "4101"
session.findById("wnd[0]/usr/ctxtADRSTREET-CITY_CODE").setFocus
session.findById("wnd[0]/usr/ctxtADRSTREET-CITY_CODE").caretPosition = 4
session.findById("wnd[0]/tbar[1]/btn[7]").press
session.findById("wnd[0]/usr/ctxtADRSTREETT-ZZTIPO_LOGR").text = "RUA"
session.findById("wnd[0]/usr/txtADRSTREETT-ZZNOME_LOGR").text = "TESTE"
session.findById("wnd[0]/usr/tblSAPLZMED_LOGRADOUROTC_SECAO_RUA/txtTI_SECAO_RUA-HOUSENUM_L[1,0]").text = "1"
session.findById("wnd[0]/usr/tblSAPLZMED_LOGRADOUROTC_SECAO_RUA/txtTI_SECAO_RUA-HOUSENUM_H[2,0]").text = "999999"
session.findById("wnd[0]/usr/tblSAPLZMED_LOGRADOUROTC_SECAO_RUA/ctxtTI_SECAO_RUA-POST_CODE[5,0]").text = "31234-564"
session.findById("wnd[0]/usr/tblSAPLZMED_LOGRADOUROTC_SECAO_RUA/ctxtTI_SECAO_RUA-CITYP_CODE[6,0]").text = "10348"
session.findById("wnd[0]/usr/tblSAPLZMED_LOGRADOUROTC_SECAO_RUA/ctxtTI_SECAO_RUA-REGIOGROUP[8,0]").text = "4101"
session.findById("wnd[0]/usr/subNOTICE:SAPLEENO:1001/sub:SAPLEENO:1001/txtEENO_DYNP-ZEILE[0,19]").text = "1234567890"
session.findById("wnd[0]/usr/subNOTICE:SAPLEENO:1001/sub:SAPLEENO:1001/txtEENO_DYNP-ZEILE[0,19]").setFocus
session.findById("wnd[0]/usr/subNOTICE:SAPLEENO:1001/sub:SAPLEENO:1001/txtEENO_DYNP-ZEILE[0,19]").caretPosition = 10
session.findById("wnd[0]").sendVKey 0
session.findById("wnd[1]/usr/btnBUTTON_1").press
session.findById("wnd[0]/tbar[0]/btn[11]").press

Hi,

Hi, I am automating a street register, and I would like to create a condition where you open a screen to confirm ZIP code registration, I press yes, if the screen does not open I press enter and save. The confirmation screen opens on the penultimate line of the script asking you to press the button.

10 |10000 characters needed characters left characters exceeded

This is obviously not an SD question but I'm not sure where it'd even belong... Where are you doing all this? And, most importantly, what is the actual question?

0

Well, this looks like a SAPgui script. There used to be a "space" for SAPgui scripting in the old SCN. I don't see an obvious tag for it now. I'm really not sure what tag to suggest, sorry...

0

I checked the SCN space mapping spreadsheet and SAP GUI space points to this Community page: https://www.sap.com/community/topic/gui.html

It looks like it combines several UI SAP GUI... tags.

Still it's not clear what the question is, there is not even a question mark.

0
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Script Man Mar 30, 2017 at 07:49 AM
0

Hi,

You might try the following:

. . .

session.findById("wnd[0]").sendVKey 0

on error resume next

session.findById("wnd[1]/usr/btnBUTTON_1").press

on error goto 0

session.findById("wnd[0]/tbar[0]/btn[11]").press

Regards,

ScriptMan

Share
10 |10000 characters needed characters left characters exceeded