Skip to Content
Author's profile photo Former Member

BSP: Flexible page layout using PHTMLB

Consider there is a requirement to create a role based web application for use by the administrators and managers that displays employee details. Managers are allowed to view  complete information of an employee, the administrators have only restricted view access.

For example, managers have access to annual salary, rate and expense; and the administrative user can only view the expense details along with the other information, but not the annual salary and the rate.

Even though there are different ways to achieve the result, the formlayout tag of PHTMLB BSP extension gives more flexibility for the developer to customize the page with less effort and minimal change in the code at any stage of the development process.

Let’s create a BSP application to show how this can be achieved, this example is based on SAP WAS 6.40.

1. Create a BSP application ZTESTONE.


2.   Create a page with flow logic candmain.htm with the following attributes



Step 2.

Now, customize the formlayout controls with desired display attributes by maintaining values in the table VRCFPHTMLB_FLI_C.

First column: Name of the BSP page name along with the application name and name space.

Second column: Meaningful name for the context, which will be used as the value for customization key of the formlayout attribute.

Third column: Id of the formlayout control to be customized on the page.

Fourth column: Display attribute of the control in the formlayout.

When this context name is used in the customization key attribute of the formlayout, the view of the page depends on the display attributes mentioned in the above table.

Other data fields that are to be displayed on the page irrespetive of the role is not maintained here as part of the context(Customization key).



5. OnCreate event:

In our scenario when the application is started it is set to administrator role, in which the annual salary and the rate are not displayed, however expense field is shown as display only.

onCreate event is used to set the page attributes to the value mentioned below.


6. On Input processing event(Button clicked):

When button is clicked, the page attributes are changed, so that the page layout will show the fields for the Manager. In this case, all the fields are displayed in the layout.


The results for this example are shown below.

Administrator Role


Manager Role



This example can also be tried in WAS 6.20, which has PHTMLB BSP extensions. However, the field customization table PHTMLB_FLI_CUST is to be maintained programmatically with the required values for customization as there is no table maintenance transaction available.

Assigned Tags

      1 Comment
      You must be Logged on to comment or reply to a post.
      Author's profile photo Brian McKellar
      Brian McKellar

      Hallo Suresh,<br/><br/>Very well written! The <phtmlb:formLayout> is one of my favourite tags. Your weblog was hit very subtly directly on the major design aspects when we developed the tag. It is one of the few tags where an application group helped us with the design and implementation. And it is exactly this flexibility that you describe, which they required and had us implement. It is always nice to see that work done is actually then used to perfection! <br/><br/>regards, brian<br/>