web dynpro abap _ scn3

32
Getting Started Newsletters Store Products Services & Support About SCN Downloads Industries Training & Education Partnership Developer Center Lines of Business University Alliances Events & Webinars Innovation Login Register Welcome, Guest Search the Community Activity Communications Actions Brow se Web Dynpro ABAP 116 Posts 1 2 3 4 5 8 This post is part of a series on code snippets. The complete list of posts in the series is available in the document Code Snippets: A Blog Series. Two steps are needed to pass parameters into a Web Dynpro ABAP application from the SAPgui. First, the SAPgui must construct the URL of the Web Dynpro application and open the URL in a web browser. This step may be done in any ABAP routine. Second, the Web Dynpro application must read the parameters from its URL query string. This is accomplished in one of two ways. Dynamic parameters must be handled by programmatically reading the parameter name/value pairs from the URL query string in the HANDLEDEFAULT event handler method of the Web Dynpro application's interface view, i.e., its window. Internal table LT_PARAMETERS may now be read and the parameter name/value pairs processed as needed by the application. Static parameters may also be handled in this way or may be defined at design time as importing Code Snippet Series: Passing Parameters to Web Dynpro from SAPgui Posted by Amy King Aug 28, 2013 01. DATA lv_absolute_url TYPE string. 02. DATA lv_url TYPE char255. 03. DATA ls_parameter TYPE ihttpnvp. 04. DATA lt_parameters TYPE tihttpnvp. 05. 06. * Assemble the parameter name/value pairs as needed 07. ls_parameter-name = 'param1_name'. 08. ls_parameter-value = 'param1_value'. 09. APPEND ls_parameter TO lt_parameters. 10. 11. ls_parameter-name = 'param2_name'. 12. ls_parameter-value = 'param2_value'. 13. APPEND ls_parameter TO lt_parameters. 14. 15. * Construct the URL with parameters 16. cl_wd_utilities=>construct_wd_url( 17. EXPORTING 18. application_name = 'WEB_DYNPRO_APPLICATION_NAME' 19. in_parameters = lt_parameters 20. IMPORTING 21. out_absolute_ur l = lv_absolute_url 22. ). 23. 24. lv_url = lv_absolute_url. " cast data type 25. 26. CALL FUNCTION 'CALL_BROWSER' 27. EXPORTING 28. url = lv_url 29. window_name = 'Example: Passing Parameters' 30. new_window = abap_true 31. EXCEPTIONS 32. OTHERS = 0. 01. DATA lt_parameters TYPE tihttpnvp. 02. 03. * Read URL parameters from the query string 04. wdevent->get_data( 05. EXPORTING 06. name = if_wd_application=>all_url_parameters 07. IMPORTING 08. value = lt_parameters 09. ).

Upload: raky0369

Post on 28-Dec-2015

296 views

Category:

Documents


21 download

DESCRIPTION

web dynpro abap

TRANSCRIPT

Page 1: Web Dynpro Abap _ Scn3

Getting Started Newsletters Store

Products Services & Support About SCN Downloads

Industries Training & Education Partnership Developer Center

Lines of Business University Alliances Events & Webinars Innovation

Login RegisterWelcome, Guest Search the Community

Activity Communications Actions

Brow se

Web Dynpro ABAP 116 Posts 1 2 3 4 5 … 8

PreviousNext

This post is part of a series on code snippets. The complete list of posts in the series is availab le in the document

Code Snippets: A Blog Series.

Two steps are needed to pass parameters into a Web Dynpro ABAP application from the SAPgui. First, the SAPgui

must construct the URL of the Web Dynpro application and open the URL in a web browser. This step may be done in

any ABAP routine.

Second, the Web Dynpro application must read the parameters from its URL query string. This is accomplished in

one of two ways. Dynamic parameters must be handled by programmatically reading the parameter name/value pairs

from the URL query string in the HANDLEDEFAULT event handler method of the Web Dynpro application's interface

view, i.e., its window.

Internal table LT_PARAMETERS may now be read and the parameter name/value pairs processed as needed by the

application. Static parameters may also be handled in this way or may be defined at design time as importing

Code Snippet Series: Passing Parameters to WebDynpro from SAPgui

Posted by Amy King Aug 28, 2013

01. DATA lv_absolute_url TYPE string.

02. DATA lv_url TYPE char255.

03. DATA ls_parameter TYPE ihttpnvp.

04. DATA lt_parameters TYPE tihttpnvp.

05.

06. * Assemble the parameter name/value pairs as needed

07. ls_parameter-name = 'param1_name'.

08. ls_parameter-value = 'param1_value'.

09. APPEND ls_parameter TO lt_parameters.

10.

11. ls_parameter-name = 'param2_name'.

12. ls_parameter-value = 'param2_value'.

13. APPEND ls_parameter TO lt_parameters.

14.

15. * Construct the URL with parameters

16. cl_wd_utilities=>construct_wd_url(

17. EXPORTING

18. application_name = 'WEB_DYNPRO_APPLICATION_NAME'

19. in_parameters = lt_parameters

20. IMPORTING

21. out_absolute_ur l = lv_absolute_url

22. ).

23.

24. lv_url = lv_absolute_url. " cast data type

25.

26. CALL FUNCTION 'CALL_BROWSER'

27. EXPORTING

28. url = lv_url

29. window_name = 'Example: Passing Parameters'

30. new_window = abap_true

31. EXCEPTIONS

32. OTHERS = 0.

01. DATA lt_parameters TYPE tihttpnvp.

02.

03. * Read URL parameters from the query string

04. wdevent->get_data(

05. EXPORTING

06. name = if_wd_application=>all_url_parameters

07. IMPORTING

08. value = lt_parameters

09. ).

Page 2: Web Dynpro Abap _ Scn3

parameters in the HANDLEDEFAULT method signature.

1024 View s 6 Comments

Tags: w da, w eb_dynpro, w ebdynpro, query_string, url, parameter, w eb_dynpro_abap, parameters, w ebdynpro_abap,

w ebdynproabap, url_parameters, w ebdynpro_for_abap, abap_w d, query_url, querystring

This post is part of a series on code snippets. The complete list of posts in the series is availab le in the document

Code Snippets: A Blog Series.

In a view's layout, individual MenuItems may be added as child elements to a Menu, ButtonChoice or LinkChoice

parent element, but what if the list of menu options is not known at design time? An example is needing to present

the user with a ButtonChoice that lists employees who report directly to the user. This list will be different for each

user and must be read from a database table, so these menu options cannot be created at design time.

The Menu, ButtonChoice or LinkChoice element may be created in the view's layout at design time and its child

elements created dynamically at runtime, for example in the view's WDDOINIT hook method. The example below

creates MenuActionItems for a ButtonChoice. The same approach may be used to dynamically create menu items for

