Skip to Content
0
Jun 09, 2020 at 05:22 PM

Script to copy ABC Indicator in the IL03 Panel

56 Views Last edit Jun 09, 2020 at 04:25 PM 2 rev

I'm trying to write a script to copy the value in the ABC Indicator field from the IL03 panel. So far I can launch SAP from an excel macro, go to the IL03 using a functional location that I specify in Excel, but from here I'm lost. Once I get to the IL03 panel, how do I take the value in the ABC Indicator field and put it in either the clipboard or directly into an Excel cell?

' Opens SAP

Dim SapGuiAuto
    Dim SetApp
    Dim Connection
    Dim Session

    Set SapGuiAuto = GetObject("SAPGUI")
    Set SetApp = SapGuiAuto.GetScriptingEngine
    Set Connection = SetApp.Children(0)
    Set Session = Connection.Children(0)
    
'Goes to IL03 Panel

Session.findById("wnd[0]").resizeWorkingPane 169, 41, False
Session.findById("wnd[0]/tbar[0]/okcd").Text = "/nIL03"
Session.findById("wnd[0]").sendVKey 0

'Inserts Value from Functional Location in Excel

Session.findById("wnd[0]/usr/ctxtIFLO-TPLNR").Text = Sheet1.Cells(9, 3).Value
Session.findById("wnd[0]").sendVKey 0

I can see that the field appears to be F[T370C_T-ABCTX] with location [11,31], but I'm not sure what do with that.

Attachments

il03.png (8.0 kB)