Show TOC

Procedure documentationDisplay Data on a Calendar Locate this document in the navigation structure

 

The Calendar view represents date data by mapping it onto a calendar display.

Note Note

The Calendar view is available only with the Web Dynpro runtime.

End of the note.

Each record coming from the back-end system has a start and end date, and is mapped onto a series of dates in the calendar called a time period. Each time period can be highlighted on the calendar according to a defined legend. The legend can come from the back-end system, or can be defined locally in Storyboard.

The following is an example of the Calendar view displaying time periods:

Calendar View (Calendar View)

All required data can be retrieved from the back-end system in one operation. The Calendar view displays subsets of this data. In the previous example, data is displayed for the months of February to April. The user can page to the next subset to display data for March to May.

However, in many cases the back-end system contains a large number of records for the defined time range, the retrieval of which may slow down performance. You can therefore model your iView so that only subsets of data are retrieved at a time, and with each click of the Paging (Paging) button, the system is re-accessed and a new subset is retrieved.

Procedure

In the following example we will define a calendar view. The user will enter a start date in a form and click Submit to display a three-month period containing the time periods during which he was absent from work. With each click of thePaging (Paging) button, the back-end system will be accessed, and the start date of the retrieved data will be incremented by one month.

In the example we use a data service called BAPI_ABSENCE_GETLIST.

  1. On the Design board, create and connect all the components of the iView.

    Your iView should look similar to the following:

    Basic View (Basic View)

  2. Double-click the calendar control. The Configure Element task panel is displayed, showing the properties of the calendar. In the No. of months field in the Formatting group, enter 3.

  3. On the input port of the data service, map a start date that defines the first record to be retrieved from the back-end system. Click the submit connector, and assign @StartFrom to the Start field and @DADD(@StartFrom,3,'M') to the End field.

  4. Click the calendar control, and in the Configure Element task panel, configure the calendar as follows:

    1. From the Calendar rangedrop-down list in the Time period group, choose Bound.

    2. From the Calendar startdrop-down list, choose the field that was mapped to the Absence Getlist input port. In this example, the field comes from the input form.

  5. Map the output of the calendar to the input of Absence Getlist:

    1. Drag out from the out port of calendar to the Input port of Absence Getlist.

    2. Click the connecting line and in the Event name field, define its name as goto. A list of fields transferred by the link is displayed at the bottom of the Configure Element task panel.

    3. Map the input fields of the data service to the fields that are output from the form as follows: assign @ID[ACA1SN]@StartFrom to the Start field and @DADD(#ID[ACA1SN]@StartFrom,3,'M') to the End field.

    Your model should look similar to the following:

    Final iView (Final iView)

At runtime, with each click of the Paging (Paging) button, the date entered in the input form will be incremented by one month, and as a result, the entire range displayed will be incremented by one month.