Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 04/23/2014 in all areas

  1. seangriffin

    SAP UDF

    I would like to establish a SAP UDF post, considering the amount of discussion so far on how to automate SAP. I recently discovered how to access SAP's Scripting COM object through AutoIT, and began writing this UDF to support it. My time with SAP is limited to working hours so I'll post updates whenever I get the chance. REQUIREMENTS: AutoIt3 3.2 or higher, SAP GUI Release 6.40, SAP GUI Scripting interface is enabled You are already logged into SAP (ie. The "SAP Easy Access" window is displayed) To enable the SAP GUI Scripting interface: From the SAP GUI, select the "Customize Local Layout" button on the toolbar Select "Options". Select the "Scripting" tab. If the message "Scripting is installed!" is not displayed, then contact your SAP administrators to have SAP GUI Scripting installed. Select "Enable Scripting". Deselect "Notify when a script attaches to a running GUI". Deselect "Notify when a script opens a connection". LIST OF FUNCTIONS: EXAMPLES: _SAPSessAttach.au3_SAPSessCreate.au3_SAPVKeysSend.au3_SAPVKeysSendUntilWinExists.au3_SAPObjSelect.au3_SAPObjValueSet.au3_SAPObjValueGet.au3_SAPObjPropertySet.au3_SAPObjPropertyGet.au3_SAPWinExists.au3_SAPWinClose.au3 The following code is a simple example of using the UDF. Ensure you have met the requirements outlined in the REQUIREMENTS section above before commencing. #include <SAP.au3> _SAPSessAttach("SAP Easy Access") _SAPSessCreate("pa30") _SAPObjValueSet("usr/subSUBSCR_PERNR:SAPMP50A:0120/ctxtRP50G-PERSONID_EXT", "00000018") _SAPVKeysSend("Enter") $pers_no = _SAPObjValueGet("usr/subSUBSCR_PERNR:SAPMP50A:0120/ctxtRP50G-PERSONID_EXT") The first function is _SAPSessAttach. This establishes a connection to a SAP window. In the example, we connect to the first SAP window displayed after logging in to SAP - the SAP Easy Access window. From here, all other functions will operate within this SAP window / session. _SAPSessCreate then opens a new SAP session, and runs a transaction within it. In the example, this takes us to the Maintain HR Master Data screen (transaction pa30). _SAPObjValueSet sets the value of an object / control within the current SAP window. In the example, this sets the Personnel no. field to 00000018. To determine the ID of a SAP Object (ie. the Personnel no. field ID "usr/subSUBSCR_PERNR:SAPMP50A:0120/ctxtRP50G-PERSONID_EXT"), follow these manual steps in SAP: Select the "Customize Local Layout" button on the toolbar. Select "Script Development Tools". Select "Do a hit test on the window". Move your mouse to the object you want the ID of. Click "Copy Id" in the Scripting Wizard. Paste this ID into the function in your script. Remove all text upto and including "wnd[n]/". _SAPVKeysSend is then used to press the Enter key, and update the Maintain HR Master Data screen with the employee's details. The last line of the example gets the value of the Personnel no. field, using _SAPObjValueGet. DOWNLOAD: Latest Version - v0.4 (07/01/09) SAP.au3 SAP.au3
    1 point
  2. Run LPKSETUP /? to see your options. You just have to use the /u switch and specify the language packs to uninstall.
    1 point
  3. Second update. See first post. The implementations are based on Shell interfaces. This means that most functionality of Windows Explorer is working automatically without any additional code. But you still have to integrate that functionality into your script. Especially you have to take care of keystrokes in combination with various controls and windows. E.g. the rename edit box, the context menu and dialog boxes. This integration is mostly implemented in the second update.
    1 point
  4. MHz

    Ping forum user MhZ.

    Ah, long time ago. I have reminded myself from your old post >here. AFAIK, NVU stopped development and a derivative started with KompoZer. The latter worked fine IIRC though it may still have bugs so save often to prevent loss of effort. KompoZer has stopped development as well so it is what it is. I have not had much to do with WYSIWYG HTML editors since then and do it by hand with the initial help of templates. I still use HTML Help Workshop and it has not been updated AFAIK since last you may have used it. The AutoIt3 help file is compiled with HTML Help Workshop FYI. These are perhaps simple tools but they achieve the purpose that I consider that you may want for your task. IIRC, someone did a script in the Examples forum for creating a help file for UDFs using HTML Help Workshop that is perhaps worth a search for. It is nice to enjoy a chat with you again.
    1 point
  5. FireFox

    Array memory allocation

    Why don't you use the UBound function?
    1 point
  6. AZJIO

    IniVirtual

    @Taomyn Add at the beginning of each regular expression (*LF). This will restore the standard interpretation of the end of the line
    1 point
  7. I always has a variable named count or something that I increment everytime I add data, that way I always know how much I have filled my arrays.
    1 point
×
×
  • Create New...