+ Reply to Thread
Results 1 to 2 of 2

VBA and SAP issue

  1. #1
    Registered User
    Join Date
    08-07-2019
    Location
    Scotland
    MS-Off Ver
    2016
    Posts
    56

    VBA and SAP issue

    Hey All,

    I am trying to automate a process as it is been ran daily, i want to use task scheduler to run this and send out a report.

    My issue is this I run one report in SAP it leaves a pop up box in the SAP window saying to save the data in the spreadsheet, i have the vba closing this pop up once i have copied over the report. This box is meaning when i try to link into the next report it will error out.

    Save.GIF

    How can i open a new SAP window and run the next one from there, or open two to begin with then close this one?

    Trying to run the SUBs 'SAPRUN' then 'zhwc'

    Any help is greatly appreciated

    Cheers
    Attached Files Attached Files

  2. #2
    Registered User
    Join Date
    08-07-2019
    Location
    Scotland
    MS-Off Ver
    2016
    Posts
    56

    Re: VBA and SAP issue

    Hello all,

    I managed to solve this one myself by adding in the following code to the end

    Workbooks("Worksheet in detcap (1)").Close SaveChanges:=False
    ' close SAP pop up menu and return to main screen, the pond
    session.findById("wnd[1]/usr/subSUBSCREEN_STEPLOOP:SAPLSPO5:0150/sub:SAPLSPO5:0150/radSPOPLI-SELFLAG[0,0]").Select
    session.findById("wnd[1]/usr/subSUBSCREEN_STEPLOOP:SAPLSPO5:0150/sub:SAPLSPO5:0150/radSPOPLI-SELFLAG[0,0]").SetFocus
    session.findById("wnd[1]/tbar[0]/btn[0]").press
    session.findById("wnd[1]/tbar[0]/btn[0]").press
    session.findById("wnd[1]/tbar[0]/btn[0]").press
    session.findById("wnd[0]/tbar[0]/btn[3]").press
    session.findById("wnd[0]/tbar[0]/btn[3]").press
    session.findById("wnd[0]/tbar[0]/btn[3]").press
    Exit Sub

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Listbox issue + Setfocus after property Issue
    By naveenmarapaka in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 03-27-2018, 09:42 PM
  2. Replies: 7
    Last Post: 12-15-2017, 12:14 AM
  3. Lookup Formula Issue, Search issue
    By kperitz in forum Excel Formulas & Functions
    Replies: 13
    Last Post: 04-07-2014, 01:50 PM
  4. Issue with X axis values NOT graphing on Scatter graph and issue with Labels
    By lmausolf in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-17-2012, 07:20 AM
  5. Issue - Image button issue - by JBeaucaire
    By Vaibhav in forum Suggestions for Improvement
    Replies: 2
    Last Post: 05-06-2012, 07:35 AM
  6. [SOLVED] Issue - Attachment issue - by Simon Lloyd
    By Vaibhav in forum Suggestions for Improvement
    Replies: 16
    Last Post: 03-16-2012, 06:56 PM
  7. [SOLVED] Issue -Joke thread issue - Mordred
    By Vaibhav in forum Suggestions for Improvement
    Replies: 2
    Last Post: 02-17-2012, 01:31 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1