a Menu or LinkChoice UI element.

695 View s 0 Comments

Tags: w da, menu, w eb_dynpro, w ebdynpro, dynamic, w eb_dynpro_abap, w ebdynpro_abap, w ebdynproabap,

w ebdynpro_for_abap, abap_w d, code_snippet, code_snippet_series, buttonchoice, button_choice, linkchoice, link_choice

Code Snippet Series: Creating Menu ItemsDynamically

Posted by Amy King Aug 21, 2013

01. DATA lo_view TYPE REF TO if_wd_view.

02. DATA lo_buttonchoice TYPE REF TO cl_wd_button_choice.

03. DATA lo_menuactionitem TYPE REF TO cl_wd_menu_action_item.

04.

05. * Get a reference to the ButtonChoice view object

06. lo_view ?= wd_this->wd_get_api( ).

07. lo_buttonchoice ?= lo_view->get_element( 'BUTTONCHOICE_ID' ).

08.

09. * Add a MenuActionItem to the ButtonChoice for each record in the source data table

10. LOOP AT lt_data ASSIGNING <data>.

11.

12. CALL METHOD cl_wd_menu_action_item=>new_menu_action_item

13. EXPORTING

14. id = <data>-id

15. on_action = 'VIEW_ACTION' " action to be executed upon selection of the menu item

16. text = <data>-text

17. RECEIVING

18. control = lo_menuactionitem.

19.

20. CALL METHOD lo_buttonchoice->add_choice

21. EXPORTING

22. the_choice = lo_menuactionitem.

23.

24. ENDLOOP. " <data>

This post is part of a series on code snippets. The complete list of posts in the series is availab le in the document

Code Snippets: A Blog Series.

Knowing the environment in which a Web Dynpro ABAP application is running is necessary if you want to branch logic

or show or hide content depending on the client environment. An example is showing the user's logon name in a

header or a copyright notice in a footer when the application is running standalone but hiding these view elements

when the application is running in the NetWeaver portal.

Code Snippet Series: Determining the ClientEnvironment

Posted by Amy King Aug 20, 2013

01. DATA lo_wd_component TYPE REF TO if_wd_component.

02. DATA lo_wd_application TYPE REF TO if_wd_application.

03. DATA lv_client_environment TYPE i.

04.

Page 3: Web Dynpro Abap _ Scn3

If you are on a version of NetWeaver that supports chaining method calls (NW 7.0 EhP 2 or higher), you may skip

declaration of the object references.

390 View s 0 Comments

Tags: w eb_dynpro, environment, w ebdynpro, w eb_dynpro_abap, w ebdynpro_abap, client, w ebdynproabap,

w ebdynpro_for_abap, abap_w d, client_environment, code_snippet, code_snippet_series

05. lo_wd_component ?= wd_this->wd_get_api( ).

06. lo_wd_application = lo_wd_component->get_application( ).

07. lv_client_environment = lo_wd_application->get_client_environment( ).

08. CASE lv_client_environment.

09.

10. WHEN if_wd_application=>co_client_environment-nwbc.

11. * NetWeaver Business Client

12.

13. WHEN if_wd_application=>co_client_environment-portal.

14. * NetWeaver Portal

15.

16. WHEN if_wd_application=>co_client_environment-sapgui.

17. * SAPgui

18.

19. WHEN if_wd_application=>co_client_environment-standalone.

20. * Standalone

21.

22. WHEN if_wd_application=>co_client_environment-unknown.

23. * Unknown client environment

24.

25. ENDCASE.

01. CASE wd_this->wd_get_api( )->get_application( )->get_client_environment( ).

02. ...

03. ENDCASE.

If you want to debug into what is happening in the ABAP application server when you access an HTTP URL on it with

your browser, there are several places to set an external breakpoint which will bring up the ABAP debugger for this

web request.

Function module HTTP_DISPATCH_REQUEST line 982 seems to be the first point from where a breakpoint will bring

you into the debugger.

At this point, the http handler list is already populated. This is done by call function module

HTTP_GET_HANDLER_LIST from line 606 and gives you all the handlers into question for the URL.

Debugging into a HTTP request on AS ABAP

Posted by Christian Buckowitz Aug 11, 2013

Page 4: Web Dynpro Abap _ Scn3

For this example, there exist 2 handlers for /sab/bc/ui5_ui5.

If you look at the nested handlertbl, you can see the handler implementation classes and the order in which they will

be executed to handle the http request.

The next point of interest is where the actual call of the http handler is done. This is in class method

CL_HTTP_SERVER=>EXECUTE_REQUEST line 627.

A bit up in the code, an object instance was created from the http handler class and now the interface method

if_http_extension->handle_request is called. From here it is up to the http handler object to proceed with the

processing. This may be completely different from one handler to the next, and you can of course implement and

register your own http handler class as well.

Note that the handle_request method has to set the flow_rc attribute of the if_http_extension interface with a value that

determines if more handlers will be executed or not (if there are multiple handlers registered).

As an alternative, you can figure out the handler class for your URL from the transaction SICF and just set a

breakpoint in its implementation of method if_http_extension->handle_request or some other place of interest.

This is coding for the SAP_BASIS 7.31 SP 7, it may be different on other SPs or releases.

406 View s 0 Comments Tags: w eb_dynpro

How to find the implementation of an ICF service

Posted by Christian Buckowitz Aug 10, 2013

Page 5: Web Dynpro Abap _ Scn3

It is not trivial to find the coding, that hides behind an HTTP URL for the AS ABAP.

URLs on the AS ABAP need to be published and activated first of all in the service maintenance transaction SICF.

Given the URL, you can browse the SICF to the service maintenance screen, lets take for example the implementation

of the odata demo service /sap/opu/odata/iwfnd/rmtsampleflight.

The URL request to the AS is handled by program SAPMHTTP, which does a lot of the stuff around handling a HTTP

request and in the end uses function module HTTP_GET_HANDLER_LIST to get a list of handler classes for all the

nodes in the path to the requested service (You can use the FM to get the handler list for a given path, but the output is

rather ugly). By looking into the handler list property of the service and its parent nodes in the tree you can find all

handler classes, that potentially might apply for this service.

In this example, there is no handler present for the service rmtsampleflight itself, but in its parent node

/sap/opu/odata, there is the handler class /IWFND/CL_SODATA_HTTP_HANDLER registered. In this case, this is the

only class in all the nodes of the tree to our sample service and thus the only handler class that could possibly be

executed. Nevertheless, there could be multiple classes e.g. several nodes in the path have a handler class, or even

multiple handler classes are registered in a single node. The execution order of the handler classes seems to be in

the following order: from the higher up nodes to the lower nodes in the path, in the numbered order of the handler list

within a node (if there are more than one handlers per node). If there are more than one handler, then they will be

