Liquid UI - WS Reference Library

4.1.2 Running Excel Scripts


The Excel template generates an Excel spreadsheet. It also will generate a script that can transfer data from that spreadsheet to SAP. Error handling is included, enabling you to correct any errors before transmitting the data to SAP. To run an Excel script, please do the following.

  1. Find the generated Workbench script. If you are logged into SAP, this script will be in the script directory specified in the Guixt configuration file. If you are not logged into SAP, the script will be in the Workbench directory. The script will be named 'TCODE_excel.sjs', so if we used the VA01 transaction, the script will be named 'VA01_excel.sjs'. The name can be found in the Screen Name filed in the Workbench Settings tab.
  2. Rename the generated script to the actual name of the SAP screen in question. In our example, we are using the VA01 transaction, so the new name will be 'SAPMV45A.E0101.sjs'.
    Note: If there is an existing script with the same name in the script directory, temporarily rename the existing script to something else.
  3. Close all open SAP windows, including the logon pad.
  4. Go to the script directory and ensure that the ELOGON.sjs file is present and that it contains the command to load the wsoffice extension.
    Note: WSOffice is an extension to the WS platform that is bundled with Workbench. It must be loaded for the Excel functionality to work correctly. Please consult the WS Reference Library on the Synactive website for instructions on how to load the necessary files.
  5. Find the spreadsheet generated by Workbench. It should be in the Workbench directory. Open the spreadsheet and enter the data you will upload to SAP.
    Note: You must close the spreadsheet when you are done entering data and you cannot make changes to the spreadsheet during the upload process.
  6. Re-launch SAP and navigate to the VA01 screen. It should now appear as in the example shown below. You can now enter data as needed.

  7. Click the Import from Excel button.
  8. A Windows dialog will appear, asking the user to specify an Excel spreadsheet, as shown below.

  9. Choose the appropriate spreadsheet. In our example, we will select the spreadsheet named 'VA01_TestExcel.xls' as shown above. Then click Open.
  10. The Excel spreadsheet will open. Both the spreadsheet and the command window will show the progress of the migration and will display any errors that may occur during the migration process as shown in the example below.

    Note: If you have not entered any data in the spreadsheet, no actions will occur when you click the Import button in SAP.
  11. If you entered any erroneous data, the spreadsheet will display the errors as in the example below.

    Note: e
  12. If any errors occur, you can manually edit the Excel sheet to correct the errors. Once you make your changes, close the Excel spreadsheet and click the Import button in SAP.
  13. After the data is uploaded, the spreadsheet will appear as in the following example.

    Note:
  14. After the upload successfully completes, you can view your data by searching for the newly created records in the corresponding Display transaction in SAP.