06-25-2012, 08:01 PM
I need select the menu item marked in red.
When I select this item, it displays a screen where I fill the purchase requisition number and click on the Execute button.
So, I create a purchase order based on the purchase requisition.
object is marked in blue:
Code:
"Class Name: = SAPGuiToolbar"
"abs_x: = 17"
"abs_y: = 236"
"enabled: = True"
"guicomponenttype: = 202"
"height: = 24"
"id = / app / con \ [0 \] / ses \ [0 \] / wnd \ [0 \] / shellcont / shell / shellcont \ [1 \] / shell \ [0 \]"
"name: = shell \ [0 \]"
"type: = GuiShell"
"width: = 367"
"x: = 0"
"y: = 0"
"Class Name: = SAPGuiToolbar"
"abs_x: = 17"
"abs_y: = 236"
"enabled: = True"
"guicomponenttype: = 202"
"height: = 24"
"id = / app / con \ [0 \] / ses \ [0 \] / wnd \ [0 \] / shellcont / shell / shellcont \ [1 \] / shell \ [0 \]"
"name: = shell \ [0 \]"
"type: = GuiShell"
"width: = 367"
"x: = 0"
"y: = 0"
Code:
Code:
If SAPGuiSession("Session").Exist(2) Then
Reporter.ReportEvent micPass, "Session", "Tela Session exibe com Sucesso"
With SAPGuiSession("Session")
.Reset "ME21N"
If .SAPGuiWindow("Criar pedido").Exist(2) Then
Reporter.ReportEvent micPass, "Criar pedido", "Tela Criar pedido exibe com Sucesso"
If .SAPGuiWindow("Criar pedido").SAPGuiButton("Ativar síntese de documentos").Exist(2) Then
.SAPGuiWindow("Criar pedido").SAPGuiButton("Ativar síntese de documentos").Click
End If
Expandir
.SAPGuiWindow("Criar pedido").SAPGuiToolbar("ToolBarControl").PressContextButton "SELECT"
.SAPGuiWindow("Criar pedido").SAPGuiToolbar("ToolBarControl").SelectMenuItem "Requisições de compra"
.SAPGuiWindow("Requisições de compra").SAPGuiEdit("Nº requisição de compra").Set reqCompra
.SAPGuiWindow("Requisições de compra").SAPGuiEdit("Nº requisição de compra").SetFocus
.SAPGuiWindow("Requisições de compra").SendKey ENTER
.SAPGuiWindow("Requisições de compra").SAPGuiButton("Executar (F8)").Click
.
.