Thema Datum  Von Nutzer Rating
Antwort
Rot VBA im SAP: Eine Schlaufe generieren
27.01.2016 14:01:00 MRP Neuling
NotSolved

Ansicht des Beitrags:
Von:
MRP Neuling
Datum:
27.01.2016 14:01:00
Views:
1269
Rating: Antwort:
  Ja
Thema:
VBA im SAP: Eine Schlaufe generieren
Guten Tag zusammen :) habe als Neuling das Forum durchsucht aber leider keine Antwort gefunden :( Mein Problem: ich muss eine Art "MassChange" per Transaktion COOIS ermöglichen (ist für unsere Produktion flexibler). Dazu benötige ich jedoch eine Schleife, die alle eingegebenen Order Nummern durchgeht und den selben Wert einfügt. Gewünschter Ablauf Script: COOIS->MULTIPLE SELECTIONS->alle Order Nummern eintragen->order nach order z.B den Lagerort wechseln (mein aktuelles Problem: ich weiss nicht wie das sap immer eine zeile darunter auswählt und die aktion beim nächsten Auftrag wiederholt. mein Code: 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[1]/btn[8]").press session.findById("wnd[0]/usr/cntlCUSTOM/shellcont/shell/shellcont/shell").pressToolbarButton "OBAE" session.findById("wnd[0]/usr/tabsTABSTRIP_0115/tabpKOWE").select session.findById("wnd[0]/usr/tabsTABSTRIP_0115/tabpKOWE/ssubSUBSCR_0115:SAPLCOKO1:0190/ctxtAFPOD-LGORT").text = "0235" session.findById("wnd[0]/usr/tabsTABSTRIP_0115/tabpKOWE/ssubSUBSCR_0115:SAPLCOKO1:0190/ctxtAFPOD-LGORT").setFocus session.findById("wnd[0]/usr/tabsTABSTRIP_0115/tabpKOWE/ssubSUBSCR_0115:SAPLCOKO1:0190/ctxtAFPOD-LGORT").caretPosition = 4 session.findById("wnd[0]/tbar[0]/btn[11]").press session.findById("wnd[0]/usr/cntlCUSTOM/shellcont/shell/shellcont/shell").currentCellRow = 1 session.findById("wnd[0]/usr/cntlCUSTOM/shellcont/shell/shellcont/shell").pressToolbarButton "OBAE" session.findById("wnd[0]/usr/tabsTABSTRIP_0115/tabpKOWE").select session.findById("wnd[0]/usr/tabsTABSTRIP_0115/tabpKOWE/ssubSUBSCR_0115:SAPLCOKO1:0190/ctxtAFPOD-LGORT").text = "0235" session.findById("wnd[0]/usr/tabsTABSTRIP_0115/tabpKOWE/ssubSUBSCR_0115:SAPLCOKO1:0190/ctxtAFPOD-LGORT").setFocus session.findById("wnd[0]/usr/tabsTABSTRIP_0115/tabpKOWE/ssubSUBSCR_0115:SAPLCOKO1:0190/ctxtAFPOD-LGORT").caretPosition = 4 session.findById("wnd[0]/tbar[0]/btn[11]").press session.findById("wnd[0]/usr/cntlCUSTOM/shellcont/shell/shellcont/shell").currentCellRow = 2 session.findById("wnd[0]/usr/cntlCUSTOM/shellcont/shell/shellcont/shell").pressToolbarButton "OBAE" session.findById("wnd[0]/usr/tabsTABSTRIP_0115/tabpKOWE").select session.findById("wnd[0]/usr/tabsTABSTRIP_0115/tabpKOWE/ssubSUBSCR_0115:SAPLCOKO1:0190/ctxtAFPOD-LGORT").text = "0235" session.findById("wnd[0]/usr/tabsTABSTRIP_0115/tabpKOWE/ssubSUBSCR_0115:SAPLCOKO1:0190/ctxtAFPOD-LGORT").setFocus session.findById("wnd[0]/usr/tabsTABSTRIP_0115/tabpKOWE/ssubSUBSCR_0115:SAPLCOKO1:0190/ctxtAFPOD-LGORT").caretPosition = 4 session.findById("wnd[0]/tbar[0]/btn[11]").press session.findById("wnd[0]/usr/cntlCUSTOM/shellcont/shell/shellcont/shell").currentCellRow = 3 session.findById("wnd[0]/usr/cntlCUSTOM/shellcont/shell/shellcont/shell").pressToolbarButton "OBAE" session.findById("wnd[0]/usr/tabsTABSTRIP_0115/tabpKOAL").select session.findById("wnd[0]/usr/tabsTABSTRIP_0115/tabpKOWE").select session.findById("wnd[0]/usr/tabsTABSTRIP_0115/tabpKOWE/ssubSUBSCR_0115:SAPLCOKO1:0190/ctxtAFPOD-LGORT").text = "0235" session.findById("wnd[0]/usr/tabsTABSTRIP_0115/tabpKOWE/ssubSUBSCR_0115:SAPLCOKO1:0190/ctxtAFPOD-LGORT").setFocus session.findById("wnd[0]/usr/tabsTABSTRIP_0115/tabpKOWE/ssubSUBSCR_0115:SAPLCOKO1:0190/ctxtAFPOD-LGORT").caretPosition = 4 session.findById("wnd[0]/tbar[0]/btn[11]").press session.findById("wnd[0]/tbar[0]/btn[3]").press danke für jegliche hilfe :)

Ihre Antwort
  • Bitte beschreiben Sie Ihr Problem möglichst ausführlich. (Wichtige Info z.B.: Office Version, Betriebssystem, Wo genau kommen Sie nicht weiter)
  • Bitte helfen Sie ebenfalls wenn Ihnen geholfen werden konnte und markieren Sie Ihre Anfrage als erledigt (Klick auf Häckchen)
  • Bei Crossposting, entsprechende Links auf andere Forenbeiträge beifügen / nachtragen
  • Codeschnipsel am besten über den Code-Button im Text-Editor einfügen
  • Die Angabe der Emailadresse ist freiwillig und wird nur verwendet, um Sie bei Antworten auf Ihren Beitrag zu benachrichtigen
Thema: Name: Email:



  • Bitte beschreiben Sie Ihr Problem möglichst ausführlich. (Wichtige Info z.B.: Office Version, Betriebssystem, Wo genau kommen Sie nicht weiter)
  • Bitte helfen Sie ebenfalls wenn Ihnen geholfen werden konnte und markieren Sie Ihre Anfrage als erledigt (Klick auf Häckchen)
  • Bei Crossposting, entsprechende Links auf andere Forenbeiträge beifügen / nachtragen
  • Codeschnipsel am besten über den Code-Button im Text-Editor einfügen
  • Die Angabe der Emailadresse ist freiwillig und wird nur verwendet, um Sie bei Antworten auf Ihren Beitrag zu benachrichtigen

Thema Datum  Von Nutzer Rating
Antwort
Rot VBA im SAP: Eine Schlaufe generieren
27.01.2016 14:01:00 MRP Neuling
NotSolved