Ir para conteúdo
Fórum Script Brasil
  • 0

RPA SAP


Eduardo Veras

Pergunta

Código com erro nas seguintes linhas:

1° ERRO:

session.findById("wnd[0]/shellcont/shell/shellcont[1]/shell[0]").pressContextButton "SELECT"
session.findById("wnd[0]/shellcont/shell/shellcont[1]/shell[0]").SelectContextMenuItem ("Purchase_Requisitions")

2° ERRO:

session.findById("wnd[0]/shellcont/shell/shellcont[1]/shell[1]").selectItem "          1", "&Hierarchy"
session.findById("wnd[0]/shellcont/shell/shellcont[1]/shell[1]").ensureVisibleHorizontalItem "          1", "&Hierarchy"
session.findById("wnd[0]/shellcont/shell/shellcont[1]/shell[0]").pressButton "COPY"

Não estou conseguindo resolver, já tentei de tudo.

Segue código detalhado.

Sub Criar_OC()

Call Star_SAP


session.findById("wnd[0]/tbar[0]/okcd").Text = "/nme21n"
session.findById("wnd[0]").sendVKey 0

session.findById("wnd[0]/shellcont/shell/shellcont[1]/shell[0]").pressContextButton "SELECT"
If Err = 0 Then
session.findById("wnd[0]/shellcont/shell/shellcont[1]/shell[0]").pressContextButton "SELECT"
session.findById("wnd[0]/shellcont/shell/shellcont[1]/shell[0]").SelectContextMenuItem ("Purchase_Requisitions")
session.findById("wnd[0]/usr/ctxtSP$00026-LOW").Text = "19032374"
session.findById("wnd[0]/usr/ctxtSP$00026-LOW").SetFocus
session.findById("wnd[0]/usr/ctxtSP$00026-LOW").caretPosition = 8
session.findById("wnd[0]/tbar[1]/btn[8]").press
session.findById("wnd[0]/usr/ctxtSP$00026-LOW").SetFocus
session.findById("wnd[0]/usr/ctxtSP$00026-LOW").caretPosition = 8
session.findById("wnd[0]/tbar[1]/btn[8]").press
session.findById("wnd[0]/shellcont/shell/shellcont[1]/shell[1]").selectItem "          1", "&Hierarchy"
session.findById("wnd[0]/shellcont/shell/shellcont[1]/shell[1]").ensureVisibleHorizontalItem "          1", "&Hierarchy"
session.findById("wnd[0]/shellcont/shell/shellcont[1]/shell[0]").pressButton "COPY"

If Err <> 0 Then
session.findById("wnd[0]/tbar[1]/btn[8]").press
session.findById("wnd[0]/shellcont/shell/shellcont[1]/shell[0]").pressContextButton "SELECT"
session.findById("wnd[0]/shellcont/shell/shellcont[1]/shell[0]").SelectContextMenuItem ("Purchase_Requisitions")
session.findById("wnd[0]/usr/ctxtSP$00026-LOW").Text = "19032374"
session.findById("wnd[0]/usr/ctxtSP$00026-LOW").SetFocus
session.findById("wnd[0]/usr/ctxtSP$00026-LOW").caretPosition = 8
session.findById("wnd[0]/tbar[1]/btn[8]").press
session.findById("wnd[0]/usr/ctxtSP$00026-LOW").SetFocus
session.findById("wnd[0]/usr/ctxtSP$00026-LOW").caretPosition = 8
session.findById("wnd[0]/tbar[1]/btn[8]").press
session.findById("wnd[0]/shellcont/shell/shellcont[1]/shell[1]").selectItem "          1", "&Hierarchy"
session.findById("wnd[0]/shellcont/shell/shellcont[1]/shell[1]").ensureVisibleHorizontalItem "          1", "&Hierarchy"
session.findById("wnd[0]/shellcont/shell/shellcont[1]/shell[0]").pressButton "COPY"

End If
End If

Editado por Eduardo Veras
Link para o comentário
Compartilhar em outros sites

0 respostass a esta questão

Posts Recomendados

Até agora não há respostas para essa pergunta

Participe da discussão

Você pode postar agora e se registrar depois. Se você já tem uma conta, acesse agora para postar com sua conta.

Visitante
Responder esta pergunta...

×   Você colou conteúdo com formatação.   Remover formatação

  Apenas 75 emoticons são permitidos.

×   Seu link foi incorporado automaticamente.   Exibir como um link em vez disso

×   Seu conteúdo anterior foi restaurado.   Limpar Editor

×   Você não pode colar imagens diretamente. Carregar ou inserir imagens do URL.



  • Estatísticas dos Fóruns

    • Tópicos
      152,1k
    • Posts
      651,8k
×
×
  • Criar Novo...