Search code examples
export-to-excelsap-guidynpro

How to find selection items lists in SAP GUI


In SAP GUI, there are dropdown fields sometimes with a list of items like countries, nationalities, titles, etc.

I need to copy such lists into Excel but I can only select one value. I can not copy all available values directly(?).

In the current case, my field's Dynpro-Name is P0002-TITEL, that has many entries I want to copy to Excel.
I don't have a developer key, I can just look into a few TAs like se16.

What's the easiest way for me to get the values I'm looking for without having to search through tables or copy the single values one by one?


Solution

  • As far as I know you cannot copy values directly from dropdown lists in SAP GUI.

    Solution 1

    Programs build these lists in various ways (DB table, direct values), so I would go with SE16 after guessing the DB table from fieldname, if you are lucky you get the values there. Check the domain's attributes behind the dynpro field, if it contains a value table, you should find the values there with SE16.

    Solution 2

    SAP GUI stores dropdown values in cache in XML format. You can find these cache files in [USERS DIRECTORY]\[USER]\AppData\Local\SAP\SAP GUI\Cache\. The filenames start with DataP_sapvalueset and one file contains one field's value set. If you directly search for a given value in the directory you can find the corresponding file.

    The found XML can be processed in an online XML parser. I used this tool (link dead) to convert the XML into Excel format.

    Steps to examine data:

    1. Open the file in a good text editor (for example Notepad++). Change XML encoding to utf-8:
      <?xml version="1.0" encoding="sap*"?><?xml version="1.0" encoding="utf-8"?>
    2. Close the file, rename cache file to .xml, reopen it.
    3. Remove everything before <?xml tag after the last tag (so the XML validates).
    4. Upload file to the mentioned page and download the Excel file after converting.
    5. The data can be found on the LINE tab. This is a screenshot of a result of a language dropdown (the list is in Hungarian so the solution works with non-English languages also).

    PS: To combobox fields (the dynpro field), a valueset ID is attached (that's the unique ID you see in the file) which can be found if you turn on SAP GUI trace (with verbose option). But I think that's a little overhead, you can simply find by a search.