executed one by one in the order just described, but every handler can control if the remaining handlers will be

executed by the value the handler returns in the attribute flow_rc of the interface IF_HTTP_EXTENSION. You can jump

to the implementation classes of the handlers by simply double click on the classname in the handler list.

So now that you know the handler class, how to proceed with the reverse lookup of the sicf service from here?

The good news is that for each request, the interface IF_HTTP_EXTENSION object method HANDLE_REQUEST is

Page 6: Web Dynpro Abap _ Scn3

called for an instance of the handler class. This gives you an uniform entry point, from were you can go forward and

dive into the coding. You can set breakpoints, that are triggered when you perform the HTTP request and nicely debug

all the workings on the server.

The bad news is that there is no common implementation of what is happening at this point. Each handler class

does things in its own way, so you are on your own from there on. By the way you also can write your own handler

class, SAP provides some documentation about how to do that in the SAP help, just google for "sap Developing a

HTTP Request Handler " and pick a more recent sap help site.

For the rmtsampleflight example this means that by debugging you can find out that the odata service is implemented

by a complex framework: the Netweaver Gateway in package /IWFND/FRAMEWORK. With some patience you can find

the tables where the metadata information about the odata services are stored and from those tables find which

reports and thus transactions access them. But more efficient is in fact to look up Netweaver Gateway maintenance

and find the transactions from SCN or the documentation. In this case transaction /IWFND/MAINT_SERVICE to

manage and register odata services.

245 View s 0 Comments Tags: w eb_dynpro

IntroductionThis is part 2 of my experiences with writing test scripts for WDA with Selenium (IDE). The first two parts are here:

Test Scripts for WDA with Selenium - Part 1: Reasoning, Background

Test Scripts for WDA with Selenium - Part 2: Writing The First Two Scripts.

A general request: Everything here is my current experience. I am learning as I go. So if you have alternative or better

solutions for some of the things, please do not hesitate to comment. I hope to improve the blog as time goes by.

Third Script - Do The First ClicksMy first two scripts were rather boring because they hardly did anything. They mainly checked for UI elements. This

will change now.

I had to experience that due to the lack of stable IDs, finding and clicking the right element can be really tricky. I had to

experiment a lot. Two sources helped me tremendously:

1. The XPath reference.

2. The XPath Checker add-on for Firefox.

Without those, I would not have come this far. Reminder: I am new to XPath. But let's start.

I call our so-called "Content Selection", which is a "classic" WDA page, meaning no Floorplan Manager. It looks like

this:

These 4 commands call the page from the navigation menu that I showed in part 2:

pause 1000

waitForElementPresent //a[text()='New']

click //a[text()='New']

waitForElementPresent //span[contains(text()[2],'Management Journal')]

The fourth command is special. What I wanted to do was to wait until the page was loaded. To do that, I wanted to

wait for the first menu option, "Management Journal", to appear. That turned out to be difficult because the HTML looks

a bit weird. To be honest, that is probably driven by the way we developed that WDA page... Here is the HTML:

So the text starts with two blanks - but they have an image in between. First I could not find the XPath to identify the

Test Scripts for WDA with Selenium - Part 3: MoreAdvance Stuff With XPath

Posted by Christian Geyer Aug 9, 2013

01. <span class="urCLbl urCl1" unselectable="on" f="WD9A" ti="0" tabindex="0" id="WD9A-lbl">

02. <img align="absmiddle" style="-moz-user-select:none;" class="urRImgOn" src="/sap/public/bc/ur/nw5/1x1.gif"

03. Management Journal

04. </span>

Page 7: Web Dynpro Abap _ Scn3

<span> that had the text "Management Journal". You find some discussions about XPath and blanks (e.g. here) but

none helped.

Then I tried using a sub-string like this: //span[contains(text(),'Management Journal')] That XPath basically means:

return the <span> that has inline text containing "Management Journal". It did not work.

Finally, XPath Checker showed me the problem: Because of the <img> in the middle, the <span> has an array of two

texts: The first with " " and the second with " Management Journal". So I had to use the second entry in that entry.

Fortunately, XPath can do that with the syntax you see above.

That was when I became a friend of XPath...

With that little trick, my script could do the next few clicks:

click //span[contains(text()[2],'Management Journal')]

waitForElementPresent //span[contains(text()[2],'FC')]

pause 1000

click //span[contains(text()[2],'FC')]

And so on... You see the waits for AJAX and the additional pauses. As mentioned, I have not found out how to avoid

the pauses.

The next commands checked for UI elements etc. Nothing you have not seen in part 2.

It Gets Better...Again, I got stuck soon after. Look at the third column in the screen above. There are several checkboxes. The

problem with those was that their texts were not unique. So far, I identified all elements with their unique inline texts.

That was no longer possible.

So I tried to find an XPath that said: "Look for a <span> with text 'P&L PAC' and return the first <span> containing

'Expense' in its text that comes after". And XPath can do that. The syntax is: //span[text()='P&L

PAC']/following::span[contains(text()[2],'Expense')][1]. So there was my next command:

click //span[text()='P&L PAC']/following::span[contains(text()[2],'Expense')][1]

After that, I felt lucky. I wanted to try to check if the checkboxes for "Title Page" and "Glossary" in the last column were

set. For that you have to know that WDA renders the checkboxes as images with different CSS classes: 'urCImgOn' if

selected and 'urCImgOff' if not.

So I went for an XPath that looked for the <span> with text "Title Page" and returned the first <img> before it, if it is of

class 'urCImgOn'. Also that works. It looks like this:

verifyElementPresent //span[text()='Title Page']/preceding::img[1][@class='urCImgOn']

SummaryThe rest of my scripts so far use the same concepts described here and in part 2. After seeing how powerful XPath

can be, I feel that I should be able to script meaningful tests, even without having fixed IDs.

As mentioned, I keep going. If I learn more noteworthy XPath variants, I will add them here. Again, if you see anything

that can be done better or easier, please let me know in the comments.

407 View s 0 Comments Tags: w eb_dynpro, w eb_dynpro_abap, test_script, selenium, automatic_tests

What is Configuration, Customizing, Personalization?Web Dynpro ABAP allows developers, administrators or end users to change parts of the screens.

ConfigurationDevelopers, especially at SAP, would create Configuration data. These are development objects with version

management, where-used-list and SNOTE connection. Configuration objects would mostly hold explicit data (see

below). The configuration is applied for all users in the system.

Customizing

At customer site data can be changed using Customizing. Customizing is not a development object. In most cases

Customizing contains changes to the configuration or implicit data (see below). Customizing is client dependent. We

assume that customizing is done in a development system and transported to the productive system.

PersonalizationIf not prohibited the end user can personalize the application. These are some changes, which are only used for the

** TEAM WDA **:Configuration, Customizing,Personalization FAQ

Posted by Regina Breuer Aug 9, 2013

Page 8: Web Dynpro Abap _ Scn3

user himself. The functionality is very limited. Personalization is normally not transported, therefore changed in the

productive system itself.

All these adaptations are merged together and applied to the application.

What is the relationship between ApplicationConfiguration and Component Configuration?

Application ConfigurationAn application configuration belongs to the application, a component configuration to the component. That was

simple. But how do they belong together?

You can create an application configuration for the application. To call the application with this configuration, just add

the URL parameter "sap-wd-configid=<appl_config_name>" to the application URL (or call the application

configuration directly from SE80, where you see it as a subobject of the application).

The application configuration consists of some parameters and a hierarchy of the components. Within this hierarchy

you can set the component configuration ids. (If the application structure is static, you see the whole component

structure, if it is dynamic, like FPM, you see only the topmost components).

Component Configuration

These component configuration ids will then be used to load the component configuration, customizing and

personalization.

This means: The URL parameter defines the application configuration, and within this the component configuration id

is chosen. The component configurations (and/or customizings and/or personalizations) contain the screen changes.

If you have not defined an application configuration or if you have not set a component configuration id within it, the

component configuration ids are generated from the application name and the component hierarchy.

What is Implicit resp. Built-In Adaptation? What isExplicit resp. Component Defined Adaptation?Some change features are provided for any Web Dynpro Application, like hiding a UI element, reorder the

columns of a table (not all tables, but most of them), etc. These adaptations are called implicit or built-in.

In some application this is not sufficient. Therefore the developer of the Web Dynpro component enhanced the

possibilities. This is explicit or component defined. E.g. the FPM components use explicit configuration

extensively.

What can I do with Built-In Customizing?With Implicit Customizing you can change data of a Web Dynpro application for all users. The available functionality

depends on the UI element type.

Start the application with URL parameter "sap-config-mode=X". Use the context menu on the UI element you want to

change and select "Settings for current configuration". If you do not see this meu entry, please check your autorization.

You can hide each UI element. You can change the labels, set the value of an input field, reorder the sequence of the

table columns, modify the number of visible rows in a table, set the width of some UI elements, and so on.

In some cases you can add decorative elements to containers (when the layout is matrix, grid, flow or form layout) .

When you have added some elements to a data structure, which is used within the context, you can add UI elements

displaying these fields to the screen.

How can I create / change the Configuration?To create an application configuration, go to SE80 and select the Web Dynpro application. Then open the context

menu and choose "create / change application configuration".

A Web Dynpro application is started, where you can enter the name of the application configuration. Please note that

the name must be globally unique. When you press "new" or "create" (depending on the release), you should enter

detailed information like package, transport request, etc.

On the main screen you can enter the necessary data and press SAVE.

Then the application configuration is visible as a subnode to the application in SE80 (press "refresh", if not yet

visible). Double click and then you can call the configuration editor from there.

To create a component configuration you can use a similar way as with the application configuration, or you can

navigate from the application configuration to it. If it does not yet exist, you have the chance to do it there. This is the

easiest way.

How can I change the Customizing?If you just want to do some implicit changes, call the application with URL parameter "sap-config-mode=X". If you

have the necessary authorization, you can do the changes using the context menu at the UI element you want to

change.

If you want to do changes, which are not available at runtime, you should start the customizing editor. This is nearly

Page 9: Web Dynpro Abap _ Scn3

the same as the configuration editor, but the object you are working on, is a different one. Start the confguration editor,

and change the name of the application in the URL from "configure_component" to "customize_component".

For FPM components: Start the application in customizing mode (see above). Then you see some icons in the top

right corner, which you can use to start the customizing editor.

How can I change the Personalization?Personalization are changed just at runtime. If allowed, use the context menu set the visibility of a UI element or set

the default value of an input field. Changing the order of table columns is just done via drag and drop.

Which authorization is needed?For Personalization there is no authorization needed.

For Customizing authorization object S_WDR_P13N or development authorization is used.

Configuration is only allowed for users with S_DEVELOP authorization.

How can I prohibit Personalization?You can disallow personalization in general, prohibit only hiding of fields, or exclude changing specific properties.

To disallow personalization in general, set the application parameter WDDISABLEUSERPERSONALIZATION to true.

This can be done per client (with application WD_GLOBAL_PARAMETERS) or for specific WD applications on the

Parameters tab of the application.

If you want to allow personalization excluding hiding UI elements, the application parameter

WDENABLEUIELEMENTSHIDE can be used. This is set to true be default, but it can be set to false. This functionality

is available from 7.31.

When there are only some selected properties you want to remove from the personalization list, you can set it to "final"

on configuration or customizing level. This is true for explicit and implicit personalization.

Which texts are translatable?Some configuration texts and customizing texts are translatable.

For implicit adaptations those texts are translatable, which are also translatable in Web Dynpro ABAP itself.

For explicit adaptations this is a little bit more difficult, because it depends on the declaration within the configuration

context of the component.

How can I translate the texts?Translation is done using the standard translation transaction SE63.

Configuration texts are identified with logical transport object WDCC and the key (use a '*' behind the configuration id).

Customizing texts are found through the table WDY_CONF_USERT2 and the key.

For detailed description please refer to the FPM blog http://scn.sap.com/community/web-dynpro-abap/floorplan-

manager/blog/2012/10/04/team-fpm--all-about-translation-and-texts-of-fpm-applications

Why am I asked for Access Keys?From 7.31 on you will be asked for an object access key, if you want to create or change a configuration in the SAP

namespace. You also need a developer access key.

This is implemented to remind you of the difference between configuration and customizing. When you change

customizing data, no access key is needed.

What about FPM?FPM (Floor Plan Manager) is a development framework built on top of Web Dynpro ABAP. The first version are

available with release 7.01, but with 7.02 and especially 7.31 the functionality is extended.

With FPM the applciations consist mainly of feeder classes to access the business logic and WDA configurations to

define the UI.

For more information about FPM please change to the FPM community.

How can I get an overview of the Configurations,Customizings, Personalizations?Application configurations

You can find application configurations in the Workbench (SE80). They are subnodes of the application, or you

can find them in the package, or search in the Repository Information System.

In se80 you can also use the Where-Used-List of component configurations to get all application configurations

which contain them. (release 7.02 and higher)

You can use WD application WD_ANALYZE_CONFIG_APPL to search and display application configurations.

Page 10: Web Dynpro Abap _ Scn3

Component configurations

Like application configurations you can find them in the Workbench in your package or as a subnode of the

component (in most cases). With release 7.31 and higher, you will not only see the organizational data, but also

the contents of the configuration.

Where-Used-List is also available for component configurations. (release 7.02 and higher).

You can use WD application WD_ANALYZE_CONFIG_COMP to search and display component configurations.

Component customizings and personalization

Customizings and personalization can be found and displayed with WD application

WD_ANALYZE_CONFIG_USER. To find only customizing data, enter a '*' as user name, then press the icon in

front of this input field and select "[=] single entry".

How can I delete Configurations, Customizings,Personalizations?

ConfigurationsYou can delete configurations in the workbench, in the configuration editor or with wd application

WD_ANALYZE_CONFIG_COMP / WD_ANALYZE_CONFIG_APPL.

CustomizingsCustomizings can be deleted by the administrator with the customizing editor or with WD_ANALYZE_CONFIG_USER.

PersonalizationThe user can reset the personalization data within the application using the context menu "user settings"->"more"-

>"reset user settings for Running application".

The administrator can delete the personalization objects using WD_ANALYZE_CONFIG_USER.

How can I analyze, where the values come from?If you have release 7.31 SP07 or newer, you can use the Runtime Analysis Tool, otherwise you could use the

WD_ANALYZE_* applications.

Please see the separate blog about analyzing web dynpro abap adaptations by Michel Seifner

http://scn.sap.com/community/web-dynpro-abap/blog/2013/08/08/team-wda--analyzing-web-dynpro-abap-

adaptations

What are Configuration Enhancements and how can Iuse them?Configuration objects can be enhanced using the enhancement framework.

There are 2 different implementations depending on teh release.

Release 7.01 and 7.02In these releases configuration enhancements are configurations with an additional redirection entry. We call then

"delegation enhancements". If there is configuration C1 and you create a configuration C2 as an enhancement for it,

then you will get C2 whenever you call C1. You can create those enhancement in the configuration editor with function

"Enhance". Then a copy of C1 is created and a redirection entry is added.

In newer releases you cannot create such enhancements anymore, but you can change or delete them.

These enhancements are available for application and component configurations.

Release 7.31 and higherIn release 7.31 we have implemented "real" enhancements for component configurations (Application enhancements

are still the delegation enhancements). These are objects of type ENHO. You create them on the main page of the

configuration editor in display mode as with any other enhancement in SE80. These enhancements are only deltas to

the original configurations. This way it is possible to have more than one enhancement for one configuration.

When you are in the editor in display mode of a configuration with enhancements, you see the end result

(configuration + enhancements). When you go to edit mode, you only see the configuration itself. When changing an

enhancement you see the configuration plus enhancement.

You can see the enhancement in SE80 in the package. In release 7.40 you see them also as subobjects of the

configuration.

You can also see the enhancements in WD_ANALYZE_CONFIG_COMP when you open the popin of the table row

showing your configuration.

Which changes should be done with which technique?When you create your own application and need configuration, you should use the configuration object. This is

especially true for FPM applications,

When you want to modify a configuration delivered by SAP, it depends on the kind of changes whether you better

use enhancements or customizing. Enhancement are better for larger changes, because you have features like

version management, and you can add customiing on top.

For minor layout changes customizing is the right way to do it.

Page 11: Web Dynpro Abap _ Scn3

Can I use Personas to change Web Dynpro Screens?Currently SAP GUI Personas is only available for SAPGUI Screens

.

3137 View s 0 Comments

Tags: w eb_dynpro, w ebdynpro, configuration, customizing, w d4a, w eb_dynpro_abap, w ebdynpro_abap, adaptation,

personalization

IntroductionThis is part 2 of my experiences with writing test scripts for WDA with Selenium (IDE). The first part is here: Test

Scripts for WDA with Selenium - Part 1: Reasoning, Background.

A general request: Everything here is my current experience. I am learning as I go. So if you have alternative or better

solutions for some of the things, please do not hesitate to comment. I hope to improve the blog as time goes by.

The ApplicationOur application is based on NetWeaver 7.30. It consists of parts using "classic" WDA and also Floorplan Manager

for Web Dynpro ABAP. We are not yet complete on Floorplan Manager, that is work in progress. If you are curious

about the application itself, see here: SAP's internal solution for Forecast Reporting.

The First Script - Load Page and Test if we ArrivedAs mentioned is part 1, everything I did so far uses the Selenium IDE. That was the fastest way to get started. To

simplify the layout of this blog, I will paste the Selenium commands and parameters as text tables.

So, first step is loading the page - that's trivial.

open /sap/bc/webdynpro/sap/<pageID>?sap-language=EN

Now we wait until everything is loaded. Already at this point, AJAX strikes. Most of the page content is loaded

asynchronously with JavaScript. That's of course nothing special; Selenium has the "waitFor..." commands for that.

See here for details.

In my script, I want to wait until the "Navigation" block is present on the page.

Normally, that is not a big deal. This is the HTML code for the "Navigation" text:

In any normal web application, you would use the ID "WD2D-titletext" to identify the <span> and the use the

waitForElementPresent of waitForText in Selenium to wait until it appears on the screen. In normal language, that

means that you wait until that <span> with that text "Navigation" appears. It is the safest check.

The problem is: The IDs in WDA are generated and not stable, so I cannot use them and expect the script to run later

on. So I cannot do a test for one specific page element with a unique ID. Therefore, I was looking for the next best

thing. My approach was to wait for a <span> with the correct text. Using XPath, that is easily possible in Selenium:

waitForElementPresent //span[text()='Navigation']

That halts the script until the page has a <span> element with the inner text "Navigation". On top of that, you could

script additional checks, like if it really the only <span> with that text, what its position is etc. But at that point, that was

enough for me.

When executing that script a couple of times, I saw that even this did not guarantee that everything was loaded.

Further actions sometimes failed. I suspect that there are still JavaScripts being loaded in the background. I could not

identify what exactly I must wait for to be sure that everything is loaded 100%. If anyone knows, please let me know!

So I added another short pause:

pause 1000

Not very elegant - but as mentioned, let me know if you know more.

That basically concludes the first script - I just check if the title is right:

Test Scripts for WDA with Selenium - Part 2: WritingThe First Two Scripts

Posted by Christian Geyer Aug 9, 2013

01. <span class=" lsHdArTitle" id="WD2D-titletext">Navigation</span>

Page 12: Web Dynpro Abap _ Scn3

assertTitle Page Title

Second Script - Everything There?The second script merely checks if all expected UI elements are there. I used the same technique with XPath as

above. Most is pretty basic.

We have a few tabs:

WDA implements them with <span>, too. For example:

So same thing as before.

waitForElementPresent //span[text()='Modules']

On the same page, we also have the general navigation of the Floorplan Manager:

WDA implements those with normal links, meaning <a>.

So the XPath is slightly different:

verifyElementPresent //a[text()='Report Catalogue']

As before, this simply checks if there is an <a> present on the screen with the inline text "Report Catalogue".

