Skip to Content

As reported in my comment yesterday afternoon on my first post in this series, my clone of the WD-ABAP component wdr_test_ui_elements worked almost perfectly after making four minor changes in typing.  You can find the post and the comment here:

asterisked section and proceeding upwards:

REPORT  Z_WDY_TO_ZWDY.

DATA:

wa_zwdyl TYPE wdy_ui_library,

wa_zwdye TYPE wdy_ui_elem_def,

i_zwdyl  TYPE wdy_ui_library_table,

i_zwdye  TYPE wdy_ui_elem_def_table.

**************************************************

  • Step 5:

******************************************************

wa_zwdye-library_name    = ‘PrgTrs’.

wa_zwdye-definition_name = ‘BBK’.

wa_zwdye-display_name = ‘Document Numbers by Cost Center’.

wa_zwdye-runtime_class   = ‘CL_WD_BBK’.

INSERT INTO zwdy_ui_elem_def VALUES wa_zwdye.

wa_zwdye-definition_name = ‘PTA’.

wa_zwdye-display_name = ‘Projects to Activities’.

wa_zwdye-runtime_class   = ‘CL_WD_PTA’.

INSERT INTO zwdy_ui_elem_def VALUES wa_zwdye.

COMMIT WORK.

**************************************************

  • Step 4:

******************************************************

*wa_zwdye-library_name    = ‘RptSts’.

*

        • GS01 PCA-CORP

*wa_zwdye-definition_name = ‘CBI’.

*wa_zwdye-display_name = ‘Balance Sheet/Income Statement’.

*wa_zwdye-runtime_class   = ‘CL_WD_CBI’.

*

        • GS01 BFS-ALL

*INSERT INTO zwdy_ui_elem_def VALUES wa_zwdye.

*

*wa_zwdye-definition_name = ‘MOP’.

*wa_zwdye-display_name = ‘Manufacturing Operations’.

*wa_zwdye-runtime_class   = ‘CL_WD_MOP’.

*

*INSERT INTO zwdy_ui_elem_def VALUES wa_zwdye.

*

          • 34-2 KAH3

*wa_zwdye-definition_name = ‘MMS’.

*wa_zwdye-display_name = ‘Maintenance/Mechanical Services’.

*wa_zwdye-runtime_class   = ‘CL_WD_KLF’.

*

*INSERT INTO zwdy_ui_elem_def VALUES wa_zwdye.

*

*COMMIT WORK.

*************************************************

  • Step 3:

******************************************************

*wa_zwdye-library_name    = ‘LgclDBS’.

*

*wa_zwdye-definition_name = ‘KDF’.

*wa_zwdye-display_name = ‘Vendor Database’.

*wa_zwdye-runtime_class   = ‘CL_WD_KDF’.

*

*INSERT INTO zwdy_ui_elem_def VALUES wa_zwdye.

*

*wa_zwdye-definition_name = ‘KKF’.

*wa_zwdye-display_name = ‘Open Item Balance Audit Trail’.

*wa_zwdye-runtime_class   = ‘CL_WD_KKF’.

*

*INSERT INTO zwdy_ui_elem_def VALUES wa_zwdye.

*

*wa_zwdye-definition_name = ‘KLF’.

*wa_zwdye-display_name = ‘Historitcal Balance Audit Trail’.

*wa_zwdye-runtime_class   = ‘CL_WD_KLF’.

*

*INSERT INTO zwdy_ui_elem_def VALUES wa_zwdye.

*

*wa_zwdye-definition_name = ‘KMV’.

*wa_zwdye-display_name = ‘Condition Record Selection’.

*wa_zwdye-runtime_class   = ‘CL_WD_KMV’.

*

*INSERT INTO zwdy_ui_elem_def VALUES wa_zwdye.

*

*COMMIT WORK.

******************************************************

  • Step 2:

******************************************************

*wa_zwdyl-library_name = ‘LgclDBS’.

*wa_zwdyl-display_name = ‘Logical DataBases’.

*wa_zwdyl-library_class = ‘CL_WDL_LDB’.

*

*INSERT INTO zwdy_ui_library VALUES wa_zwdyl.

*

*wa_zwdyl-library_name = ‘RptSts’.

*wa_zwdyl-display_name = ‘Report Sets’.

*wa_zwdyl-library_class = ‘CL_WDL_RPT’.

*

*INSERT INTO zwdy_ui_library VALUES wa_zwdyl.

*

*wa_zwdyl-library_name = ‘PrgTrs’.

*wa_zwdyl-display_name = ‘Programming Trees’.

*wa_zwdyl-library_class = ‘CL_WDL_PRG’.

*

*INSERT INTO zwdy_ui_library VALUES wa_zwdyl.

*

*COMMIT WORK.

******************************************************

  • Step 1:

******************************************************

*SELECT *

  • FROM wdy_ui_library

  • INTO TABLE i_zwdyl.

*

*LOOP AT i_zwdyl INTO wa_zwdyl.

*

  • INSERT INTO zwdy_ui_library VALUES wa_zwdyl.

*

*ENDLOOP.

*

*SELECT *

  • FROM wdy_ui_elem_def

  • INTO TABLE i_zwdye.

*

*LOOP AT i_zwdye INTO wa_zwdye.

*

  • INSERT INTO zwdy_ui_elem_def VALUES wa_zwdye.

*

*ENDLOOP.

*

*COMMIT WORK.

To report this post you need to login first.

2 Comments

You must be Logged on to comment or reply to a post.

  1. David Halitsky

    At the end of the post above, the question at hand was why the three new libraries and their member elements were not displaying in the left-hand side tray view of the clone component

    (0) 
  2. David Halitsky
    It turns out that there was no need to clone cl_wdr_view_element to get the custom trays to load in the tray-view on the right hand side.  This class handles the dynamic generation of the tray view itself, not the elements inside the trays (e.g. “Button”, “Table”, etc.)

    The problem was simply that when I defined the  library_names for the three new custom libraries, I used lower case letters in these names: e.g. “RptSts”, “LgclDBS”, and “PrgTrs”.

    Once these were changed to upper-case, the three libraries and their member elements displayed completely correctly.  These names are used to construct tray_ids, and these tray_ids are checked for lower-case in the constructor of cl_wdr_view_element (which is called from the constructor of cl_wdr_scroll_container which is called from the constructor of cl_wd_tray which is called from the method new_tray of cl_wd_tray which is called from the method init_view2 of (z)cl_wdr_test_ui_elements.

    So, we’re now at the point where the real error occurs due to insufficient class metadata.  If we click on any link in any of our new custom trays, we get a “class could not be found” error for an obvious reason: although we entered “dummy” runtime_class names for each of our custom entries in zwdy_ui_elem_def, we never defined these classes. much less activated them.  And in order for the right-hand side tree-view to function properly, actual active runtime classes such as “CL_WD_BUTTON” are required.  (These are also required for the detail view, of course.)

    So we can now define the methods and attributes of our custom classes and we’ll see what’s what tomorrow.

    (0) 

Leave a Reply