cancel
Showing results for 
Search instead for 
Did you mean: 

Save SaveAS Dialog SAP report with script recording

maplecui
Discoverer
0 Kudos

I have recorded below SAP Script to download a report from SAP in Excel format. But the script recording does not work since it pop up window to let me choose the file path & file name.

I have try methods I can find in community, but it doesn't work, either.

So How can I save this kinds of file? I have to use the Excel VBA.

Here is to share you the script:

Public Sub DownloadPO()
    Dim SapGuiAuto As Object
    Dim App As Object
    Dim connection As Object
    Dim session As Object
    If App Is Nothing Then
         Set SapGuiAuto = GetObject("SAPGUI")
         Set App = SapGuiAuto.GetScriptingEngine
    End If
    If connection Is Nothing Then
        Set connection = App.Children(0)
    End If
    If session Is Nothing Then
        Set session = connection.Children(0)
    End If

session.findById("wnd[0]").maximize
session.findById("wnd[0]/tbar[0]/okcd").Text = "/nzc564"
session.findById("wnd[0]").sendVKey 0
session.findById("wnd[0]/tbar[1]/btn[17]").press
session.findById("wnd[1]/usr/txtV-LOW").Text = "mrpview"
session.findById("wnd[1]/usr/txtENAME-LOW").Text = ""
session.findById("wnd[1]/usr/txtV-LOW").CaretPosition = 5
session.findById("wnd[1]").sendVKey 0
session.findById("wnd[1]/tbar[0]/btn[8]").press
session.findById("wnd[0]/tbar[1]/btn[8]").press
session.findById("wnd[0]/tbar[1]/btn[2]").press   'pop up window

End Sub

Accepted Solutions (0)

Answers (2)

Answers (2)

former_member763432
Discoverer
0 Kudos

Hi maplecui

I got it. I can did. Now I save the Excel file downloaded from SAP.

I going to try to write the step by step to teach you.

maplecui
Discoverer
maplecui
Discoverer
0 Kudos

Hi Ivan,

My Solution failed...the pop up window appear again...

Can you share your solution? thanks.

former_member763432
Discoverer
0 Kudos

Hi.

I have the same trouble.

Any clue to how to solve it?

Thanks a Lot!!!

maplecui
Discoverer
0 Kudos

not yet...