Archive

Archive for the ‘Web Dynpro’ Category

Web Dynpro Java – How to Debug the Web Dynpro Application

May 29th, 2011 2 comments

Debugging is the very helpful tool to allow the developer to figure out the issues. SAP NWDS provides support when debugging your Web Dynpro applications. By making special settings for the server process of the J2EE Engine and setting breakpoints, you can interrupt the execution of your application and go through it step-by-step. The following steps give your a step-by-step tutorial of Web Dynpro Java debugging.

Step 1. Enable the server node debugging using the SAP Config Tool.

Read more…

Web Dynpro Java – Parameter Mapping

May 20th, 2011 No comments

The server-side event handler needs more information to handle the client-side event intelligently for various UI elements. For instance, when the user selects an item from a dropdown list, the server-side controller needs to know more than just the fact that an item has been selected; it needs to know exactly which item has been selected.

Web Dynpro framework provides the parameter mapping to allow server-side event handler receive the value of client-side event parameter.

The process of parameter is achieved as follows:

  • Obtain the name of the parameter associated with the client-side event. This can be found by looking in the documentation of the UI element and looking at the mappingOf{ui_event}() method. For example, by looking at IWDCheckBox.mappingOfOnToggle(), you will find that the event has a parameter called checked which is of type boolean.
  • Create an action {act} in the view controller.
  • Define a parameter for the action of the same data type as the event parameter. You will often find it helpful to make the server-side action parameter name the same as the client-side event parameter name, though this is not mandatory.
  • Associate the event parameter with the action parameter. The coding to do this is shown in the next example.

Read more…

Web Dynpro Java – Radio Button

May 19th, 2011 No comments

There are three UI elements about radio button in Web Dynpro – RadioButton, RadioButtonGroupByIndex and RadioButtonGroupByKey. I try to show how to use each of them in a test Web Dynpro application.

Radio Button

The RadioButton UI element is a button with two states (on/off) that enables users to select options. The RadioButton allows to spread the displayed radio buttons individually on the screen instead of grouping them in a table. You can toggle the radio button when you
bind the UI elements to the same context attribute.

There are two important properties of this UI element.

KeyToSelect

This property specifies the value of the key used to select this radio button. You can use the constant for each radio button.

SelectedKey

Specifies the path of the context attribute that stores the selected key. All the radio buttons bind to the same context attribute logically belong to the same group.

Read more…

Web Dynpro Java – Table Sorting

May 8th, 2011 No comments

The sorting functionality of Table in Web Dynpro Java is not enabled by default.  The programmer needs to follow below procedures in order to make the table sortable. There is an onSort event of Table UI element. Event onSort is triggered if the user clicks a column header.

There are several event parameters can be mapped into action handler parameters. All these event parameters are defined as the constants in the inner class – IWDTable.IWDOnSort.

NODE_ELEMENT – Name of the implicit event parameter nodeElement
COL – Name of event parameter col. The id of the column to be sorted.
DIRECTION – The direction in which the sorting has been requested.
MUILTPLE – Indicates that the supplied column should be sorted additional to the previously existing sorting. Type boolean.

Read more…

Web Dynpro Java – Miscellaneous QA

April 27th, 2011 No comments

This post will collect the popular Q&As for Web Dynpro Development. I try to update this post as frequent as possible:-)

1. How to add SAP icons in the Web Dynpro UI elements like button, image?

You can find my another post – Web Dynpro – Use Icons on how to add sap standard icons. If you can access the web application server remotely, you can find all these SAP icons gif files from file system usrsap<System ID><System No>j2eeclusterserver0tempwebdynprowebsap.comtc~wd~dispwdaglobalsapIcons’.

2. Where can I find a list Web Dynpro API?

From here, you can find the public Web Dynpro API documentation.

Web Dynpro Java – How to consume Web Service

January 15th, 2011 No comments

In my previous blog – Expose RFM to Web Service, I explained how to expose a ABAP function module to a web service. Thanks to my friend Merlin for sharing how to consume Web Service in Web Dynpro for Java, I would like to write these steps down.

1. Create a new Web Dynpro DC

Create a new Web Dynpro project or a WD DC in a software component.

2. Create a new Model from the WSDL file

Generally, there are two model type for Web Service. One is Adaptive Web Service Model, the other is Web Service Model which has been marked as deprecated. In this example, I will use the Adaptive RFC Model.

Read more…

Web Dynpro Java – Web Dynpro Framework

November 11th, 2010 No comments

I tried to find out the technical details of Web Dynpro framework, but I didn’t find any official documentation on it. I just write down my own understanding on Web Dynpro Framework in this post.

What the Web Dynpro Framework is?

Web Dynpro Framework is just another web framework like Struts, WebWork and other open source web framework in the Java community.

web dynpro framework

Read more…

Web Dynpro Java – Session

November 10th, 2010 1 comment

What is the session? Why we need it?

As the HTTP is a stateless protocol, the web server can response to the request from each client, but it cannot remember previous requests from the same client. It is difficult to build the web site such as shopping on-line that requires to distinguish from different clients to retain contextual information. The session concept is involved to solve there issues.

In session management whenever a request comes for any resource, a unique token is generated by the server and transmitted to the client. We can also say that the process of managing the state of a web based client is through the use of session IDs. Session IDs are used to uniquely identify a client browser, while the server side processes are used to associate the session ID with a level of access.

Generally speaking, there are three methods to implement the session concept:

Read more…

Web Dynpro Java – JCo Connection

November 1st, 2010 1 comment

The connection management in Web Dynpro is a difficult topic. Many developers are still confused by the JCo connection even after one year development. In this post, I would like the share my understanding on SAP Web Dynpro Java connection management. Please let me know if I miss anything.

If the Adaptive RFC is chosen to retrieve data from backend R/3 or other SAP systems, developer needs to create two JCo Destinations in SAP NetWeaver Web Dynpro Content Administrator.

Generally, there are two ways to logon the remote server. One is SSO Ticket and the other is defined user. Please find below articles on how to configure the JCo Destination.

Web Dynpro Best Practices: How to Configure the JCo Destination Settings

Read more…

Web Dynpro Java – how to use KM API

October 26th, 2010 No comments

KM(Knowledge Management) provides a central, role-specific point of  entry to unstructured information from various data sources in the portal. It also provides a set of API to allow other applications to use KM functions.

Below are the steps on how to use KM API in web dynpro application.

Step 1. Go to web dynpro project properties and select ‘Java Build Path’.

web dynpro project

Read more…