![]() ![]() ![]() if there were a complex set of parameter screens, or non-standard ways of exporting data). ![]() This could be extended to support more complex parameters, such as lists of values.Ĭlearly this tool would have limits (e.g. PReportInfo.outputFileName = "Export.xlsx"įunction setParam(pName, pLowValue, pHighValue) As String() The tool would consist primarily of a module which would contain the functions/subroutines below: Type reportInfoType Instead, create a VBA function (and associated subroutines) called extractExcel which can interpret the following data structure and perform the actions above: Dim extractSAPParams As Collection Session.findById("wnd/usr/ctxtDY_FILENAME").text = "test.txt" Session.findById("wnd/usr/subSUBSCREEN_STEPLOOP:SAPLSPO5:0150/sub:SAPLSPO5:0150/radSPOPLI-SELFLAG").select Session.findById("wnd/usr/txtMAX_SEL").text = "2" ![]() Session.findById("wnd/usr/ctxtDATABROWSE-TABLENAME").Text = "T001" Set session = SAPCon.Children(0) 'Get the first session (window) on that connection Set SAPCon = SAPApp.Children(0) 'Get the first system that is currently connected Set SAPApp = SapGuiAuto.GetScriptingEngine 'Get the currently running SAP GUI TCode, field names (in business terms), and any values to update.įor example, here's the traditional way of performing an extract: Set SapGuiAuto = GetObject("SAPGUI") 'Get the SAP GUI Scripting object Since the fields in the SAP GUI are named using a consistent naming convention, and API calls exist to iterate over all objects displayed in a screen, I could create a tool that performs all tasks above, but instead of coding each step in the process, create a data structure which captures the data needed to do an export - e.g. My question: could a generalized tool be created? If so, does it already exist? Also, SAP sometimes initializes these with default values that need to be cleared. This is a relatively complicated process to code because you need to know the names of each GUI element that you need to set. We have been using VBA scripting to do this, using the approach described in. My team often needs to extract data from the SAP R3 GUI into a file format such as Excel. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |