Skip to Content
avatar image
-2
Former Member

Register street SAP

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.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Mar 30, 2017 at 07:49 AM

    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

    Add comment
    10|10000 characters needed characters exceeded