The next challenge was to check for the individual menu entries that hide behind those menus:

To make it short: I found no realiable way to script the opening of the menu and then a check on the items. So I used a

workaround: The script opens the "Map" view of the navigation:

click //span[text()='Map']

So now I could check all entries. WDA uses <a> tags again.

01. <span class="lsPnstLabelSel" ti="0" tabindex="0" id="WD0140-title">Modules</span>

01. <a href="javascript:void(0);" title="Report Configuration" ti="0" tabindex="0"

02. class="urLnkChoice urTxtStd urLnkChoiceMnuIco" id="WD021E" lsevents="{}" lsdata="{0:'Report\x20Configuration',1:'Report\x20Configuration',2:true,3:'WD0225',4:'',5:''}"

03. ct="LNC">

04. Report Configuration

05. </a>

Page 13: Web Dynpro Abap _ Scn3

verifyElementPresent //a[text()='New']

Next?Some advanced XPath madness follows in part 3...

Test Scripts for WDA with Selenium - Part 3: More Advance Stuff With XPath

476 View s 0 Comments Tags: w eb_dynpro, w eb_dynpro_abap, test_script, selenium, automatic_tests

About Selenium

Selenium is a free set of tools for testing web applications in the browser. Information, downloads and a good online

documentation is available at http://docs.seleniumhq.org/.

In short, it allows you to write scripts that will be executed within a browser. There is also a nice add-on for Firefox

called Selenium IDE, which enables you to record and edit scripts directly in the browser. You can then also execute

the scripts with the add-on.

Why This Blog Series?

I tried to use Selenium IDE for our WDA application and did everything in this blog with the Selenium IDE. Later on, I

will also try the "real thing" with the Selenium server (called Web Driver) but first I want to do further tests with the IDE. I

would also like to try the SeleniumABAP project by Gregor Wolf, see Automate Web Application Testing with

Selenium for ABAP.

I started from zero and wanted to share my learnings here. Using Selenium for "normal" web applications is of course

not new and you will find plenty of information about it with your favorite search engine. WDA, however, has some

specialties that make browser scripting tricky:

1. Almost everything is AJAX. The page is not reloaded when you click somewhere; instead, new page content is

loaded from the server with JavaScript. That, of course, is also not unusal in normal web applications. The

bigger problem is:

2. The ID attributes in the HTML code are not stable. That is quite unusual and makes scripting tricky. I will go into

more details in the next part. There are some

So this blog series is about the question: How do I write test scripts with Selenium for WDA?

Why Selenium At All?Good question ;-) The typical choice for WDA test automation is of course ECATT. Period. There are three reasons

why I started looking into Selenium at all:

1. The systems you work with may not have eCATT enabled. That is (at least for now) the case for us. Since we are

using agile development with short iterations and regular releases, however, we urgently need test automation.

So we started looking for options.

2. With a tool like Selenium, it seems easier to cover mixed scenarios, where not everything is Web Dynpro.

3. Selenium can be used as a client-side tool - so it seems generally easier to start with.

As always, it does not solve every problem - I see it as an additional tool in the box.

Update: August 21

Recently, a colleague of mine (thanks Reik!) pointed me to the URL parameter sap-wd-stableids=X. It is also

mentioned in blogs like Load Testing Web Dynpro ABAP Applications Using Apache JMeter. Apparently, I did not

look for such a parameter well enough before.

The parameter causes WDA to generate stable IDs in the HTML code. That makes much of what you see in part 2

and 3 a lot simpler! I can think of only three reasons why everything I wrote in those two parts may still be of interest:

1. The parameter may not work in all scenarios. For example, it does not work on our landing page. We are still

trying to find out why.

2. Not everything on the page gets an ID. So for some text validations, you may still need some advanced XPath

sytax.

3. When scripting navigation steps within your application, that parameter will not be passed on automatically.

Selenium does not simulate http requests, where you could manually add the parameter. I could think of ways to

handle it with Selenium, where I save parameters in the source screen and then call the target screen with a

new "open" command. But I simply have not played with that yet and cannot share any experience. So if you want

to script navigation, the parameter may not solve all problems with IDs.

Next?In part 2, I will start describing how I wrote our scripts in detail. Part 3 adds some advanced things. (At least advanced

Test Scripts for WDA with Selenium - Part 1:Reasoning, Background

Posted by Christian Geyer Aug 9, 2013

Page 14: Web Dynpro Abap _ Scn3

for me...)

Test Scripts for WDA with Selenium - Part 2: Writing The First Two Scripts

Test Scripts for WDA with Selenium - Part 3: More Advance Stuff With XPath

622 View s 0 Comments Tags: w eb_dynpro_abap, test_script, selenium, automatic_tests

Analyzing Web Dynpro Adaptations

Motivation

Adaptations are one of the most powerful concepts in Web Dynpro ABAP.

Having an SAP delivered Web Dynpro Component ready for use you are enabled to perform complex adjustments

concerning your business needs without coding a single line of code.

For details of the adaptation concept and how to use adaptations please follow read the blog by Regina Breuer

http://scn.sap.com/community/web-dynpro-abap/blog/2013/08/09/team-wda-configuration-customizing-

personalization-faq.

However - having such a highly adapted component in place may generate the demand to investigate why a certain

adaptation is working or is not working as expected.

Several tools are available supporting different entries to view the adaptation details.

Analyzing an adapted component

Before having a look at various tools first we need an adapted component to play around.

Build up an adapted component by customizing and personalization of the SAP delivered test application

wdr_test_pers_imp_exp.

If you want to work with an own configuration you can use the configuration editor to create it.

Configuration editor works quite similar to customizing editor. For details see customizing a Web Dynpro component

at design time.

Customizing a Web Dynpro ComponentCustomizing a Web Dynpro Component can be done in two different modes:

Runtime

Customizing is switched on in runtime mode when you run your application with the additional url-parameter

sap-config-mode=X.

Customizing at runtime shall be used for Build-In adaptations.

Design time

Design time customizing takes place in the customizing editor – application (customize_component).

Customizing at design time shall be used for Component-Defined adaptations.

Customizing a Web Dynpro Component at runtime

Start the application (wdr_test_pers_imp_exp) with url-parameter sap-config-mode=x.

Hide one plane icon. Click the right mouse button on this field and choose “Settings for current configuration” in

the context menu.

** Team WDA ** - Analyzing Web Dynpro ABAPAdaptations

Posted by Michel Seifner Aug 8, 2013

Page 15: Web Dynpro Abap _ Scn3

Set the image to invisible input. And press button “Save and Close”.

In the transport request popup box choose “No Transport Request”.

Press Settings and change the treshold settings. And press button “Save”.

In the transport request popup box choose “No Transport Request”.

Page 16: Web Dynpro Abap _ Scn3

Changes are applied instantly:

