|
|
Favourites cookie bsp - initial page to display input fields and retrieve user input
This is the initial.htm page of the example favourits BSP, this is being used
to demonstrate the use of cookies to store and retrieve information entered by a sap bsp user. Please note this page will do very little on
it own and needs to be implemented as part of the whole favourits BSP application
*initial.htm
Type Definitions
----------------
TYPES: begin of t_favourites,
tcode type tstc-tcode,
PGMNA type tstc-PGMNA,
ttext type TSTCT-ttext,
end of t_favourites.
types: tt_favourites type standard table of t_favourites,
tw_favourites type t_favourites.
Page Attributes
---------------
it_favourites TYPE TT_FAVOURITES (Auto selected)
wa_favourites TYPE TW_FAVOURITES
On create
---------
data: a_name type string value 'NONE',
a_name_space type string value 'NONE',
u_name type string value 'NONE',
session_id type string value 'NONE'.
CL_BSP_SERVER_SIDE_COOKIE=>GET_SERVER_COOKIE(
EXPORTING
NAME = 'NET200'
APPLICATION_NAME = a_name
APPLICATION_NAMESPACE = a_name_space
USERNAME = u_name
SESSION_ID = session_id
DATA_NAME = 'COOKIE_ID_43CASE2'
* IMPORTING
* EXPIRY_DATE =
* EXPIRY_TIME =
CHANGING
DATA_VALUE = it_favourites ).
OnInputProcessing
-----------------
CLASS CL_HTMLB_MANAGER DEFINITION LOAD.
case event_id.
when 'LOOKUP1'.
navigation->set_parameter( name = 'line1a' ).
navigation->set_parameter( name = 'line1b' ).
* gt_event = 1.
navigation->set_parameter( name = 'gt_event'
value = '1').
navigation->goto_page( 'DISPLAY.HTM' ).
when 'LOOKUP2'.
navigation->set_parameter( name = 'line2a' ).
navigation->set_parameter( name = 'line2b' ).
* gt_event = 2.
navigation->set_parameter( name = 'gt_event'
value = '2').
navigation->goto_page( 'DISPLAY.HTM' ).
when CL_HTMLB_MANAGER=>EVENT_ID.
DATA: event TYPE REF TO if_htmlb_data,
selrow TYPE REF TO CL_HTMLB_TABLEVIEW.
event = cl_htmlb_manager=>get_event_ex( request ).
selrow ?= cl_htmlb_manager=>get_data( request = request
name = 'tableView'
id = 'tv1' ).
DATA: tv_data TYPE REF TO CL_HTMLB_EVENT_TABLEVIEW.
tv_data = selrow->data.
IF event IS NOT INITIAL
AND event->event_name = 'tableView'.
read table it_favourites into wa_favourites index
tv_data->ROWSELECTION.
navigation->set_parameter( name = 'gt_tcode'
value = wa_favourites-tcode ).
navigation->goto_page( 'EXECUTE.HTM' ).
ENDIF.
when 'OTHERS'.
ENDCASE.
Layout
------
<%@page language="abap"%>
<%@extension name="htmlb" prefix="htmlb"%>
<html>
<head>
<link rel="stylesheet" href="../../sap/public/bc/bsp/styles/sapbsp.css">
<title> Intial page of BSP application </title>
</head>
<body class="bspBody1">
<h1><img src="sap_logo.gif"> Transaction Lookup Facility</h1>
<form>
<table width="80%" cellspacing="0" cellpadding="0" border="0">
<!-- Search by t code -->
<tr>
<td>
Search by Code:
</td><td>
<input type="text"
name="line1a"
size="10">
</td>
</tr>
<!-- Search by program name -->
<tr>
<td>
Search by Program name:
</td><td>
<input type="text"
name="line2a"
size="10"></td>
</tr>
</table>
<!------------------------------------------------------>
<!-- Submit Buttons -->
<!------------------------------------------------------>
<input type="hidden"
name="gt_event"
value=" ">
<input type="submit"
name="OnInputProcessing(LOOKUP1)"
value="Tcode"></td>
<input type="submit"
name="OnInputProcessing(LOOKUP2)"
value="Program"></td>
</form>
</body>
</html>
<htmlb:content design="design2003">
<htmlb:page title = " ">
<htmlb:form>
<htmlb:textView text = "Favourites"
design = "EMPHASIZED" />
<htmlb:tableView id = "tv1"
visibleRowCount = "100"
selectionMode = "lineEdit"
table = "<%= it_favourites %>"
columnWidth = "30" />
</htmlb:form>
</htmlb:page>
</htmlb:content>
Website Navigation to related information
|