“Raffiniert is der Herrgott, aber Bösehaft ist er nicht” (DynamicRoadMaps: Part 7)
In Part 6 of this tutorial: “Complex-looking” code is sometimes the “simplest” (Dynamic RoadMaps:Part 6) When in doubt, de-multiplex! (Part 5 of Dynamic RoadMap Tutorial) Class-Data May be Cheating, but Who Cares? (Part 4 of Dynamic Road Map Tutorial) SAP UI Element Metadata: Gold or Fool’s Gold? (Part 3 of Dynamic RoadMap Tutorial) But how does the thermos bottle know? (Part 2 of Dynamic Road Map Tutorial) Exposing Critical SAP Code Paths as WebDynpro(ABAP) RoadMaps: One Case Where Dynamic UI Element Generation Might Be the Right Way to Go we found that we could remove quite a bit of irrelevant code from the create_aggregations_roadmap method of our local copy ZCL_WDR_ALL_IN_ONE_UIELEM, i.e. code that is not needed when building a RoadMap dynamically. This is not not the case with the create_aggregatee method called by create_aggregations: there is very little code in this method which does not apply to dynamic RoadMap creation. On the other hand, there is code in this method which builds the right-hand RoadMap navigation tree – the one we eventually want to replace with our own navigation tree (see Exposing Critical SAP Code Paths as WebDynpro(ABAP) RoadMaps: One Case Where Dynamic UI Element Generation Might Be the Right Way to Go of this tutorial). And therefore, it will be necessary to make a copy of create_aggregatee that we’ll call create_aggregatee_roadmap. To make this copy and revise it appropriately, all we have to do is: 1) declare our new method create_aggregatee_roadmap in the protected section of our local copy ZCL_WDR_ALL_IN_ONE_UIELEM: 2) copy the code from create_aggregatee into our new method; 3) change create_aggregations_roadmap so that it calls our new method instead of create_aggregatee: 4) remove this code from our new method create_aggregatee_roadmap (because it applies only to “LAYOUT’s”): 5) comment out this code (because we’re going to build our own righthand-side navigation tree later on): And once having done (1-5), we’re ready to start tweaking the various methods of our local copy ZCL_WDR_ALL_IN_ONE_UIELEM so that our component ZWDR_TEST_UI_ELEMENTS will display exactly the RoadMaps we want. In particular: 6) we want to make the “02 or 03” leg of “create_aggregations_roadmap” just call create_aggregatee_roadmap once: 7) we want to display less road-map steps, so we comment-out/remove the do loop from create_data_node: 8) we want to make sure we understand how to title the steps of our RoadMap, so to verify our understanding, we modify the get_default_value method like this: At this point, the display looks like this: And therefore, we “know that we know” how to make it look like whatever we want it to look like.