Personalization of a Web Dynpro Component at runtime

Start the application (wdr_test_pers_imp_exp).

Adjust the flight table. click the right mouse button and choose "More...".

Page 17: Web Dynpro Abap _ Scn3

Remove the Date column and press OK..

Changes are applied instantly and saved automatically:

Page 18: Web Dynpro Abap _ Scn3

Analyzing all Adaptations at runtime with Runtime Analysis Tool (RAT)

The runtime analysis tool (RAT) enables you at runtime to ascertain the levels in which adaptations have been made

to the user interface of a Web Dynpro ABAP application. It is available since NW 7.31 SP07 and NW 7.40 SP0.

Be sure you have developer permissions assigned to your user.

Activate the runtime analysis tool (RAT) in transaction WD_TRACE_TOOL:

Press Button “Activate for this user”.

Select WD Component Configuration

OK

Start the application.

Customized and personalized adaptations are active.

Analyze the adaptation by clicking right mouse button on any position of this screen and select “Technical Help”

from context menu.

Page 19: Web Dynpro Abap _ Scn3

Choose tab “Adaptations”

The following levels of adaptation may exist:

ENH – enhancement

CON – configuration

CUS – customizing

PRS – personalization

For each level of available adaptation you can select the entry in the adaptation list.

Selecting an adaptation level will show the details for Build-In and Component Defined adaptations up to this

level.

Comparing the changes it is easy to find out on which level which adaptation is applied.

In our case you see that the value of attribute "CONFIG_LOW" has been changed in customizing to value “30”.

Page 20: Web Dynpro Abap _ Scn3

The Built-In adaptations are also available for each level:

Keep in mind that showing up in the adaptation details doesn’t mean that this entity has been adapted at the

selected level.

It means that there is an adaption changing this entity on this level. The adaption may exist on a level below or

on the selected level.

The adaptations details always show the actual adaptation that influences the entity on the selected level. It will

Page 21: Web Dynpro Abap _ Scn3

not show the delta from the underlying level.

Analyzing Configurations with WD_ANALYZE_CONFIG_COMP

The WD_ANALYZE_CONFIG_COMP is a tool to analyze a certain configuration of a WebDynpro component in a static

way.

This tool is not available at runtime.

Deletion and transport of configurations is also possible.

Only configuration – no customizing is supported.

Since we did not change configuration, here only a short introduction to this tool:

In SE80 search for Web Dynpro application “WD_ANALYZE_CONFIG_COMP” and start it.

Enter your configuration to be analyzed.

From a list of available configurations you can select your desired configuration for inspection of adaptation

details.

It is also possible to delete or transport a configuration.

Selecting a configuration will show the details of Build-In and Component Defined adaptations.

Analyzing Customizing and Personalization with WD_ANALYZE_CONFIG_USER

The WD_ANALYZE_CONFIG_USER is a tool to analyze a certain customizing and personalization of a WebDynpro

component in a static way.

Deletion of personalization and customizing and transport of customizing is possible.

Start your application and call technical help via context menu.

Click on the Personalization ID to navigate directly to the WD_ANALYZE_CONFIG_USER - tool.

Navigation is not supported in older releases. Start the WD_ANALYZE_CONFIG_USER application and search

with your Personalization ID.

Page 22: Web Dynpro Abap _ Scn3

The list of Component Personalizations contains personalizations and customizings of the selected

configuration.

Entries with user „*“ and User Scope „A“ identify customizings whereas entries with a real username and User

Scope “U” are personalizations.

Selecting a personalization / customizing will show the details for Build-In and Component Defined adaptations.

Page 23: Web Dynpro Abap _ Scn3

718 View s 3 Comments

Tags: w da, w eb_dynpro, w ebdynpro, configuration, customizing, w eb_dynpro_abap, w ebdynpro_abap, w ebdynproabap,

adaptation, personalization, abap_w d

The objective of this article is to summarize the main differences of UI technologies

like Business Server Pages and Web dynpro, in order to check the pros and cons when

deciding on which technology to use be used by developers for the required project. The

table at the end of the article summarizes the advantages and disadvantages of both UI

technologies.

Web Dynpro is the follow up of the classical Dynpro technology. It is not a direct

competitor of BSP or SAP ITS.

UI Technologies: BSP and WBA

Posted by Paulo Cesar de Biasi Vantini Jul 19, 2013

Page 24: Web Dynpro Abap _ Scn3

Web Dynpro is a programming model, which allows to design standard UIs very quick.

Everything that can be designed without coding is designed without coding. On the other

side, the freedom in designing the UI is restricted. E.g. it is not possible to include client

side JavaScript in the generated pages. The generated code is not restricted to HTML.

However, Web Dynpro recently provided UI elements that allow integration of

custom HTML, custom JavaScript, and custom CSS into a Web Dynpro

application. The relevant UI elements are HTMLIsland, HTMLContainer and

HTMLFragment.

BSP programming model offers to include all browser supported techniques in the

generated HTML pages. However, the construction of a BSP UI takes a lot more time

than the development of a WD UI, since there is no declarative approach. Thus, BSP can

be used for “free-style” programming.

Web Dynpro is implemented in Java and ABAP. It is suited to generate standardized

user interfaces (UIs) using a declarative approach, resulting in a minimum time effort to

realize Web applications. In the ABAP area, there exist two other programming models,

SAP ITS and BSPs, which are still supported. The developer should be prepared for

questions, related to the pros and cons of these three technologies.

SAP ITS will be used in to future to map existing Dynpro-based transactions to HTML

pages. This will be necessary, since it is impossible to convert all Dynpro-based

transactions to Web Dynpro in an acceptable time frame. SAP ITS is the only Web

enabling technology. For all other technologies, the application has to be rewritten

completely! Cons: Long response times, since an additional time frame is necessary for

the mapping between HTML pages and Dynpros (in both directions).

Web Dynpro is the technology SAP uses for developing all future applications.

Existing Dynpro-based transactions will be converted. Web Dynpro will replace the old

Dynpro step by step. Cons: Web Dynpro does allow to develop of standardized UI very

quick, but it is not the right choice for the development of fancy Internet-like UIs. This is

because the UI is rendered from meta data, so the developer cannot place his/her own

JavaScript code in the rendered HTML page (unless using HTML Island and HTML

Container). Web Dynpro has to be embedded in the portal environment to be able to

change the application design.

BSP is the ABAP technology for “free-style” programming. Everything is possible in

terms of RIA (Rich Internet Applications). BSP can be compared to JSP on the Java

side. Cons: Standardized UIs are not supported and everything has to be coded

(Navigation, UI...). The development of a BSP-based UI is much slower than the Web

Dynpro development. Because SAP develops standard applications with the need to

have a standardized and consistent UI, BSP will not be used by SAP. However, BSP is

