Entering content frame

Procedure documentation Creating Page Fragments Locate the document in its SAP Library structure

Use

Page fragments help ensure that the appearance of your Web application is consistent. Similarly to frames, you can use page fragments to implement the same layout for different parts of your page. In this tutorial, you will use a page fragment to implement a consistent header for all BSPs in your BSP application. You simply include the page fragment in all your BSPs.

Procedure

Take the following steps to create a page fragment for your BSP application:

  1. In the Web Application Builder, open your application (tutorial_3), position your cursor on the highest-level hierarchy node in the left-hand navigation tree, and, using the right mouse button, choose Create ® Page .
  2. In the popup that appears, enter a meaningful name (the system will propose the extension .htm) and a description, and select the page type Page Fragment.
  3. This graphic is explained in the accompanying text

     

  4. Choose This graphic is explained in the accompanying text.
  5. Create the code for your page fragment.
  6. <%@ page language="abap" %>

    <html>

      <head>
        <title>mySAP Bookshop</title>
      </head>

    <body BGCOLOR="#B5E1D2" >

        <h2> <img height="80" width="80" src="book2.jpg"> &nbsp;&nbsp;mySAP Bookshop
        </h2>

      <hr>

     

    Make sure that you do not include the end tags </body> and </html> in this code, as this is a page fragment, and page fragments are always located at the beginning of the HTML page. Correspondingly, page that include the fragment head.htm have no start tags, only end tags.

    This ensures that the headers that are included in every BSP by means of the steps outlined below always look the same:

    This graphic is explained in the accompanying text

    This also sets the background color for the whole page.

  7. Choose This graphic is explained in the accompanying text.

Result

In the Web Application Builder your entire BSP application with the pages, images, and page fragment are displayed:

This graphic is explained in the accompanying text

 

This graphic is explained in the accompanying textLayout for the First Page

 

 

Leaving content frame