the only of these three technologies, that allows to design sophisticated Internet

applications based on ABAP. Thus this technology will be very interesting for the

customer also in the future.

Page 25: Web Dynpro Abap _ Scn3

582 View s 2 Comments Tags: w eb_dynpro, ui_technologies_bsp_w ba

Hi,

I want to create a Search input field on my wd screen which can search an index based on the search text I feed in.

The challenge is that search query in the background should execute as soon as I start writing the key rather than on

hitting any button. Did any of you do this in past or have any insights on this. Basically I need to know if there is a wd

function which gets called on entering text in the input field.

If there is nothing like this available as of now in SAP, any suggestion on how to approach designing this functionality.

Thank you so much.

250 View s 4 Comments Tags: w eb_dynpro

Search field in webdynpro which filters results as wewrite text

Posted by Dhiraj Mehta Jun 28, 2013

If you are running NW ABAP 7.31 SPS05, upgraing to SPS 07 means a lot of new feature for WebDynpro ABAP and

Floor Plan Manager.

Below are the details of many new useful features delivered for ABAP WebDynpro & Floorplan Manager as part

SPS07,

Web Dynpro Changes in 7.31 SPS07 -

http://help.sap.com/saphelp_nw73ehp1/helpdata/en/eb/a6d6a041b04fa8afdeb49c1fa032e1/content.htm?

frameset=/en/a3/721c134fdb4f1fbe774cfbfa9be66d/frameset.htm

Floor Plan Manager Changes in 7.31 SPS07-

http://help.sap.com/saphelp_nw73ehp1/helpdata/en/41/801f67890d444ab5ae5efbbcca900a/content.htm?

frameset=/en/a3/721c134fdb4f1fbe774cfbfa9be66d/frameset.htm

622 View s 0 Comments

Tags: w da, w eb_dynpro, w ebdynpro, w eb_dynpro_abap, w ebdynpro_abap, w ebdynproabap,

f loorplan_manager_for_w ebdynpro_abap;, abap_w d, f loor_plan_manager_fpm

New feature for WebDynpro ABAP and Floor PlanManager you get on upgrading NW ABAP 7.31 SPS05to SPS 07

Posted by Tarun Telang Jun 23, 2013

Page 26: Web Dynpro Abap _ Scn3

Hi Experts,

I am sharing my knowledge on Webdynpro Component Interface.

By using the component Interface, We can call multiple components dynamically based on action triggered.

In this document , I am calling 4 components dynamically based on action .

Steps to follow.

1. Create a table named ZCOUNTRY_COMP.

Create the entries as below

1. Create a Webdynpro Component Interface with name 'ZRAO_INTERFACE_TEST' with interface view

'INTERFACE_VIEW'.

2. Create the 4 compoents with the names

'ZRAO_INTERFACE_COMP1,ZRAO_INTERFACE_COMP2,ZRAO_INTERFACE_COMP3

and ZRAO_INTERFACE_COMP4'.

Creating component 'ZRAO_INTERFACE_COMP1' as follows.

i. Delete the default window in ZRAO_INTERFACE_COMP1 and Implement the interface in the component

ZRAO_INTERFACE_COMP1'.

This interface will provide common window named 'INTERFACE_VIEW'.

ii. Create a view with UI element caption as below.

Follow the above two steps for the another 3 components.( ZRAO_INTERFACE_COMP2,

ZRAO_INTERFACE_COMP3, ZRAO_INTERFACE_COMP4 ).

Webdynpro Component Interface

Posted by Narasimha Rao Jun 18, 2013

Page 27: Web Dynpro Abap _ Scn3

&

After creating all the 4 components , Create a Main component ZRAO_INTERFACE_MAIN with re-use component

ZRAO_INTERFACE_TEST interface as follows.

3. Create the view with dropdownbyindex with action 'DROPDOWN' and one ViewContainerElement as below.

4. Write the code in Action DROPDOWN .

METHOD onactiondropdown .

DATA lo_nd_country_comp TYPE REF TO if_wd_context_node.

DATA lo_el_country_comp TYPE REF TO if_wd_context_element.

DATA lv_wda_component TYPE string .

* navigate from <CONTEXT> to <COUNTRY_COMP> via lead selection

lo_nd_country_comp = wd_context->get_child_node( name = wd_this->wdctx_country_comp ).

* get element via lead selection

lo_el_country_comp = lo_nd_country_comp->get_element( ).

IF lo_el_country_comp IS NOT INITIAL.

Page 28: Web Dynpro Abap _ Scn3

* get single attribute

lo_el_country_comp->get_attribute(

EXPORTING

name = 'WDA_COMPONENT'

IMPORTING

value = lv_wda_component ).

DATA lo_cmp_usage TYPE REF TO if_wd_component_usage.

lo_cmp_usage = wd_this->wd_cpuse_dynamic_comp1( ).

IF lo_cmp_usage->has_active_component( ) IS INITIAL.

lo_cmp_usage->create_component( lv_wda_component ). "Dynamic wda component name.

ELSE.

lo_cmp_usage->delete_component( ).

lo_cmp_usage->create_component( lv_wda_component ). "Dynamic wda component name.

ENDIF.

wd_this->wd_get_api( )->do_dynamic_navigation(

source_window_name = 'ZRAO_INTERFACE_MAIN' "{this is my window name }

source_vusage_name = 'MAIN_USAGE_0' "{this one is MAIN--"}

source_plug_name = 'OUT_PLUG1' "{this plug name can be generated dynamically }

target_component_name = 'ZRAO_INTERFACE_TEST'

target_component_usage = 'DYNAMIC_COMP1'

target_view_name = 'INTERFACE_VIEW' "{the view i want to embed}

target_plug_name = 'DEFAULT'

target_embedding_position = 'MAIN/VCE' ).

ENDIF.

ENDMETHOD.

Finally run the application.

If we select COMP2 , second component view will trigger.

Hope it will helpful.

Best regards,

Rao.

765 View s 0 Comments Tags: w eb_dynpro

1. In SE80, select the required Web Dynpro ABAP application and display it (by double-clicking or by choosing

Display).

Web Dynpro ABAP Runtime Analysis

Posted by Narasimha Rao Jun 15, 2013

Page 29: Web Dynpro Abap _ Scn3

2. Choose Goto → HTTP Service Maintenance.

You go to the service node in the SICF for your application.

3. Select the service node that belongs to your Web Dynpro application.

4. Choose Edit → Runtime Analysis → Activate.

5. Make the required settings and choose Activate.

Page 30: Web Dynpro Abap _ Scn3

6. Start your Web Dynpro application, make your user entries and execute the operations for which you would like

to make a runtime analysis.

7. To display the results of the runtime analysis, in transaction SE30 or SAT under Performance Data File choose

Other File…

.