Sie sind auf Seite 1von 511

BC440 DevelopingInternet

plication Components Ap
BC440










Release 640 04/05/2006



SAP AG 1999
B
Com
C440 Developing Internet Application
ponents
BC
BC
440
440
Developing
Internet Application
Components
Developing
Internet Application
Components



R/3
Release 4.6
Date: January 2000
Material number: 5003 4855



SAP AG 2004
Copyright 2004 SAP AG. All rights reserved.
No part of this publication may be reproduced or transmitted in
any form or for any purpose without the express permission of
SAP AG. The information contained herein may be changed
without prior notice.
Copyright



Some software products marketed by SAP AG and its distributors contain proprietary software components of
other software vendors.
Microsoft, Windows, Outlook, and PowerPoint are registered trademarks of Microsoft Corporation.
IBM, DB2, DB2 Universal Database, OS/2, Parallel Sysplex, MVS/ESA, AIX, S/390, AS/400, OS/390, OS/400,
iSeries, pSeries, xSeries, zSeries, z/OS, AFP, Intelligent Miner, WebSphere, Netfinity, Tivoli, and Informix are
trademarks or registered trademarks of IBM Corporation in the United States and/or other countries.
Oracle is a registered trademark of Oracle Corporation.
UNIX, X/Open, OSF/1, and Motif are registered trademarks of the Open Group.
Citrix, ICA, Program Neighborhood, MetaFrame, WinFrame, VideoFrame, and MultiWin are trademarks or
registered trademarks of Citrix Systems, Inc.
HTML, XML, XHTML and W3C are trademarks or registered trademarks of W3C, World Wide Web
Consortium, Massachusetts Institute of Technology.
Java is a registered trademark of Sun Microsystems, Inc.
JavaScript is a registered trademark of Sun Microsystems, Inc., used under license for technology invented and
implemented by Netscape.
MaxDB is a trademark of MySQL AB, Sweden.
SAP, R/3, mySAP, mySAP.com, xApps, xApp, and other SAP products and services mentioned herein as well as
their respective logos are trademarks or registered trademarks of SAP AG in Germany and in several other
countries all over the world. All other product and service names mentioned are the trademarks of their respective
companies. Data contained in this document serves informational purposes only. National product specifications
may vary.
These materials are subject to change without notice. These materials are provided by SAP AG and its affiliated
companies ("SAP Group") for informational purposes only, without representation or warranty of any kind, and
SAP Group shall not be liable for errors or omissions with respect to the materials. The only warranties for SAP


Group products and services are those that are set forth in the express warranty statements accompanying such
products and services, if any. Nothing herein should be construed as constituting an additional warranty.


SAP AG 1999
ABAP Workbench
ABAP Workbench:
Foundations and
Concepts
BC400 5 days
Managing ABAP
Developments Projects
MBC40 2 days
Data Transfer
BC420 5 days
Techniques of List
Processing and InfoSet
Query
BC405 3 days
SAPscript: Forms Design
and Text Management
BC460 3 days
CATT:Test Workbench and
Computer Aided Test Tool
CA610 (Rel. 4.0) 2 days
ABAP Performance
Tuning
BC490 3 days ABAP Programming
Techniques
BC402 3 days
Programming
Database Updates
BC414 3 days
Enhancements
and Modifications
BC425 3 days
Recommended supplementary
courses are:
Business Process Technologies
CA925, CA926, CA927
BC095 (Business Integ. Techn.)
BC619 (ALE), BC620, BC621
Level 2
ABAP Objects: Object -
Oriented Programming in R/3
BC404 3 days
Form Printing Using
SAP Smart Forms
BC470 2 days
ABAP Dictionary
BC430 2 days
Dialog Programming
using EnjoySAP Controls
BC412 3 days
Programming
User Dialogs
BC410 5 days
Communication
Interfaces in ABAP
BC415 2 days
Level 3





SAP AG 1999
Required:
SAP50 - Basis Technology
BC400 - ABAP Workbench: Concepts and Tools
BC410 - Developing User Dialogs
Recommended:
Knowledge of HTML
Course Prerequisites





SAP AG 1999
Target Group
Project teams with ABAP experience who want to know how
the R/3 System can be connected to the WWW using the
Internet Transaction Server.
SAP consultants and partners working with customers who
want to connect R/3 to the WWW.
Duration: 5 days
Audience:



User notes:
The training materials are not teach-yourself programs. They complement the course instructor's
explanations. On the sheets, there is space for you to write down additional information.

(C) SAP AG BC440 1-1
SAP AG 1999
Course Goal
Course Objectives
Course Content
Course Overview Diagram
Main Business Scenario
Contents
Course Overview




(C) SAP AG BC440 1-2
SAP AG 2001
This course will prepare you to:
Use the Internet Transaction Server (ITS) for using
R/3 with the World Wide Web
Explain the programming models for ITS-based
Internet applications
Use HTML
Business
Course Goal




(C) SAP AG BC440 1-3
SAP AG 1999
At the conclusion of this course, you will be able to:
Outline requirements for transactions on the
WWW
Describe the architecture of the Internet
Transaction Server
Design and implement a WebTransaction
Develop WebRFC-enabled function modules
Course Objectives




(C) SAP AG BC440 1-4
SAP AG 1999
Unit 6 ABAP Workbench
Basics
Unit 7 SAP GUI for HTML
Unit 8 EasyWebTransactions
Unit 9 ITS Flow Logic
Unit 10 HTML
Business
Unit 11 Summary and Outlook
Unit 1 Course Overview
Unit 2 Introduction
Unit 3 Internet, Intranet and
WWW
Unit 4 HTML, CSS and
JavaScript
Unit 5 Internet Transaction
Server
Preface
Appendices
Course Content




(C) SAP AG BC440 1-5
SAP AG 1999
C
o
u
r
s
e
O
v
e
r
v
i
e
w
P
r
e
f
a
c
e
1
2
S
u
m
m
a
r
y

a
n
d

O
u
t
l
o
o
k
9
Course Overview Diagram
Internet, Intranet and WWW
Internet Transaction
Server
HTML
Web
Transaction
Web RFC
3
6 7
4
Administration 8
5




(C) SAP AG BC440 1-6
SAP AG 1999
Each course participant will develop their own on-
line travel agency with:
HTML pages:
Containing hyperlinks, images, and forms
CSS and JavaScript
Connection to R/3:
Online flight information system with
booking function
Main Business Scenario




(C) SAP AG BC440 2-1
SAP AG 1999
Connecting R/3 and the Web
Internet Transaction Server (ITS)
Programming models
Contents:
Introduction




(C) SAP AG BC440 2-2
SAP AG 1999
List the requirements for connecting components
between the World Wide Web and R/3
Describe the concept of the Internet Transaction
Server (ITS)
At the conclusion of this unit, you will be able to:
Introduction: Unit Objectives




(C) SAP AG BC440 2-3
SAP AG 1999
C
o
u
r
s
e
O
v
e
r
v
i
e
w
P
r
e
f
a
c
e
1
2
S
u
m
m
a
r
y

a
n
d

O
u
t
l
o
o
k
9
Overview Diagram Preface
Internet, Intranet and WWW
Internet
Transaction
Server
HTML
Web
Transaction
Web RFC
3
6 7
4
Administration 8
5




(C) SAP AG BC440 2-4
SAP AG 1999
Connecting R/3 and the Web
Connecting R/3 and the Web
Internet Transaction Server (ITS)
Internet Transaction Server (ITS)
Programming Models
Programming Models
Overview: Connecting R/3 and the Web




(C) SAP AG BC440 2-5
SAP AG 1999
.
.
.
Presentation Application Database
SAP GUI SAP GUI
R/3 Client/Server Architecture
.
.
.
DIAG



Application solutions can be divided into three functional areas - presentation, application logic and
data storage. The design of the software allows all three components to run on separate systems.
The R/3 System can distribute presentation, application logic and data storage to different computers.
The prerequisite is the three-tier client/sever architecture of the R/3 System:
- The database server is installed on a central computer, and the processes presented in the database
service run from here.
- Several application servers can be connected to the database server. The actual application logic is
processed on the application servers.
- Several presentation servers (frontend) which users work on can be connected to each application
server. All presentation tasks are carried out on these individual computers.


(C) SAP AG BC440 2-6
SAP AG 1999
Web browser Web browser
R/3 With Web Connection
.
.
.
Presentation Application Database
SAP GUI SAP GUI
.
.
.
DIAG
HTTP
(HTML)
?
Web Web
server server




(C) SAP AG BC440 2-7
SAP AG 2001
?
WS WS R/3 R/3
Connection Between HTTP Server and R/3
Communication with
the HTTP server
the R/3 application
server
User administration for R/3
logon
Conversion of R/3 data into
HTML pages
Status management
Synchronization of R/3




(C) SAP AG BC440 2-8
SAP AG 1999
?
Outside in
Inside out
Connecting to the Web




(C) SAP AG BC440 2-9
SAP AG 1999
System Help
SAP R/3

q
q

q
+
+

+
Business
object
Booking no. 561966
Cancel
BAPI
BAPI Outside in
Internet Internet
Transaction Transaction
Server Server
HTTP HTTP
server server
Inside out
Program
Where is the Transaction Logic?




(C) SAP AG BC440 2-10
SAP AG 1999
Connecting R/3 and the Web
Connecting R/3 and the Web
Internet Transaction Server (ITS)
Internet Transaction Server (ITS)
Programming Models
Programming Models
Overview: Internet Transaction Server (ITS)




(C) SAP AG BC440 2-11
SAP AG 1999
R/3 Client/Server Architecture with ITS
.
.
.
Presentation Application Database
.
.
.
DIAG
HTTP
(HTML)
ITS ITS
Web browser Web browser
SAP GUI SAP GUI
Web Web
server server



The Internet Transaction Server extends the three-tier client/server structure of the R/3 System to the
Internet.
With a SAP GUI the R/3 System can be used simultaneously with the Internet Transaction Server.


(C) SAP AG BC440 2-12
SAP AG 1999
Web Browser
pplication
Requirements:
HTML 3.2 or later
Supported products:
Windows 95 or Windows NT
Microsoft Internet Explorer 4.0
Netscape Communicator 4.0
GUI for Internet A
Components



All current Web browsers that can interpret at least HTML version 3.2 are suited for communication
with the Internet Transaction Server.
- Microsoft Internet Explorer 4.0 is required for "interactive WebReporting".
Browser enhancements (such as Java-Applets and ActiveX) are not required.


(C) SAP AG BC440 2-13
SAP AG 1999
Web Web
server server
ITS ITS R/3 R/3
The Web Server
Interface to the World
Wide Web
Requirements:
CGI interface or
ISAPI (Microsoft) or
NSAPI (Netscape)
Availability:
Third party suppliers



Supported Web servers:
- Microsoft Internet Information Server: 3.0, 4.0 as of ITS 2.1
- Netscape Enterprise Server: 3.0
- Netscape Enterprise Server on 5 different UNIX Web servers (CGI interface)
Connecting the Web server to the ITS:
- CGI - Common Gateway Interface: Standard interface to connect the Web server to an
executable program on the same computer
- ISAPI - Internet Server API: Interface developed especially for Microsoft's Internet Information
Server to use DLLs on the same computer (DLL = Dynamic Link Library).
- NSAPI - Netscape Server API: Interface developed especially for Netscape's Server to use DLLs
on the same computer.
For further information see units "Internet, Intranet and WWW" and "Internet Transaction Server".



(C) SAP AG BC440 2-14
SAP AG 1999
Internet Internet
Transaction Transaction
Server Server
WS WS R/3 R/3
Internet Transaction Server
Link between the
WWW and R/3
Converts R/3 data
into HTML pages
Requirements:
Server based on Intel
Windows NT
Server 4.0
Availability:
R/3 installation
(server components CD)
www.saplabs.com



For details about availability and up-to-date information see:
http://service.sap.com/sap-its
Customers and partners can also order the CDs in SAP-OSS:
Subject area: XX-SER-SWFL-SHIP
You must specify an installation number.



(C) SAP AG BC440 2-15
SAP AG 1999
R/3 R/3
System System
ITS ITS WS WS
R/3 System
Business
transactions
Requirements:
Release 3.1G
or higher
Internet
Applications
Components (IAC)
Instead of R/3, you can
use other mySAP.com
components such as
BW, API, KW etc.



All R/3 Releases from 3.0D can be used with all ITS Releases. For details and restrictions see Note
80074.


(C) SAP AG BC440 2-16
SAP AG 1999
Connecting R/3 and the Web
Connecting R/3 and the Web
Internet Transaction Server (ITS)
Internet Transaction Server (ITS)
Programming Models
Programming Models
Overview: Programming Models




(C) SAP AG BC440 2-17
SAP AG 1999
R/3 R/3
System System
ITS ITS
SAP GUI
for the Windows
environment
SAP GUI
for the Java
environment
SAP GUI
for HTML
W
i
n
d
o
w
s
3
2

B
i
t
J
a
v
a
V
M
W
e
b

B
r
o
w
s
e
r
SAP's GUI Strategy




(C) SAP AG BC440 2-18
SAP AG 1999
SAP GUI
for HTML
SAP GUI SAP GUI
for HTML for HTML
IA
IAC
IAC IAC
WebTransactions
WebTransactions WebTransactions
Transactions
for
Internet
Internet Internet
n n
WebTransactions
Application
Applicatio pplicatio
Components
Components Components
WebRFC
WebRFC WebRFC
Function
A
Cs and SAP GUI for HTML
R/3
R/3 R/3
modules
for WebRFC
Entire R/3
functionality



With the Internet Transaction Server, R/3 functions can be mapped into the Internet in three different
ways:
If an R/3 program is created especially for Internet users, it is called an Internet Application
Component (IAC). These include WebTransactions and WebRFC. IACs are not complex and they are
easy to use.
- WebTransaction - special internet-enabled transactions that make a part of the whole R/3
functionality available to Internet users.
- WebRFC - special function modules that can read and present data directly to the Internet user
The SAP GUI for HTML enables you to use almost all the R/3 functions in the Web browser. The
high level of complexity of R/3 transactions is also supported.

(C) SAP AG BC440 2-19
SAP AG 1999
System Help
SAP R/3

q
q

q
+
+

+
System Hilfe
SAP R/3

q
q

q
+
+

+
R/3 R/3
Web Web
browser browser
ITS ITS
HTTP HTTP
server server
HTTP HTTP
HTTP HTTP
CGI CGI
CGI CGI
Carrier ID: LH
Carrier name:
Lufthansa
200
100
DIAG DIAG
DIAG DIAG
1 Screen =
1 Template =
1 HTML page
EasyWebTransaction (EWT) Components
Service
file
HTML
Business
templates



EasyWebTransactions consist of three components: R/3 transaction, service file and HTML
Business
templates. Complex EasyWebTransactions have more components. For simplicity these are not shown
on the above slide.
The R/3 transaction is created especially for use by the ITS:
- Only use "simple" screens that can be easily converted into HTML
- The transaction must allow synchronization through the ITS
- Use a special technique to provide users with input help in HTML forms
- Users must be able to log on to the Internet while the transaction is being processed
- The business logic can be created quickly using BAPIs
The service file contains information required by the ITS to log on to the R/3 System and to start the
transaction.


(C) SAP AG BC440 2-20
SAP AG 1999
R/3 R/3
Web Web
Browser Browser
ITS ITS
HTTP HTTP
server server
HTTP HTTP
HTTP HTTP
CGI CGI
CGI CGI
Lufthansa
RFC RFC
RFC RFC
1 call =
1 HTML page
WebRFC-enabled
function module
WebRFC
WebRFC
WebRFC
templates




WebRFC is based on an RFC connection between the ITS and the R/3 application server
(RFC = remote function call).
The ITS transfers a parameter table to a special RFC-enabled function module in R/3 and in response
receives a table that represents either an HTML page or a MIME object.

(C) SAP AG BC440 2-21
SAP AG 2001
System Help
SAP R/3

q
q

q
+
+

+
System Help
SAP R/3

q
q

q
+
+

+
R/3 R/3
Web Web
browser browser
ITS ITS
HTTP HTTP
server server
HTTP HTTP
HTTP HTTP
CGI CGI
CGI CGI
Carrier ID: LH
Carrier name:
Lufthansa
200
100
DIAG DIAG
DIAG DIAG
SAP GUI for HTML Components
1 screen =
1 HTML page
HTML
Business
functions
Service
file



SAP GUI for HTML enables almost every R/3 transaction to be executed in the Web browser. All
screen elements (and controls) are automatically converted into HTML pages.

(C) SAP AG BC440 2-22
SAP AG 1999
SAPGUI
for HTML
SAPGUI
for HTML
Internet Application Components
Internet Application Components
Web Transactions
Web Transactions
WebRFC
WebRFC
Customer
developments
SAP Standard
modifications
SAP Standard
modifications
Internet Transaction Server
Internet Transaction Server
Focus of this Course
ITS ITS




(C) SAP AG BC440 2-23
SAP AG 1999
Connecting R/3 and the Web
Connecting R/3 and the Web
Internet Transaction Server (ITS)
Internet Transaction Server (ITS)
ITS and SAP's GUI strategy
ITS and SAP's GUI strategy
ITS and mySAP.com
ITS and mySAP.com
Preface




(C) SAP AG BC440 2-24
SAP AG 2001
m
Workplace
Workplace Marketplace in
www.mySAP.com
Marketplace in
www.mySAP.com
Company or
organizational
boundary
e-Community
Marketplaces
e-Community
Marketplaces
Information and services within
the company
Information and services within
the company
Information and services outside
the company
Information and services outside
the company
ySAP.com Overview



The mySAP.com Workplace supports employees by providing the right information and applications
through a mouse click and using an interface that is easy to understand, use and adapt to personal needs.
The mySAP.com Workplace has the following features:
Single point of access - one point of access to applications, information and services using a Web
browser
Personalized and role-based user interface
Easy integration
Openness and flexibility
Access from anywhere at any time
The mySAP.com Marketplace
Enables all business processes to be carried out on one level (One-Step-Business) - at any time,
anywhere and with any business partner.
Contains a cross-industry horizontal marketplace as the basis for cooperation between business
partners.
Contains a range of vertical and regional marketplaces for specialized business between groups with
common interests, such as the oil and gas industries.

(C) SAP AG BC440 2-25
SAP AG 1999
mySAP.com Workplace
ITS ITS
WP
engine
WP WP
server server
Component Component
system system 1 1
HTTP HTTP
ITS ITS HTTP HTTP
ITS ITS
1
2
Browser Browser
HTTP HTTP
... ...
Component Component
system system 2 2
R/3
APO
BW
KW
BBP
CRM
Workplace middleware Backend systems Frontend
...



When an employee accesses the functions on a backend system (e.g. R/3) from his/her Workplace the
following components are involved:
The Web browser communicates with the HTTP server that is running on a remote computer. The
connection is established across the Internet or Intranet.
The information about the Workplace (user role, personalization) is held on the Workplace server.
The employee logs on to the Workplace once only (Single Sign-On).
The Internet Transaction Server (ITS) sets up the connection between an HTTP server and an SAP
backend system.
Other ways to access an SAP backend system are:
SAP GUI for the JAVA Environment: Can run in the Web browser, allows direct access
Windows terminal client: Can run in the Web browser, access via a frontend server
SAP GUI for the Windows Environment: Direct access from a Windows workstation computer

(C) SAP AG BC440 2-26
SAP AG 1999
List the requirements for connecting components
between the World Wide Web and R/3
Describe the concept of the Internet Transaction
Server (ITS)
You are now able to:
Introduction: Unit Summary




(C) SAP AG BC440 3-1
SAP AG 1999
Internet Technology
World Wide Web
Security in the Internet
Intranet
Contents:
Internet, Intranet and WWW




(C) SAP AG BC440 3-2
SAP AG 1999
Define the basic components of Internet
technology
List the differences between the Internet and
WWW
Understand what HTTP requests and HTTP
responses are
List security issues
At the conclusion of this unit, you will be able to:
Internet, Intranet and WWW: Unit Objectives




(C) SAP AG BC440 3-3
SAP AG 1999
C
o
u
r
s
e
O
v
e
r
v
i
e
w
P
r
e
f
a
c
e
1
2
S
u
m
m
a
r
y

a
n
d

O
u
t
l
o
o
k
9
Overview Diagram - Internet, Intranet and WWW
Internet, Intranet and WWW
Internet
Transaction
Server
HTML
Web
Transaction
Web RFC
3
6 7
4
Administration 8
5




(C) SAP AG BC440 3-4
SAP AG 1999
Internet Technology
Internet Technology
World Wide Web
World Wide Web
Security in the Internet
Security in the Internet
Intranet
Intranet
Overview: Internet Technology




(C) SAP AG BC440 3-5
SAP AG 1999
Internet
Internet
The Internet - The Network of All
Networks



The Internet is a network of computer networks. It is operated by:
Governments in various countries
Research and educational institutions
Private companies
armed forces
Other organizations
Internet Engineering Task Force (IETF), the organization representing the above organizations, is
responsible for standardizing the communications protocols used. (http://www.ietf.org).
These standards are published as Requests for Comments (RFC). Following discussions with the
"Internet community" they are enacted. They can, however, later be amended or replaced with new
RFCs.


(C) SAP AG BC440 3-6
SAP AG 1999
TCP/IP =Transmission Control Protocol / Internet Protocol
Developed and standardized in 1970 in the USA
Used by almost all hardware and operating systems
Enables different systems to be connected
T
Internet Internet
he Communications Protocol: TCP/IP



IP - Internet Protocol has the following task:
Addressing - Controls the transport of data packets from the sender to the receiver
TCP - Transmission Control Protocol is responsible for:
Fragmentation - Breaks down a message into data packets before it is sent and reassembles the
message at the receiver
Basic data transfer - Converts a data flow into data packets
Reliability - Ensures that the data packet is delivered to the receiver
Flow control - Controls the data flow process (e.g. how many packets the receiver should get)
Multiplexing - Handles several connections to one computer
Connections - Establishes connections and disconnections
RFCs (Request for Comments)
IP is defined in RFC 791.
TCP is defined in RFC 793.

(C) SAP AG BC440 3-7
SAP AG 1999
IP Address
193.78.135.91
IP Address
142.16.172.83
The IP Address
A four-byte address that uniquely identifies each computer
in the Internet worldwide (in the future: 16-byte address)
The IP address consists of:
Network ID (1-3 bytes)
Host ID (remaining bytes)



IP requires a globally unique address to transmit a data packet between the sender and receiver.
The address consists of four bytes:
Network ID - the first one to three bytes
Host ID - the remaining byte(s)
The more bytes that are used for the network ID, the fewer computers (hosts) can be managed in the
network.
If a computer is transferred to a different network, its IP address changes.
The Network Information Center (NIC) in each country assigns network IDs. (Worldwide:
http://www.internic.net, Germany http://www.nic.de). Network providers can freely
assign host IDs.
In the future, it is planned to extend the IP address to 16 bytes because not enough addresses can be
assigned with four bytes to meet the increasing demand.


(C) SAP AG BC440 3-8
SAP AG 1999
IP Address
193.78.135.91
R
Network
142.16
Network
193.78.135
IP Address
142.16.172.83
outer - Connects Two Networks
A router connects two networks
Two network cards
Two IP addresses (one from each network)



Within the same network, IP packets can be delivered directly to the receiver.
Routers are used to send IP packets from one network to a different network.
Routers know the topology (architecture) of the Internet and therefore know which networks to use to
send a packet to a receiver in a remote network.
Data packets from one sender can be routed along different paths to the same receiver, for example, if a
network fails or is overloaded. TCP ensures that the packets are delivered in the same sequence.


(C) SAP AG BC440 3-9
SAP AG 1999
Problem:
Solution:
PC12
PC55
PC34
WDF
Walldorf
R
Palo Alto
Singapore
Network Host name Domain
pc12.wdf.sap.com
.com
.com
Domain Name System (DNS)
IP addresses are difficult to remember and change frequently
A globally unique name is assigned to an IP address (letters and
words)



The Network Information Center (NIC) in each country assigns domain names as well as network
IDs
Codes for countries (ISO 3166) are the top-level domain: de, fi, jp
Top-level domains in the USA:
com companies
edu schools, universities
gov governmental bodies
mil military
org other organizations
net special networks
See appendix for further information.




(C) SAP AG BC440 3-10
SAP AG 1999
News
S
World
Internet Internet
Wide Web (WWW)
transfer (FTP)
Remote login (Telnet)
File
Email
ervices in the Internet



Email - electronic mail can be sent to, or received by, anyone connected to the Internet. Images and
other "binary" objects can be sent as well as text.
Based on SMTP (Simple Mail Transfer Protocol). See RFC 821.
News - electronic discussion groups or bulletin boards. Users can write something on any topic and other
users can read it and respond to it. There are thousands of news groups and the number of them
increases daily.
Based on NNTP (Network News Transfer Protocol). See RFC 977.
World Wide Web - multimedia information service using text, pictures, video and sound. Easy-to-use
graphical user interface.
Based on HTTP (Hypertext Transport Protocol). See RFC 2068.
File transfer - used to exchange files (text, pictures, etc.) directly between two computers.
Based on FTP (File Transfer Protocol). See RFC 959.
Remote login - used to logon directly to the user interface of a remote system via the Internet. For
example, to run programs or edit files in the remote system.
Based on Telnet. See RFC 854.


(C) SAP AG BC440 3-11
SAP AG 1999
Software Software
Hardware Hardware
Internet Internet
IP Address
142.16.1.9
Mail server
WWW server
News server
Logical
TCP port
TCP Ports



Logical ports are used to provide different Internet services on the same computer.
All inbound data packets have the same destination IP address but the port number assigns them to the
correct (software) server.
The standard port numbers for Internet services are defined in RFC 1060.
21 - FTP (File Transfer Protocol)
23 - Telnet
25 - SMTP (Simple Mail Transfer Protocol)
80 - HTTP (Hypertext Transport Protocol)
119 -NNTP (Network News Transfer Protocol)


(C) SAP AG BC440 3-12
SAP AG 2001
Address data
Address data
Usage data
Usage data
TCP/IP - The Data Packet
Receiver
Sender
IP address TCP port
161.78.135.91
142.16.172.83
1031
80



Note: The above graphic has been simplified for this course. In reality, the header of a TCP/IP data
packet also contains many other fields.
A connection from one IP address/TCP port to another IP address/TCP port is also called a socket.


(C) SAP AG BC440 3-13
SAP AG 1999
Internet server
Sends data
Receives data
Web browser
Web browser
The Web Browser
Software used to access the Internet
Requests data from Internet servers (client/server structure)
Presents the information received (such as text, pictures and sound)
Sends data to Internet servers (such as mail and news)



A Web browser enables you to communicate with Internet servers that provide a range of services.
Web browsers should really be called Internet browsers because they do not merely communicate with
World Wide Web servers (HTTP servers). But as their main task is to communciate with WWW servers,
the term Web browser is generally accepted.
A browser must be able to:
Communicate with DNS servers
Generate TCP/IP packets
Receive TCP/IP packets
Present data received (text, images, sound, etc.)
Other desirable functions:
Buffer data already received locally
List connections recently


(C) SAP AG BC440 3-14
SAP AG 1999
URL Uniform Resource Locator
jects in the Internet
ain[:port]/pathname
http://www.xyz.com/information/list.html
ftp://ftp.abc.xyz.com/pub/programs/
URLs for mail and news
mailto:username@host
news:newsgroup
Access to different data ob
URLs for HTTP, FTP:
service://host.dom



URLs contain information that the Web browser requires to access a data object on the Internet:
Service - Name of the Internet service
host - name of the server that is to provide the service
port - port number if different from the standard (optional)
pathname - name of the object on the server
URLs for mail and news refer implicitly to the current mail or news server. For this reason you do not
have to enter the name of the server.



(C) SAP AG BC440 3-15
SAP AG 1999
Internet Technology
Internet Technology
World Wide Web
World Wide Web
Security in the Internet
Security in the Internet
Intranet
Intranet
Overview: World Wide Web




(C) SAP AG BC440 3-16
SAP AG 1999
W
One of the services on
the Internet

s text,
images, videos and
sound
Pages contain links
(hyperlinks) to other
objects
Uses graphical user
interfaces
Multimedia: use
hat is The World Wide Web?



The WWW was developed in 1989 at CERN (European Laboratory for Particle Physics) to enable
researchers to access documents worldwide (text, images, etc.).
Only the page setup of a document is described in the WWW and not its actual appearance. This
enables a page to be displayed on different hardware platforms.
Hyperlinks enable users to access information on globally distributed WWW servers.


(C) SAP AG BC440 3-17
SAP AG 1999
HTTP
server
HTTP request
HTTP response
HTTP client (browser)
HTTP client (browser)
HTTP Hypertext Transport Protocol
HTTP is the application protocol of the WWW service
Handles transmission between HTTP client and HTTP server
Based on TCP/IP
Is stateless
Defines methods to data objects



HTTP functions as a client/server application. After each request from a browser (client) to a server a
response ensues.
HTTP is stateless, after each request-response-cycle the server "forgets" the client. The next request
from the same client is handled as though it were the first request from this client.
HTTP 1.1 is defined in RFC 2068.


(C) SAP AG BC440 3-18
SAP AG 1999
H
D
a
t
a

p
a
c
...
e
k
e
t
method> <URL> <ver.>
<name1>:<value>
Message header:
GET
<
<name2>:<value>
Message body:
...
D
a
t
a

p
a
c
k
e
t
Message header:
<ver.> <status> <r
s
e eason>
...
<name1>:<value> Deletes data
Message body:
<one data object:
text, picture, sound...>
R
q
u
e
s
t
R
e
s
p
o
n
TTP Messages and Methods

Requests data object


POST
Processes data object
t
DELETE
object
HEAD
Requests message header without
message body

PUT
Sends data objec



Abbreviations on the above slide:
<Method> HTTP method
<URL> URL (Uniform Resource Locator) of the data object
<Ver.> Protocol version. For requests this specifies the latest version of the client used.
For responses, the version that the server used
<Status> Status after the request (see below)
<Reason> Reason phrase = reason for the status
Status categories (quoted from RFC 2068)
1xx - Informational: Request received, continuing process
2xx - Success: The action was successfully received, understood and accepted
3xx - Redirection: Further action must be taken in order to complete the request
4xx - Client error: The request contains bad syntax or cannot be responded to
5xx - Server error: The server failed to respond to a valid request
Examples of status 'reason phrase:
200 OK; 204 No content, 403 Forbidden; 505 HTTP Version not supported


(C) SAP AG BC440 3-19
SAP AG 1999
s67/bike.html
s67/ship.html
s67/car.html
S89
S67
s89/pc.html
s89/tv.html
s67/car.html
Cache A
Cache B
PC55
PC34
PC12
Principle: present
HTTP Server Cache Function



Each computer on the Internet that forwards HTTP requests can store them together with the responses
in a local cache. If the same request is received again the response can be taken directly from the cache.
Multi-level caching is possible and does not create problems.
See appendix for further information



(C) SAP AG BC440 3-20
SAP AG 1999
Principle: History
Internet Internet
B
History buffer
PC12
pc.html
tv.html
products.html
welcome.html
-
-
rowser History
Test if original changes
Always
Once per session
Never



Web browsers store data objects received for the first time on the local hard disk. If the user requests the
same object again, it is loaded from the hard drive, instead of sending a request to the Internet.
An HTTP cache functions in a completely different way. The cache always indicates the current status
on the server whereas the history buffer always indicates a past status that does not necessarily
correspond with the current status on the server.
You can configure what happens when data objects are fetched from the Internet. Three options are
usually available:
Always - The history buffer is not used at all
Once per session - An object is requested once from the Internet and then stored in the history buffer.
If it is requested a second time, it is taken directly from the history buffer.
Never - The history buffer is never deleted, not even when the browser is started again. All requests
are fetched from the history buffer provided that the data object has already been stored there.



(C) SAP AG BC440 3-21
SAP AG 1999
HTTP server
Request
Response
Request
HTTP client (browser)
Cookies - Memory for HTTP
HTTP cookie
Up to four Kbytes of data (not "executable")
Can be sent from a server with an HTTP response
Is sent automatically with the next request from the client back to the
same server



Characteristics of HTTP cookies:
Can by-pass HTTP statelessness
Can be up to four KBytes of data (ASCII or binary, but not 'executable').
Sent with an HTTP response from a server
A server can freely specify the contents of a cookie. For example, serial numbers for the status of a
transaction.
Cookies cannot be requested from a server. Only the browser can send a cookie together with a
request. This is done automatically for all requests to the server that received the cookie.
'Life span'
- Non-persistent - The browser keeps the cookie only in its memory. At the end of the browser
session the cookie is lost.
- Persistent - The browser stores the cookie on the local hard drive, so that it is available again in
the next browser session. The server assigns the cookie an expiration date after which the browser
does not send the cookie.
Browsers can be configured so that they ask the user whether cookies should be accepted. Name,
contents and expiration date are displayed.
For further information on the misuse of cookies see the appendix.

(C) SAP AG BC440 3-22
SAP AG 1999
Internet Technology
Internet Technology
World Wide Web
World Wide Web
Security in the Internet
Security in the Internet
Intranet
Intranet
Overview: Security in the Internet




(C) SAP AG BC440 3-23
SAP AG 1999
Access control
Network and file access authorization
Confidentiality
Data encryption
Authentication
Unique identification of network users
Integrity
Data cannot be corrupted during transfer
Proof of sender and receiver (non-repudiation)
Ascertains that a message exists
Security Aspects in the Internet



Security issues in 'everyday life':
Access control - Who is allowed to drive your car or live in your house?
Confidentiality - Do you use letters or postcards to send personal news?
Authentication - Are you sure who the sender is of an order that has just arrived in your company?
Integrity - Are you sure that no-one has added, changed or deleted an item in the order?
Sender and receiver proof - Do you want confirmation that an important message has arrived or is it
sufficient just to have sent it?



(C) SAP AG BC440 3-24
SAP AG 1999
Firewall Firewall
C
Network
193.78.135
Network
142.16
ontrolling Access Firewall
IP address
IP address



A firewall is a special router.
A firewall controls the data flow between two networks by checking the TCP/IP data packets:
IP filtering firewall:
- IP address and TCP port of the sender
- IP address and TCP port of the receiver
Application level firewall
- Service used
- Data division contents
After checking against negative and positive lists, the data packets are either forwarded or rejected.



(C) SAP AG BC440 3-25
SAP AG 1999
Symmetrical encryption
Characteristics : Confidentiality
One key for encryption and decryption and the key must
be sent via a secure connection
Fast algorithms
Example: DES (Data Encryption Standard) 56-bit key
Asymmetrical encryption
Characteristics : confidentiality, authentication and
integrity
Pair of keys: public key for decryption, private key for
encryption
Complex, slower algorithms
Example: RSA (after the inventors Rivest, Shamir and
Adleman)
Encryption Process



Symmetrical encryption:
Advantage:
- Fast algorithms
Disadvantages:
- The shared key must first be exchanged via a secure connection.
- Anyone who intercepts the key can corrupt the message data as well as read it. The message
receiver will not be aware of this.
Asymmetrical encryption:
Advantage:
- Messages can neither be read nor corrupted
Disadvantages:
- Complex algorithms
- Public keys of all the communication partners must be maintained
See appendix for further information

(C) SAP AG BC440 3-26
SAP AG 1999
SSL and HTTPS
ing characteristics:
mmetrical
encryption using certificates
Confidentiality
Symmetrical encryption after secure data exchange
Integrity
An integrity test is part of the protocol
HTTPS is HTTP on SSL
SSL (Secure Socket Layer) enhances TCP/IP
SSL has the follow
Authentication
Connection is structured with asy



SSL is a protocol from Netscape to enable secure communication on the Internet.
SSL is an additional layer between the application protocols (HTTP, SMTP, Telnet, FTP, and NNTP)
and the transmission protocol TCP/IP.
HTTPS is a variant of HTTP that uses SSL.
URLs for HTTPS connections begin with https://.
The standard port number for HTTPS is 443 instead of 80 for 'normal' HTTP.
Example of certification instances in the Internet: www.versign.com



(C) SAP AG BC440 3-27
SAP AG 1999
Internet Technology
Internet Technology
World Wide Web
World Wide Web
Security in the Internet
Security in the Internet
Intranet
Intranet
Overview: Intranet




(C) SAP AG BC440 3-28
SAP AG 1999
Internet Internet Intranet Intranet
Internet and Intranet
are linked
Global IP addresses
Internal network
in company
Local IP addresses
Network based
on TCP/IP
Network based
Many networks
on TCP/IP



Internet technology can link computers regardless of their hardware and software.
Within a company network, this technology can also be used to enable simple information exchange
despite heterogeneous hardware and software.
IP addresses within a company network can be freely allocated, provided that the computers are not to be
directly connected to the Internet.


(C) SAP AG BC440 3-29
SAP AG 1999
Firewall Firewall
Intranet server
Intranet
Internet Internet
Internet server
FW
TER TRA
PC12
PC55
Controlling Access to an Intranet



In the above example, a firewall (server FW) controls access to the Intranet.
Only TCP/IP data packets with the destination Internet server (TER) are routed to the Intranet. All other
accesses from the Internet are rejected.
The computers within the Intranet (PC12, PC55) can access the Intranet server (TRA) as well as the
Internet server (TER).
However, the internal computers cannot access the Internet for two reasons:
The internal IP addresses are not valid in the Internet
A data packet that returned from the Internet as the response to a request is blocked by the firewall.


(C) SAP AG BC440 3-30
SAP AG 1999
P
proxy 5139
t
data
data to the Interne
s89 80
s89
proxy
80
5139
data
data
pc12
s89
13
80
data
data
s89
pc12
80
13
data
data
from the Internet
5139 pc12 13
6074 pc55 21
7731 pc34 15
... ... ...
PC12
S89
PROXY PROXY
Internet Intranet
HTTP
cache
roxy - Connection to the Internet



A proxy is a special firewall with two functions:
It controls access from the Internet into the Intranet
It provides computers on an Intranet with access to the Internet
Internally assigned IP addresses are not valid on the Internet.
The proxy is the only computer whose IP address is known on the Internet.
The proxy maps internal IP addresses to TCP ports and vice versa.
Combination with an HTTP cache for access to the Internet is normal.


(C) SAP AG BC440 3-31
SAP AG 1999
Define the basic components of Internet
technology
List the differences between the Internet and
WWW
Comprehend what HTTP requests and HTTP
responses are
List security issues
You are now able to:
Internet, Intranet and WWW
Unit Summary




(C) SAP AG BC440 4-1
SAP AG 1999
HTML - Basics
Formatting with Cascading Style Sheets (CSS)
Images, hyperlinks, tables, and frames
Input using HTML forms
JavaScript
Contents:
HTML - Hypertext Markup Language




(C) SAP AG BC440 4-2
SAP AG 1999
Create HTML pages
Use Cascading Style Sheets
Create images, hyperlinks, and tables
Define HTML forms and pass form input to CGI
programs
Explain how JavaScript can be used in HTML
pages
At the conclusion of this unit, you will be able to:
HTML: Unit Objectives




(C) SAP AG BC440 4-3
SAP AG 1999
C
o
u
r
s
e
O
v
e
r
v
i
e
w
P
r
e
f
a
c
e
1
2
S
u
m
m
a
r
y

a
n
d

O
u
t
l
o
o
k
9
Overview Diagram HTML
Internet, Intranet and WWW
Internet
Transaction
Server
HTML
Web
Transaction
Web RFC
3
6 7
4
Administration 8
5




(C) SAP AG BC440 4-4
SAP AG 1999
HTML Basics
HTML Basics
Formatting with Cascading Style Sheets
Formatting with Cascading Style Sheets
Images, Hyperlinks, Tables, and Frames
Images, Hyperlinks, Tables, and Frames
Overview: HTML Basics
Input Using HTML Forms
Input Using HTML Forms
JavaScript
JavaScript




(C) SAP AG BC440 4-5
SAP AG 1999
HTTP client (Web browser) HTTP server
H
<head>
<title>title of page</title>
</head>
ze 2. </h2>
ze 3. </h3>
<img src="saplogo.gif" alt="Logo">
</body>
ents
om the server
ser)
TML Hypertext Markup Language
Graphical description language for WWW docum
The document description is:
Stored as a text file in the file system of the HTTP server
fr Sent as an HTTP response
Interpreted by the client (Web brow
<body>
<h1>header size 1. </h1>
Header size 2
<h2>header si
<h3>header si
Header size 3
Header size 1



HTML - Hypertext Markup Language
Describes the logical structure of a page, not the actual appearance of the page
Is platform-independent
Is an implementation of SGML (Standard Generalized Markup Language)
Has been used in the WWW since 1990
HTML is standardized by the World Wide Web Consortium (W3C) and the Internet Engineering
Task Force (IETF) (http://www.w3.org).
There are several versions (here the last two):
HTML 3.2 - W3C Recommendation (January 1997)
HTML 4.0 - W3C Recommendation (April 1998)
Developers of Web browsers have added their own enhancements
HTML pages:
Are simple text files
Can be stored, in a static state, in the file system on the WWW server or generated at runtime by CGI
programs
Can be written with simple text editors or with publishing tools

(C) SAP AG BC440 4-6
SAP AG 1999
HTML - Basic Structure
Basic structure
<html>
<head>
<title>Club Piranha Holidays</title>
</head>
<body>
<h1>Welcome to Club Piranha Holidays</h1>
We can offer you <!-- comments --> incredibly
<em>exciting</em>
holidays
...
...
</body>
</html>



HTML tags
Begin with < and end with >
Most tags consist of an opening part (<tag>) and a closing (</tag>) part. With many tags you can
omit the closing part.
Unknown tags and parameters are ignored by Web browsers.
Are case-insensitive
Many commands can contain parameters in the opening part:
Example: <span id="special">Special font</span>
Parameters are separated by a space
If parameter values contain a space they must be enclosed in " "
Formatting can only be done with HTML tags. Note:
More than one consecutive space will be reduced to one single space
Line breaks are ignored in the text file
Comments in HTML:
<!--This is a comment -->

(C) SAP AG BC440 4-7
SAP AG 1999
Head and Body
Body
<body>
...
</body>
Head
<head>
<title>Club Piranha Holidays</title>
<link rel="stylesheet" href="styles.css">
<meta name="..." content="..." http-equiv="...">
</head>



The <head> of an HTML page contains basic information about the page. They include:
<title> - Title of the page that appears in the title bar of the Web browser. This title is also used
for navigation in the history buffer and for saving URLs. If <title> is not specified the URL of the
page is used instead.
<meta> - HTTP-specific data that is part of the HTTP header. Web browsers interpret this
information as if it had been sent with the HTTP header
<base> - Base URL that all hyperlinks used on the page are based on.
<link> - Hyperlinks for the document, for example, to a style sheet (see later in this unit)
The <body> of an HTML page contains the actual contents of the page.
For further information see current documentation on: http://www.w3.org.

(C) SAP AG BC440 4-8
SAP AG 1999
HTML Basics
HTML Basics
Formatting with Cascading Style Sheets
Formatting with Cascading Style Sheets
Images, Hyperlinks, Tables, and Frames
Images, Hyperlinks, Tables, and Frames
Overview: Formatting Using CSS
Input Using HTML Forms
Input Using HTML Forms
JavaScript
JavaScript




(C) SAP AG BC440 4-9
SAP AG 1999
<h1>largest heading</h1>
Paragraph <p>This is the first paragraph
<p>This is the next paragraph
Highlighted <em>example</em>
Bold <b>Text</b>
Formatting Text
General area <span id=...>Two words</span>
(see CSS)



Note that if you use small numbers for <h1> to <h6> you choose large fonts, while if you use small
numbers for <font> you choose small fonts.
For further tags see current documentation on: http://www.w3.org.

(C) SAP AG BC440 4-10
SAP AG 1999
CSS Cascading Style Sheets
Defining styles centrally:
body { background-color: rgb(255,255,255);
font-family: Arial }
a:link { color: rgb(0,0,153) }
a:visited { color: rgb(153,0,0) }
a:active { color: rgb(0,0,255)
h1, h3, h5 { color: rgb(0,0,153)}
Using styles:
<head>
<link rel="stylesheet" href="styles.css">
<style> h3 { color: rgb(0,204,51) </ s t yl e>} </style>
...
</head>
References should always precede local definitions!



CSS (Cascading Style Sheet ) is a simple style sheet mechanism that allows authors and readers to
attach style (e.g. fonts, colors and spacing) to HTML documents.
The CSS1 language is human readable and writable. It expresses style in common desktop publishing
terminology.
One of the fundamental features of CSS is that style sheets cascade. Styles can be stored on the Web
server or defined in individual HTML pages. Users can also define their own personal style sheets to
adjust for human or technical restrictions. Usually local definitions overlay global definitions.
CSS, like HTML, is standardized by the World Wide Web Consortium (W3C)
(http://www.w3.org).

(C) SAP AG BC440 4-11
SAP AG 1999
Example
We can offer you an <em>unforgettable</em> holiday:
<p> - <b>sport:</b> Go jogging in the desert without water
<p> This week:
<font color="red">'Choose a candidate'</font>
How many paragraphs?
Which text is displayed in bold?
Which text is emphasized?




(C) SAP AG BC440 4-12
SAP AG 1999
Images on HTML Pages
Embedded in a page
<h2>Welcome ...</h2>
<img src="sap.gif"
alt="SAP Logo"
width=177
height=67>
As background (e.g. in <body>)
<style>
body {background-image:
url("sap.gif")}
</style>
Welcome to the Welcome to the
HTML chapter HTML chapter
Welcome to the Welcome to the
HTML chapter HTML chapter



Parameters of the <img> tag
src: URL of the image (see next page)
alt: Text is displayed while loading (see next page). This text is also displayed when the display of
pictures has been turned off in the Web browser or the specified URL does not jump to an image.
width and height
Width and height of image to be displayed
If you specify a different size to the original image, the Web browser will increase /decrease the image
size in proportion.
Even if an image is to be displayed in a smaller size, its full size has to be retrieved from the Internet.
If you specify only one of the two parameters, the Web browser calculates the size of the other
parameter, so that the width to height ratio is retained.
If the width and height are specified, the Web browser can still display the page while the image is
being loaded (see page after the next page).



(C) SAP AG BC440 4-13
SAP AG 1999
Error message
Contents of directory in an HTML page
Default page (e.g. home.html)
URL - Uniform Resource Locator

On the same HTTP server
welcome.bmp In the same directory
/abap/sap.gif Absolute path on server
../../design.jpg Relative to current file
Directory without specification of file name (only for hyperlinks)
folder/ Depends on server configuration:
General structure including the name of the server
http://www.xyz.com/information/info.gif




Most HTTP servers can configure a response to a request which only contains a directory name without
a file name in its URL. To do this you would choose one of the settings below:
Development: Display directory contents
Test: Display a default page or, if there is not one, display the directory contents
Productive Operation: Display a default page or, if there is not one, display an error message


(C) SAP AG BC440 4-14
SAP AG 1999
HTTP
server
h
t
t
p
:
/
/
p
c
8
9
/
i
n
f
o
.
h
t
m
l
image sap.gif
HTML page info.html
<h2>header size 2 </h2>
<h3>header size 3 </h3>
<img src="sap.gif"
alt="SAP Logo"
width=177
height=67>
Header size 2
Header size 3
SAP Logo
HTTP client
HTTP client
Header size 2
Header size 3
h
t
t
p
:
/
/
p
c
8
9
/
s
a
p
.
g
i
f
Images on HTML Pages - HTTP Procedure



Each HTTP request (GET or POST) can request only one object.
The Web browser automatically generates a new HTTP request for each image on an HTML page.
The Web browser can only display a formatted HTML page once the size of all the images are known.
If the width and height are specified in all the <img> tags, the Web browser does not have to wait
until it has loaded all the images.
The whole page is displayed while the images are still being loaded and are shown as true size
rectangles containing the text of the alt parameter.


(C) SAP AG BC440 4-15
SAP AG 1999
Hyperlinks References to Other Objects
es can be used
ses color to
highlight hyperlinks
'Visited' hyperlinks are
highlighted in a different
color
The target object does not
know there is a link to it
The hyperlink will not know
about any changes made to
the target object
Text or imag
as hyperlinks
The browser u



A hyperlink is "visited", when the target has been loaded at least once in the Web browser.
Even if the target changes, the hyperlink retains the same "visited" status
After a specific time (e.g. 30 days) the Web browser sets hyperlinks back to their original "unvisited"
status
This behavior is independent of the history and caching mechanisms




(C) SAP AG BC440 4-16
SAP AG 1999
Further <a href="info.html">information</a>
<a href="/home.html"><img src="sap.gif"></a>
Further Information Information on the
Internet Transaction
Server:
info.html
home.html
Welcome to the
HTML Unit
Hyperlinks in HTML



(HTML) text or an image can be placed between the opening <a> and the closing </a> tags. The Web
browser loads the target object when the text or image is clicked.
You can also use <a> to define hyperlink targets within a page.
Example:
Definition of target in page info.html:
<a name="se">Stefan Ehret</a> is an ABAP instructor.
Use in a hyperlink:
Read more about <a href="info.html#se">Stefan</a>.
You can also evaluate the coordinates of the mouse click in an image. Area coordinates and URLs have
to be assigned to the image. An <a> tag is not needed for this.
Example:

<map name="bc440map">
<area coords="1,1,10,20" href="info.html">
<area coords="12,21,40,40" href="home.html">
</map>

<img src="sap.gif" usemap="#bc440map">

(C) SAP AG BC440 4-17
SAP AG 1999
H
Further <a href="http://s67/info.html">information</a>
Information about the
Internet Transaction
Server:
S89
S67
PC12
http://s89/demo.html
demo.html
http://s67/info.html
info.html
yperlinks to Other Servers
Further information



The target of a hyperlink (here info.html on S67) does not know about the links to it from HTML pages
on other servers (here demo.html on S89).
At runtime, the Web browser may pass the URL of the page containing the hyperlink to info.html to
the server S67. If so, the string "referer: http://s89/demo.html" is sent in the header of
the HTTP request to S67.



(C) SAP AG BC440 4-18
SAP AG 1999
HTML Basics
HTML Basics
Formatting with Cascading Style Sheets
Formatting with Cascading Style Sheets
Images, Hyperlinks, Tables, and Frames
Images, Hyperlinks, Tables, and Frames
Overview: Input using HTML forms
Input Using HTML Forms
Input Using HTML Forms
JavaScript
JavaScript




(C) SAP AG BC440 4-19
SAP AG 1999
T
Table <table> ... </table>
r> ... </tr>
<td> ... </td>
<thead> ... </thead>
<tbody> ... </tbody>
<tfoot> ... </tfoot>
ables
<head> <style> table { border-style: solid } </style>
</head><body>
<table> <thead>
<tr><td>Destination</td><td colspan=2>Price</td></tr>
</thead> <tbody>
<tr><td>Paris </td><td>2500 DM</td><td>$1250</td></tr>
<tr><td>London </td><td>1840 DM</td><td>$ 920</td></tr>
</tbody> </table>
</body>
Row <t
Row
Header
Body
Footer



Tables are built row by row
Table rows are structured data cell by data cell.
Some CSS parameters for tables:
border-style
border-width
border-color
background-color
background-image



(C) SAP AG BC440 4-20
SAP AG 1999
<html> <head> ... </head>
<frameset cols="20%,80%">
<frame name="F1"
src="red.html">
<frame name="F2"
src="blue.html">
</frameset>
</html>
F1F2
Frames
Divide the browser window
into several windows
Several <frameset>s can
be nested in each other
Each <frameset> is
divided either by
columns: cols="c1,c2,..."
rows: rows="r1,r3,..."



Values for cols or rows parameters:
nnn Number of pixels
nnn% Percentage of area to be divided up
* Remaining area
1, 2* Divide proportionately (1/3 to 2/3)
Parameters of the <frame> tag:
noresize Size cannot be changed
scrolling yes, no, auto - display scroll bar
frameborder 1 or 0 - dividing line to neighbouring frame
Several frames can be nested in each other. Framesets can be nested either in the same file or in several
files. In the above example red.html and blue.html could contain their own <frameset> tags.



(C) SAP AG BC440 4-21
SAP AG 1999
<a href="green.html"
target="F2"> ... </a>
<a href="green.html"
target="_top"> ... </a>
<a
F
href="green.html"> ... </a>
F1 F2
F1 F2
F1 F2
rames and Hyperlinks
et of a hyperlink
be replaced
The targ
replaces the contents of
the frame
With target you can
specify which frame is to



If a target parameter is not specified, the frame containing the hyperlink is replaced with the target of
the hyperlink.
With the target parameter you can specify that a different frame is to be replaced. To do this, you
must indicate the name of the frame to be replaced. The name must correspond exactly to its definition
in the <frameset>.
Note: Upper/lower case is important here.
There are other special values for target
Note: Use lower case.
_self Same function as omitting the target parameter
_top Target replaces the whole frameset
_blank Opens a new browser window that displays the target
_parent The target replaces the file in which the frameset has been specified. The frame that
contains the hyperlink belongs to this frameset. This only works if the framesets are
specified in several files and not just in one single file.
The history mechanisms of the Web browser (back/forward buttons) can impede user navigation in
frames. For example, if you select "Back", you do not exit the frameset, but are simply taken to the
previous contents of the frame.

(C) SAP AG BC440 4-22
SAP AG 1999
B
r
o
w
s
e
r
HTTP HTTP
HTTP
server
CGI
program
CGI CGI
WWW server WWW server
CGI Common Gateway Interface
Interface between the HTTP server and:
an executable program or
a shell script
The CGI program generates:
an HTML page or
a MIME object (image, sound, ...)



CGI - Common Gateway Interface (current version 1.1) has been defined by NCSA (National Center
for Supercomputing, http://hoohoo.ncsa.uiuc.edu/cgi/).
Note: HTTP servers and CGI programs must run on the same server because the call parameters are
transmitted using environment variables.
The CGI program itself can call other programs (even if they are on other servers).
MIME - Multipurpose Internet Mail Extensions:
Standard for multi-part, multimedia E-mail messages and for HTTP objects
MIME enables non-text data such as images and sound to be sent on the Internet
Binary data is converted to ASCII code before it is sent. The receiver then converts it to its original
format
MIME is specified in RFC (Request for comment) 1341
Manufacturers of HTTP servers have developed their own protocols to create a more effective interface
between the server and the program called:
ISAPI - Internet Server API for Microsoft's Internet Information Server
NSAPI - Netscape Server API for Netscape's HTTP server
With Microsoft's Active Server Pages (ASP) you can store HTML pages with embedded tags (similar to
Visual Basic) in the server's file system. The tags are executed by the HTTP server at runtime and a
"real" HTML page is generated.

(C) SAP AG BC440 4-23
SAP AG 1999
CUSTOMER=Meyer&CARRID=LH&DURATION=12
Transfer the input (query string):
Input for CGI Programs - HTML Forms
put type=text name=CUSTOMER ... >
<input type=radio name=DURATION ... >
<input type=checkbox name=NONSTOP ... >
<input type=submit ... >
</form>
<form action="cgi-prg">
<in
<select name=CARRID>
<option value="LH"> Lufthansa </option>
...
</select>



HTML tags to format text can be used between <form> and </form>.
An HTML page may contain several forms that call either the same CGI program or different CGI
programs.
The action parameter specifies the CGI program that is to be called.
All data entered into input fields that have a name can be transmitted via the CGI program. The names
and values of the fields are transmitted in a character string (query string) to the called program.
If a character is to be used as part of the value that performs a special function in a URL or that is not
allowed, the browser sends this character in hexadecimal format. You can recognize those characters by
the % sign (for example, %20 instead of ' '),
Within frames, the parameter target can be used in the <form> tag.



(C) SAP AG BC440 4-24
SAP AG 1999
Text input
Button to send completed form
Hidden elements
Text field <input type=text name=CUSTOMER
maxlength=8 value="Meyer">
Password <input type=password name=PWD>
Hidden <input type=hidden name=ABC
value="12.45">
Button <input type=submit name=BUTTON1
value="send">
Forms - Elements (1)



The user can enter data directly into text input fields of type text.
size - Length of text displayed
maxlength - Maximum length of text. If maxlength is bigger than size, a scroll bar is
automatically added to the input field
value - Preassigned values
Input fields of type password behave the same as fields of type text, except that "*" is displayed
instead of the text actually keyed in. Note that the contents of password fields are not encrypted when
they are transmitted.
The Web browser does not display input fields of type hidden. They are not visible for the users.
In the case of hidden fields, the value assigned with value is transmitted together with the actual
user input to the CGI program called. Hidden input fields are used in forms created dynamically. For
further information refer to later sections in this unit.
A form can have several buttons of type submit.
All buttons call the same specified CGI program using <form action="...">.
The CGI program can evaluate name and value and respond appropriately to the button chosen.
The <input type=image> tag allows images to be used as buttons.
<input type=image name= srv=<URL of image> value=>

(C) SAP AG BC440 4-25
SAP AG 1999
F
<input type=radio name=DURATION value="04"> 4 hours
"
checked > other
<input type=radio name=DURATION value="12"> 12 hours
<input type=radio name=DURATION value="
<select name=CARRIER>
<option value="AA" > American Airl. </option>
<option value="LH" selected > Lufthansa </option>
<option value="UA" > United Airlines </option>
</select>
orms - Elements (2)
Selection list
Radio buttons (grouping by same name)



The radio buttons are grouped by name. All radio buttons of a form that have the same name constitute
one logical group. It does not matter where they are positioned in the source code.
By default radio buttons are usually unchecked (not selected). If a button is to be checked, the parameter
checked can be used in the relevant <input> tag.
By default the first option is usually checked in a selection list. If a different option should be checked,
the parameter selected can be used in the relevant <option> tag.


(C) SAP AG BC440 4-26
SAP AG 1999
Checkbox (basic form)
Checkbox (improved form)
Checked checkbox
<input type=checkbox name=NONSTOP value="X">
Direct flights only
<input type=hidden name=NONSTOP value=" ">
<input type=checkbox name=NONSTOP value="X">
Direct flights only
<input type=checkbox ... checked>
Forms - Elements (3)



A checkbox (name and value) is transferred to the CGI program called, only if it has been checked.
If the value in the checkbox has to be transferred each time, a hidden input element containing the
name of the checkbox must be used in the same form in front of the checkbox.
- The value of the hidden input element is always transferred.
- The value in the checkbox is also transferred if the checkbox has been checked.
- Query strings in the above form (examples):
checkbox not checked: ...&NONSTOP=+
checkbox checked: ...&NONSTOP=+&NONSTOP=X&...
By default checkboxes are not checked. If a checkbox should be checked, the parameter checked
should be used in the relevant <input> tag.



(C) SAP AG BC440 4-27
SAP AG 1999
GET
The data input is attached to the URL
http://host/cgi-prg?name1=value1&name2=value2
Default method, if method has not been specified
4 KByte is the maximum amount of data that can be transferred
POST
Eingaben werden in der HTTP-Request-Message transportiert
http://host/cgi-prg
The outcome of a POST request is not stored in a cache
<form action="cgi-prg" method=post> ... </form>
<form action="cgi-prg" method=get> ... </form>
Submitting the Data Input - HTTP Method



Hyperlinks always use the HTTP method GET


(C) SAP AG BC440 4-28
SAP AG 1999
Form 1 Form 1
Form 2 Form 2
Form 3 Form 3
CGI
program
s = 1
s = 2
Problem of Statelessness
HTTP is stateless but business
transactions need an internal
status
Solution
Invisible input element <input
type=hidden ... >
$PATH_INFO
cgi-prg/s1?name=value
Cookies



Form 1 is part of a static HTML page. Form 2 is part of an HTML page generated by the CGI program
after the data entered in Form 1 has been evaluated.
The page generated dynamically "hides" the status needed by the CGI program to continue processing
the transaction from the point at which it stopped.
Examples for Form 2
Hidden input:
<form action="cgi-prg"> <input type=hidden name=s value="1">...
Calls cgi-prg with input field s = 1.
$PATH_INFO: status direct in URL
<form action="cgi-prg/s1"> ... </form>
Calls cgi-prg with environment variable $PATH_INFO = /s1.
HTTP cookie: Up to 4 Kbytes of data are embedded in the HTTP response and are automatically sent
with the next HTTP request to the same server. In HTML:
<head> <meta http-equiv="Set-Cookie" content="s=1;"> </head>
<body> <form action="cgi-prg"> ... </form>
... </body>
Calls cgi-prg with environment variable $HTTP_COOKIE = s=1.


(C) SAP AG BC440 4-29
SAP AG 1999
Create HTML pages
Use Cascading Style Sheets
Create images, hyperlinks, and tables
Define HTML forms and pass form input to CGI
programs
Explain how JavaScript can be used in HTML
pages
You are now able to:
HTML: Unit Summary




(C) SAP AG BC440 4-30
HTML Exercises


Unit: HTML - Hypertext Markup Language:
Topic: HTML Basic Structure


At the conclusion of these exercises, you will be able to:
Create HTML pages
Use the commands <head>, <body> and <title>



nly use the HTML
commands for the basic structure of HTML pages.
1-1 Notepad:
1-1-1
at types of holidays you want to offer and
f
holiday destinations.
1-2
1-2-1 e page:
Your instructor will tell you the name of the Web server and the port number.

Create the home page for an online travel agency. O
Use Notepad to create the home page of your travel agency. Think of a name
for your travel agency. Consider wh
think of three holiday destinations.
Only use the HTML basic commands structure (<head>,</head>,
<body>, </body>) and <title>. This page should contain the name o
your travel agency, a short description and the three
Save the file in the file system of the Web servers:
-Server>\HTML\Group##\home.html. \\<Web
Web Browser:
Enter the following URL to display th
http://<Web-Server:Port>
/BC440/Unit04/Exercises/Group##/home.html

(C) SAP AG BC440 4-31
Exercises



Unit: HTML - Hypertext Markup Language:
Topic: Formatting Text


At the conclusion of these exercises, you will be able to:
Format and highlight text on an HTML page



rver.
-2 Web Browser:
2-2-1 Reopen your page again in the Web browser to look at your formatting. You
can simply select Refresh.

Use the HTML commands to format the contents of your home page.
2-1 Notepad:
2-1-1 Use the HTML commands to format the contents of your home page.
Save the file on the Web se
2

(C) SAP AG BC440 4-32
Exercises



Unit: HTML - Hypertext Markup Language:
Topic: Images and Hyperlinks


At the conclusion of these exercises, you will be able to:
Use images on HTML pages
Create hyperlinks between HTML pages



th images.
Create a hyperlink from your home page to the new pages.
3-1 Web Browser:
3-1-1
k through the subdirectories and display some of the pictures.
3-2
3-2-1
ion of
3-2-2 a picture of the destination. Save the file in
\\<Web-Server>\HTML\Group##\dest1.html
3-3 Web Browser:
3-3-1 e page:
/BC440/Unit04/Exercises/Group##/dest1.html
3-4 Notepad:
Create new HTML pages describing various destinations wi
Enter the following URL:
http://<Web-Server:Port>/BC440/images.
Clic
Notepad:
Create a new HTML page. This page should contain the name of one of your
holiday destinations on your home page. Briefly describe the main attract
this destination. Use <head>, <body> and text formatting commands.
Use the <img> command to display
the file system of the Web servers:
.
Enter the following URL to display th
http://<Web-Server:Port>

(C) SAP AG BC440 4-33
3-4-1 Repeat steps 3-2-1 to 3-3-1 two more times so that you have described three
different travel destinations on the HTML pages dest1.html, dest2.html
and dest3.html.
3-4-2 Open your home page again
\\<Web-Server>\HTML\Group##\home.html.
Search the list of the holiday destinations you created in the steps 3-2-1 to 3-4-
1. Use the HTML command <a>, to create the entries in the list as hyperlinks.
Save the file.
3-5 Web Browser:
3-5-1 Reload your homepage from the Web server and click on the hyperlinks you
have just created. You should see the description and picture of the travel
destination.


(C) SAP AG BC440 4-34
Exercises



Unit: HTML - Hypertext Markup Language:
Topic: Tables


At the conclusion of these exercises, you will be able to:
Create HTML tables



4-1 Notepa
4-1-1 reate a new HTML page containing a table. The table should enable
ustomers to display the homepage of other travel agencies (partner travel
agencies) simply by clicking on the mouse.
Create a table. Each row should contain three group numbers (see below).


Create a new HTML page with a table containing hyperlinks to other
groups.
d:
C
c
01 02 03
04 05 06
... ... ...
The group numbers should be able to be used as hy
homepages of the travel agencies. You can use the following U
perlinks to switch to the
RL for the
(XX = No. of exercise group):
href= GroupXX/home.html"
rver:
rtners.html.
hyperlink
"../
Save the file in the file system of the Web se
\\<Web-Server>\HTML\Group##\pa

(C) SAP AG BC440 4-35
4-2 Web B
4-2-1 Enter the following URL to display the page:
http://<Web-Server:Port>
/BC440/Unit03/Exercises/Group##/partners.html
Test the hyperlinks to the partner travel agencies.

rowser:

(C) SAP AG BC440 4-36
Exercises



Unit: HTML - Hypertext Markup Language:
Topic: HTML Frames


At the conclusion of these exercises, you will be able to:
Define HTML framesets
Use the target parameter in HTML hyperlinks



Use the HTML frames to link all the pages you have created so far.
5-1 Notepad:
5-1-1 ontaining a frameset that divides the Web browser
indow as shown below:

tml
Create a new HTML page c
w
BANNER
banner.h
RIGHT1
dest1.html
LEFT
home.html
partners.html
RIGHT2
The names you should use in your frameset are shown in the frames. The page
to be displayed in each frame is shown in italics.
5-1-2
rver>\HTML\Group##\frames.html
5-2
5-2-1 e frameset:
Save the file in the file system of the Web servers:
\\<Web-Se
Web Browser:
Enter the following URL to display th
http://<Web-Server:Port>

(C) SAP AG BC440 4-37
/BC440/Unit04/Exercises/Group##/frames.html
In the frame BANNER you should see a
banner.html does not (yet) exist.
In the other three frames you should see the pages you created in the prev
exercises. If error messages are displayed instead, cor
n error message because the page
ious
rect your frameset
(frames.html) before you start the next exercise.
5-3 Notepad:
5-3-1 f your
atting commands.
\\<Web-Server>\HTML\Group##\banner.html.
5-4 Web Browser:
5-4-1 r message
el
destination description now replaces the contents of the frame LEFT.
5-5 Notepad:
5-5-1
s so that a
e LEFT changes the contents of the frame RIGHT1.
Save the page.
5-6 Web Browser:
5-6-1
ion of the travel destinations should replace the contents of the RIGHT1
ges of the other travel agencies now replace the
contents of the frame RIGHT2.
5-7 Notepad:
5-7-1
splay the frameset of the other groups. Tip:
Create a new HTML page for the frame BANNER containing the name o
travel agency. Use <head>, <body> and text form
Save the file in the file system of the Web servers:
Reload the page in the frame BANNER from the Web server. The erro
should be replaced with the contents of your page banner.html.
Click on the hyperlinks on your page home.html in the frame LEFT. The trav
Open your home page
\\<Web-Server>\HTML\Group##\home.html
Add the parameter target to the hyperlinks to the travel destination
click in the fram
Reload your home page Homepage (home.html in frame LEFT from the Web
server. Click again on the hyperlinks of your homepage in the LEFT frame. The
descript
frame.
Now click on the hyperlinks in the frame RIGHT2 on your page
partners.html. The homepa
Reload your page with the table
\\<Web-Server>\HTML\Group##\partners.html.
First change all the hyperlinks from ../GroupXX/home.html to
../GroupXX/frames.html to di

(C) SAP AG BC440 4-38
Use the replace function in Notepad.
Add the parameter target to all the hyperlinks so that if you click in the frame
RIGHT2, your f
on is displayed.
rameset disappears and the frameset of the travel agency clicked

Save the page.
5-8 Web Browser:
5-8-1
. The
frameset of another travel agency should be displayed in full size.

Reload the page with the table (partners.html in frame RIGHT2) from the
Web server. Click again on the hyperlinks in the table in the frame RIGHT2

(C) SAP AG BC440 4-39
Exercises



Unit: HTML - Hypertext Markup Language:
Topic: Data Input (HTML Forms)


At the conclusion of these exercises, you will be able to:
Create forms with HTML



Create a form for the first step in booking a flight.
6-1 Notepad:
6-1-1 Create a new HTML page containing a form. The following data is required by the
system. (You will create the booking system in a later Unit.)
Destination
Restricted
Flight restr
tion
.
online booking
City and country of departure
city and country
to one carrier
ictions - afternoons only
Use two invisible fields to transfer the departure country (DE) and destina
country (US) to the booking system.
Use a <select> command for the city and country of departure.
Use radio buttons to select a preferred carrier.
Use a check box to restrict flights to afternoons only
Create an HTML button to send the completed form.

(C) SAP AG BC440 4-40
Use the following CGI program as the value for the action parameter:
"/scripts/form-echo.asp".
ntains the names and contents of the
ser:
to display the form:
6-3-1
l with the parameter target="_top". Save the
ser:
l) from the Web server. Reload your home
server. Click on the
6-5 Notepa
6-5-1 he page containing the form
er>\HTML\Group##\flights.html.
Until now you could freely choose the names in your form. Change the value of the
parameter from /scripts/form-echo.asp to
/scripts/online-booking.asp.
ser:
not be able to see all the values so
g.asp.
This program generates an HTML page that co
input elements from your form.
Save the file in the file system of the Web servers:
\\<Web-Server>\HTML\Group##\flights.html.
6-2 Web Brow
6-2-1 Enter the following URL
http://<Web-Server:Port>
/BC440/Unit04/Exercises/Group##/flights.html
Send the form of several times. Enter different details in each form you send.
6-3 Notepad:
Reload your homepage
\\<Web-Server>\HTML\Group##\home.html.
Add a hyperlink to flights.htm
page.
6-4 Web Brow
6-4-1 Reload your frameset (frames.htm
page Homepage (home.html in frame LEFT from the Web
new hyperlink of your homepage in the frame LEFT to display the input form you
have just created.
Submit the completed form.
d:
Reload t
\\<Web-Serv
action
online-booking.asp is a simple program to display the values you have
entered in your form. This program requires that the input elements have special
names.
Save the page.
6-6 Web Brow
6-6-1 Reload the page containing the form (flights.html) from the Web server.
Submit the completed form. You probably will
that the names in your form are not those required by online-bookin

(C) SAP AG BC440 4-41
6-7 Notepad:
6-7-1 Enter names in your form so that online-booking.asp displays all the values
you enter in your form.
Test the parameter method (get or post).
Repeat steps 6-6-1 and 6-7-1 until your form matches the CGI program.




(C) SAP AG BC440 4-42
HTML Solutions


Unit: HTML - Hypertext Markup Language
Topic: HTML Basic Structure

Creating HTML pages
Using the commands <head>, <body> and <title>

Create the homepage for an online travel agency. U

e.html:
se only the HTML
commands for the basic structure of HTML pages.
Solution Exercise 1 </title>
lcome to Real Weird Vacations.
language training: a trip to inner China with an Italian dictionary
is week's special: 'Flip the coin'
file hom
tml> <h

<head>
<title>
head> </

<body>
We

We offer travels you'll never forget:
- sports: desert jogging without water supply
- arts: under water painting in three different oceans
-

Th

body> </

</html>

(C) SAP AG BC440 4-43
Solutions


Unit: HTML - Hypertext Markup Language
Topic: Formatting Texts

Formatting and highlighting text in an HTML page


Use HTML commands to format the contents of your homepage.
file home.html (changes in bold):
head>
/head>
arkred"> <font face="Arial">
p> - <b>arts:</b> under water painting in three different oceans
ith an Italian dictionary
week's special: <font color="red">'Flip the coin'</font>
the coin' is a weird bus trip through Europe.
</font>
</body>
</html>
<html>

<
<title>Solution Exercise 2</title>
<

<body bgcolor=white link="darkblue" vlink="d

<h1>Welcome to Real Weird Vacations.</h1>
We offer travels you'll <em>never</em> forget:
<p> - <b>sports:</b> desert jogging without water supply
<
<p> - <b>language training:</b> a trip to inner China w
<p> This

<p> 'Flip


(C) SAP AG BC440 4-44
Solutions


Unit: HTML - Hypertext Markup Language
Topic: Images and Hyperlinks

Using images in HTML pages
Creating hyperlinks between HTML pages

Create new HTML pages that describe with pictures the various travel
estinations. Link your homepage to the new pages using hyperlinks.

html> <head> <title>Solution Exercise 3</title> </head>
rkred"> <font face="Arial">
an dictionary
p>This week's special: <font color="red">'Flip the coin'</font>
h2>Have a look at the following destinations </h2>
p> <a href="dest4.html">Greenland</a>
/font> </body> </html>
d

(changes in file home.html bold):
<

<body bgcolor=white link="darkblue" vlink="da
<h1>Welcome to Real Weird Vacations.</h1>
We offer travels you'll <em>never</em> forget:
<p> - <b>sports:</b> desert jogging without water supply
<p> - <b>arts:</b> under water painting in three different oceans
<p> - <b>language training:</b> a trip to inner China with an Itali
<

<

<p> <a href="dest1.html">Egypt</a>
<p> <a href="dest2.html">Berlin</a>
<p> <a href="dest3.html">New York</a>
<

<




(C) SAP AG BC440 4-45

file dest1.html (dest2.html and dest3.html):
html>
head> <title>Egypt</title> </head>
body bgcolor=white link="darkblue" vlink="darkred"> <font face="Arial">
h1>Egypt</h1>
of the Pyramids.
p>
mg src="/BC440/Images/Travel/Africa/Egypt/Giza.gif">
/font> </body>
</html>
<

<

<

<

Land
<

<i

<


(C) SAP AG BC440 4-46
Solutions


Unit: HTML - Hypertext Markup Language
Topic: Tables

Creating HTML tables

Create a new HTML page with a table containing hyperlinks to your
partner travel agency.

file partners.html:
<html> <head> <title>Partners of Real Wired Vacations </title> </head>
link="darkblue" vlink="darkred"> <font face="Arial">
r> <th>Group</th> <th> &nbsp; </th>
href="home.html">00</a> </th> <td> home.html </td>
><th> <a href="..\..\Exercises\Group01\home.html">01</a> </th> <td> home.html </td>
href="..\..\Exercises\Group08\home.html">08</a> </th> <td> home.html </td>
ercises\Group15\home.html">15</a> </th> <td> home.html </td>

</table>
</font></body> </html>
<body bgcolor=white
<h2>Our partners</h2>

<table border=1>
<t
<th>Group</th> <th> &nbsp; </th>
<th>Group</th> <th> &nbsp; </th>

<tr><th> <a
<th> <a href="..\..\Exercises\Group07\home.html">07</a> </th> <td> home.html </td>
<th> <a href="..\..\Exercises\Group14\home.html">14</a> </th> <td> home.html </td>

<tr
<th> <a
<th> <a href="..\..\Ex

(C) SAP AG BC440 4-47
Solutions


Unit: HTML - Hypertext Markup Language
Topic: HTML Frames

Defining HTML framesets
Using the target parameter in HTML hyperlinks


:
Use HTML frames to link all the pages you have created up to now.
html> <head> <title>Solution Exercise 5</title> </head>
<fra
src="banner.html" noresize>
<fra
home.html">
<fra
ame="RIGHT2" src="partners.html">
/frameset>
/html>

eal Weird Vacations</h1> </center>
body>
/html>
file frames.html
<

meset rows="70,*">
<frame name="BANNER"
meset cols="50%,*">
<frame name="LEFT" src="
meset rows="50%,*">
<frame name="RIGHT1" src="dest1.html">
<frame n
</frameset>
</frameset>
<

<

nner.html: file ba
<html>
<body bgcolor=white><font face="arial" color="blue">
<center> <h1>R
</font></
<

(C) SAP AG BC440 4-48

file home.html (changes in bold):
<html> <head> <title>Solution Exercise 3</title> </head>
rkred"> <font face="Arial">
an dictionary
p>This week's special: <font color="red">'Flip the coin'</font>
h2>Have a look at the following destinations </h2>
p> <a href="dest4.html" target="RIGHT1">Greenland</a>
/font> </body> </html>
="darkblue" vlink="darkred"> <font face="Arial">
/h2>
href="..\..\Exercises\Group14\home.html" target="_top">14</a> </th> <td> home.html </td>
</font></body> </html>

<body bgcolor=white link="darkblue" vlink="da
<h1>Welcome to Real Weird Vacations.</h1>
We offer travels you'll <em>never</em> forget:
<p> - <b>sports:</b> desert jogging without water supply
<p> - <b>arts:</b> under water painting in three different oceans
<p> - <b>language training:</b> a trip to inner China with an Itali
<

<

<p> <a href="dest1.html" target="RIGHT1">Egypt</a>
<p> <a href="dest2.html" target="RIGHT1">Berlin</a>
<p> <a href="dest3.html" target="RIGHT1">New York</a>
<

<

file partners.html (changes in bold):
<html> <head> <title>Partners of Real Wired Vacations </title> </head>
<body bgcolor=white link
<h2>Our partners<
<table border=1>
<tr> <th>Group</th> <th> &nbsp; </th>
<th>Group</th> <th> &nbsp; </th>
<th>Group</th> <th> &nbsp; </th>
<tr><th> <a href="home.html" target="_top">00</a> </th> <td> home.html </td>
<th> <a href="..\..\Exercises\Group07\home.html" target="_top">07</a> </th> <td> home.html </td>
<th> <a
</table>

(C) SAP AG BC440 4-49
Solutions


Unit: HTML - Hypertext Markup Language
Topic: Data Input (HTML Forms)

Creating forms with HTML


Create a form for the first step in booking a flight.
file flights.html:
<html> <head> <title>Online booking system (solution 6)</title> </head>
body bgcolor=white><font face="arial">
>
h3>Select your flight from Germany to USA</h3>
>
pe=hidden name=COUNTRYFR value="DE">
en name=COUNTRYTO value="US">
LIN " > Berlin
<option value="FRANKFURT " selected > Frankfurt
<option value="MUNICH " > Munich
</select>

<
<h1><font color="blue">Online Booking System</font></h1
<

<form action="/scripts/online-booking.asp" method="post"

<input ty
<input type=hidd

<table>
<tr> <td> From
<td> <select name="CITYFROM">
<option value="BER







(C) SAP AG BC440 4-50

<tr> <td> To
<td> <select name="CITYTO">
<option value="CHICAGO " > Chicago
ption value="NEW YORK " selected > New York
<option value="SAN FRANCISCO " > San Francisco
irlines
<input type="radio" name="CARRID" value="LH" checked> Lufthansa
<td> <input type="radio" name="CARRID" value="UA" > United Airlines
ue=" " > no preference
pe="checkbox" name="MARK" value="X"> depart in the afternoon only
p>
mit" name="DISP" value="Display form data">
</font> </body>
</html>

<o

</select>
</table>

<table border=1 rules=none>
<tr> <th> Airline
<tr> <td> <input type="radio" name="CARRID" value="AA" > American A
<tr> <td>
<tr>
<tr> <td> <input type="radio" name="CARRID" val
</table>
<p>
<input type="hidden" name="MARK" value=" ">
<input ty
<
<input type="sub
</form>


(C) SAP AG BC440 5-1
SAP AG 2001
Architecture
Service files
Internet users for Web transactions
ITS context and HTML
Business
templates
Contents:
Internet Transaction Server




(C) SAP AG BC440 5-2
SAP AG 1999
List the components that the ITS consists of
Explain what an ITS service is
Describe the most important parameters that are
used in service files
Explain what explicit and implicit logon means
Explain the concept of Internet users
and create Internet users
Describe how the ITS generates HTML pages
At the conclusion of this unit, you will be able to:
Internet Transaction Server: Unit Objectives




(C) SAP AG BC440 5-3
SAP AG 1999
C
o
u
r
s
e
O
v
e
r
v
i
e
w
P
r
e
f
a
c
e
1
2
S
u
m
m
a
r
y

a
n
d

O
u
t
l
o
o
k
9
Overview Diagram
Internet Transaction Server
Internet, Intranet and WWW
Internet
Transaction
Server
HTML
Web
Transaction
WebRFC
3
6 7
4
Administration 8
5




(C) SAP AG BC440 5-4
SAP AG 1999
Architecture
Architecture
Service Files
Service Files
Internet Users for Web Transactions
Internet Users for Web Transactions
Overview: Architecture
ITS Context and HTML
Business
Templates
ITS Context and HTML
Business
Templates




(C) SAP AG BC440 5-5
SAP AG 1999
R/3 R/3
Application Application
Server Server
R/3 R/3
Database Database
Server Server
Internet Internet
Transaction Transaction
Server Server
HTTP HTTP
Server Server
Web Web
Browser Browser
Request
Response
Five-Tier Client/Server Architecture



The Internet Transaction Server connects the three-tier R/3 client/server architecture with the two-tier
HTTP client/server architecture.
For the R/3 System, the ITS and HTTP server form an intermediate layer between the application layer
and the presentation layer.
For the Internet user, the ITS provides interactive HTML pages (generated at runtime).


(C) SAP AG BC440 5-6
SAP AG 1999
Internet Internet
Transaction Transaction
server server
HTTP HTTP R/3 R/3
Internet Transaction Server
Communication with
the HTTP server
the R/3 application
server
User administration for R/3
logon
Conversion of data on R/3
screens into HTML pages
Status management
Synchronization of R/3



The Internet Transaction Server (ITS) links one or more HTTP servers with one or more R/3 Systems.
Internet and Intranet users can run Web-enabled transactions, Web-enabled function modules, or any
ABAP reports in R/3 using the ITS.


(C) SAP AG BC440 5-7
SAP AG 1999
ITS ITS
CGI
ISAPI
NSAPI
TCP/IP TCP/IP
W
G
a
t
e
A
G
a
t
e
DIAG
RFC
ITS Software Components



The ITS consists of the WGate (W = Web) and the AGate (A = application). The WGate communicates
with the HTTP server, and the AGate communicates with the R/3 application servers.
Connecting to the HTTP server:
- CGI - Common Gateway Interface: General interface for communication between the HTTP
server and the executable program on the same computer
- ISAPI - Internet Server API: Interface developed specifically for Microsoft's Internet Information
Server for DLLs on the same computer (DLL = dynamic link library)
- NSAPI - Netscape Server API: Interface developed specifically for Netscape's Enterprise Server
for DLLs on the same computer.
Connecting WGate and AGate:
- TCP/IP, or more precisely: HTTP - Hypertext Transport Protocol: Note: HTTP is used here
only for internal communication. The Web browser cannot connect directly to the AGate
Connecting to R/3:
- DIAG - Dynamic Information and Action Gateway (= SAP GUI protocol): To call R/3
transactions. The R/3 System cannot distinguish between a "normal" SAP GUI user and the ITS.
An R/3 application can however make this distinction by calling the function module ITS_PING.
- RFC - Remote Function Call: To call R/3 function modules



(C) SAP AG BC440 5-8
SAP AG 1999
S
HTTP HTTP
server server
R/3 R/3
application application
server server
ITS ITS
W
G
a
t
e
a
t
e
TCP/IP TCP/IP
Windows NT
Server 4.0 (Intel)
CGI CGI
DIAG DIAG
A
G
RFC RFC
ingle Host Installation



From now on, the connection between the HTTP server and WGate will be referred to as the CGI. The
interfaces ISAPI and NSAPI can be used instead, but they have been omitted for reasons of clarity.
To install the ITS, there are two technical points to note:
- CGI, ISAPI and NSAPI require that the WGate is installed on the same computer as the HTTP
server
- The AGate is only available for Windows NT Server 4.0 (Intel)
Windows NT Server 4.0 (Intel), the HTTP server and the ITS can be installed only on one computer.
HTTP server software supported is Microsoft Internet Information Server and Netscape Enterprise
Server.
This installation is suitable for test installations or for installations where security is not so important,
because only a few security precautions can be taken with this installation.


(C) SAP AG BC440 5-9
SAP AG 1999
HTTP HTTP
server server
R/3 R/3
application application
server server
ITS ITS
W
G
a
t
e
A
G
a
t
e
Windows NT
Server 4.0 (Intel)
Windows NT
Server 4.0 (Intel)
or
Unix hardware
CGI CGI
RFC RFC
DIAG DIAG
TCP/IP TCP/IP
Dual Host Installation



If the WGate and the AGate are to be installed on two different computers, note the following
requirements:
- The AGate requires a Windows NT 4.0 Server (Intel)
- The WGate must be installed on the same computer as the HTTP server. UNIX operating systems
can also be used instead of Windows NT 4.0 (all SAP-supported derivatives).


(C) SAP AG BC440 5-10
SAP AG 1999
ITS ITS
DEV DEV
W
G
a
t
e
HTTP HTTP
server server
CGI CGI
ITS ITS
QAS QAS
W
G
a
t
e
HTTP HTTP
server server
CGI CGI
A
G
a
t
e
A
G
a
t
e
TCP/IP TCP/IP
TCP/IP TCP/IP
Virtual ITS (1)
R/3 R/3
DEV DEV
RFC RFC
DIAG DIAG
R/3 R/3
QAS QAS
RFC RFC
DIAG DIAG



To minimize hardware requirements and response times, several virtual ITS servers can operate
independently from each other on one Windows NT 4.0 server.
Several (virtual) ITS instances may be required to separate test systems from development systems, for
example.


(C) SAP AG BC440 5-11
SAP AG 1999
ITS ITS
DEV DEV
W
G
a
t
e
HTTP HTTP
server server
CGI CGI
ITS ITS
QAS QAS
W
G
a
t
e
HTTP HTTP
server server
CGI CGI
A
G
a
t
e
A
G
a
t
e
TCP/IP TCP/IP
TCP/IP TCP/IP
Virtual ITS (2)
R/3 R/3
DEV DEV
RFC RFC
DIAG DIAG
R/3 R/3
QAS QAS
RFC RFC
DIAG DIAG



If more than one virtual HTTP server is used, several complete ITS servers (WGate and AGate) can be
operated independently from each other on one computer.
This installation allows test and quality assurance systems to be installed on the same NT computer. For
security reasons, the production system should be separated from these two systems and be installed on a
different NT computer.



(C) SAP AG BC440 5-12
SAP AG 1999
Architecture
Architecture
Service Files
Service Files
Internet Users for Web Transactions
Internet Users for Web Transactions
Overview: Service Files
ITS Context and HTML
Business
Templates
ITS Context and HTML
Business
Templates




(C) SAP AG BC440 5-13
SAP AG 2001
ITS ITS
W
G
a
t
e
Web Web
browser browser
HTTP HTTP
server server
HTTP HTTP CGI CGI
http://<server>/<path>/wgate/<service>/!
Examples:
http://pc12/scripts/wgate/abcd/!
http://ux17/cgi-bin/wgate/test/!
Starting an ITS Service



The service name is a symbolic name with a maximum length of 14 characters. If customers want to
create their own service, the name should begin with Z.
The specific syntax to start a service is dependent on the file system and the configuration of the HTTP
server.
Alternatively to the URL above, the following syntax can also be used:
http://<server>/<path>/wgate?~service=<service>


(C) SAP AG BC440 5-14
SAP AG 2001
R/3 R/3
application application
server server ITS ITS
W
G
C
a
t
e
t
e
Web Web
browser browser
HTTP HTTP
server server
HTTP HTTP CGI CGI
A
G
a
TCP/IP TCP/IP
RFC RFC
DI DIAG AG
HTML
Business
templates
MIME
objects
Service
files
omponents of an ITS Service
http://pc12/scripts/wgate/abcd/!



A service the Internet Transaction Server provides for Internet users consists of:
- Administering logon information to the R/3 System (name of system, user details)
- Running a transaction in R/3 or calling a function module or report
- Converting R/3 data (screens or lists) to HTML pages
When a service is started, a SAP GUI or RFC session is internally started:
- The ITS assigns the HTTP requests for a service to the correct session
- A user context corresponds to each session in the R/3 System
- A session ends when the service ends (by logoff or timeout in ITS)


(C) SAP AG BC440 5-15
SAP AG 2001
SAP@Web SAP@Web
Studio Studio
SAP@Web Studio
Working methods are project-
oriented
Used for creating, managing,
maintaining and publishing:
Projects
Service files
HTML
Business
templates
Language dependencies
(text files)
MIME objects
(administration and display
functions only )
ITS flow files



In the SAP@Web Studio, all the components of EasyWebTransactions and scenarios required outside
the R/3 System can be maintained using ITS flow logic. They include:
- Service files
- HTML
Business
templates
- MIME objects (such as images, sound, video)
- Files with language-dependent placeholders
- ITS flow files
The SAP@Web Studio is a component of the ITS installation.

(C) SAP AG BC440 5-16
SAP AG 2001
Publish with the SAP@Web Studio
Start service
ITS ITS
A
G
a
t
e
R/3 R/3
Web Web
browser browser
HTTP HTTP
W
G
a
t
e
SAP@Web SAP@Web
Studio Studio
MIMEs Services Templates Texts Flow files
<b>`i`</b>
`itab[i]`
abcd.srvc
test.srvc
start
list
Seats
seats
Project ITSxxx_Demo
Web Studio publish



MIME objects are copied by "Publish" into the file system of the WGate (the HTTP server).


(C) SAP AG BC440 5-17
SAP AG 2001
Web Web
browser browser HTTP HTTP
W
G
a
t
e
ITS ITS
A
G
a
t
e
5
2 3
1
W
G
a
t
e
W
G
a
t
e
A
G
a
t
e
A
G
a
t
e
4 4
Site Definition Wizard
Site Definition Wizard
O Symbolic name for the site
O Name of server on which WGate is running
O Name of server on which AGate is running
O Name of virtual ITS
O URL for HTTP server with port (to start service)




(C) SAP AG BC440 5-18
SAP AG 1999
MIME
Project BC440_Demo
Services Templates Texts
SAP@Web SAP@Web
Studio Studio
Web Web
Browser Browser
Start service
HTTP HTTP
W
G
a
t
e
ITS ITS
A
G
a
t
e
R/3 R/3
Import Service from ITS into Project
<b>`i`</b>
`itab[i]`
abcd.srvc
test.srvc
seats
seats
Publish / import from site




(C) SAP AG BC440 5-19
SAP AG 1999
Global.srvc
~systemName XYP
~login Meier
~password ***
~client 400
~language DE
...
test.srvc
~initialTemplate start
~theme 99
abcd.srvc
~transaction ABCD
its050.srvc
~transaction ABCD
zits050_00.srvc
~transaction Z234
~login
~language
Service Files



Service files are text files that are stored in the AGate file system. They contain the settings that the ITS
requires to connect to the R/3 System to start a transaction or a WebRFC-enabled function module.
The structure of service files is as follows: Each line contains a parameter name with a value separated
by at least one space or TAB. These files can be edited with any text editor. The SAP@Web Studio and
the Web Application Builder provide table-type maintenance for this.
The file Global.srvc is a special service file. It contains global settings - all those common to all
individual services. When a <service> is started, the file Global.srvc is always imported first and
then the file <service>.srvc. The values from <service>.srvc are added to or override the
values from Global.srvc.

(C) SAP AG BC440 5-20
SAP AG 1999
Selection of R/3 System
Selection of R/3 System
Logon to the R/3 System
(implicit/explicit)
Logon to the R/3 System
(implicit/explicit)
EasyWebTransaction, ITS Flow Logic,
WebRFC or ITS Administration Tool
EasyWebTransaction, ITS Flow Logic,
WebRFC or ITS Administration Tool
ITS-Specific Parameters
ITS-Specific Parameters
Parameters in Service Files




(C) SAP AG BC440 5-21
SAP AG 2001
ITS ITS
AGate
s01 (MS) s01 (MS)
DB DB
R/3 System
DEV
s02 (00) s02 (00)
s03 (00) s03 (00) ITS ITS
AGate
~messageServer s01
~systemName DEV
~loginGroup SPACE
~appServer s03
~systemNumber 00
~routeString /H/gateway/S/3299/H/s03/S/3200
Service Parameters: Selection of the R/3 System
Load balancing across
the message server
Direct selection of an
application server
Example of using
SAProuter



As the AGate logs on like a "normal" GUI user, all the different options of the SAP GUI logon can be
used.
The SAProuter can also be used between the AGate and the R/3 System.
If not all of the parameters contain values, the ITS automatically generates an error message.

(C) SAP AG BC440 5-22
SAP AG 2001
S
The r loggin data fo g on to R/3
e file is all in th service
~client
Client 400
400
~login meier
~password *****
~language EN
User MEIER
Password *****
System Help
SAP R/3

q
q

q
+
+

+
R/3 R/3
Language EN
ervice Parameters: Implicit Logon



The ITS uses the above service parameters to log on to the R/3 System.
~client - client
~login - R/3 user
~password - password
~language - logon language
If all the parameters have values, the ITS logs on to R/3 when the service is started without asking the
user for logon details.
This type of system start is called implicit logon and is mainly used if the user does not have his/her
own R/3 user. For example, Internet sales scenarios can be implemented with this, where (as yet)
unknown Web users use R/3 to order goods and services.
You cannot identify the different Internet users in R/3 because they are all logged on with the same R/3
user. They also all have the same authorizations.

(C) SAP AG BC440 5-23
SAP AG 2001
The data for logging on to R/3 is
only partly in the service file
~client 400
~login
~password
~language EN
System Help
SAP R/3

q
q

q
+
+

+
R/3 R/3
Client 400
User SMITH
Password ********
Language EN
Login Smith
Password ********
Please logon to the
R/3 System
Service Parameters: Explicit Logon



If one or more of the parameters do not contain values, the ITS automatically creates an HTML form to
ask the user for the missing logon details.
This type of start is called implicit logon and is only used if all the users have their own R/3 user.
In this case you can identify the different Internet users in R/3 just as SAP GUI users, which means they
may have different authorizations.

(C) SAP AG BC440 5-24
SAP AG 1999
L
Start S1
100
X
Start S2
?
?
Meier
******
?
?
100
X Meier *****
~cookies = 1
~cookies = 1
ogging on to Several Services
Meier
******
X



The ITS can create a temporary cookie which can save data of a direct logon when the user exits the
service.
Service parameters: ~cookies (standard = 1)
ITS with cookies (~cookies = 1)
Following an explicit logon the cookie contains a pointer to the logon data saved in the ITS (AGate).
The logon data is therefore only in the AGate and not in the cookie.
When another service is opened this data is used again.
ITS without cookies (~cookies = 0)
When a service is opened, logon data must be entered again.

(C) SAP AG BC440 5-25
SAP AG 1999
Internet Internet
Transaction Transaction
Server Server
~timeOut
~userTimeOut
Service 2
Time
~timeOut Service 1
Service Parameters: ~timeOut and ~userTimeOut
X



~timeOut determines how much time (in minutes) is allowed to pass between sending a page through
the AGate and receiving the next request from the browser.
If this time is exceeded, the ITS closes the relevant R/3 connection and deletes all session-related data
stored internally.
If the user sends another request after ~timeOut has been exceeded, the user gets an HTML page with
message "Session timed out in response.
~userTimeOut determines how much time (in hours) is allowed to pass between ending the last
session of a user and starting a new session (service).
This parameter only works if ~cookies = 1, that is, the data of an explicit logon is to be saved when
the service is ended.
If after ~userTimeOut has been exceeded, the users starts a new service with explicit logon, the ITS
ignores the cookie of the last logon and requires a new explicit logon.
Starting with ITS 4.6B, the unit of ~usertimeout has been changed from minutes to hours (see also
Note 215330).

(C) SAP AG BC440 5-26
SAP AG 1999
ITS ITS
A
G
a
t
e
SystemHelp
SAP R/3

q
q

q
+
+

+
System Help
SAP R/3

q
q

q
+
+

+
DIAG DIAG
DIAG DIAG
Carrier name:
Lufthansa
200
100
RFC RFC
RFC RFC
EWT, ITS Flow Logic, WebRFC or ITS Admin Tool
BAPIs and (any) other
RFC-enabled
function modules
RFC RFC
RFC RFC
Special
WebRFC-enabled
function modules
W
G
a
t
e
TCP/IP TCP/IP
ITS
Admin
Tool
ITS
Flow Logic
WebRFC
EasyWeb
Transaction
R/3 R/3




(C) SAP AG BC440 5-27
SAP AG 1999
Generation of the HTML pages
~theme 99 Selection of templates
~URLmime /sap/its/mimes Path to MIME objects for URLs
~exitURL /BC440/home.html URL after service is completed
~runTimeMode pm Selection of system templates
Administration of logon data
~timeOut 5 Max. time between two dialog steps
~cookies 1 Data buffering of explicit logon
~userTimeOut 60 Maximum duration of buffering
Parameters for creating URL
~hostunsecure s34 Name of HTTP server
~portunsecure 1080 Port for HTTP
~hostsecure s34 Name of HTTP-S server
~portsecure 443 Port for HTTP-S
Service Parameters: ITS-Specific




(C) SAP AG BC440 5-28
SAP AG 1999
Start without transferring parameters:
http://<server>/<path>/wgate/<service>/!
Start with transferring parameters
.../wgate/<service>/!?<par1>=<val1>&<par2>=<val2>...
Selection of R/3
System
Logon data
WebTransaction
or WebRFC
Transaction code
Name of FM for
WebRFC
Entry in service
file
Set by URL
ITS query if
necessary
Required
Allowed
Required
Required
Allowed
Ignored
Added to service
file
Ignored
Ignored
Added/
overrided
No
Yes
No
No
No
Starting a Service




(C) SAP AG BC440 5-29
SAP AG 1999
Architecture
Architecture
Service Files
Service Files
Internet Users for Web Transactions
Internet Users for Web Transactions
Overview: Internet Users
ITS Context and HTML
Business
Templates
ITS Context and HTML
Business
Templates




(C) SAP AG BC440 5-30
SAP AG 2001
In
The data for logging on to R/3
System Help
SAP R/3
is all in the service file
~client 400

q
q

q
R/3 R/3
+
+

+
Client 400
~login itsuser
User itsuser
~password *****
~language EN
Password *****
Language EN
System Help
SAP R/3

q
q

q
+
+

+
Customer no. ?
Password ?
Customer no. 200
Password **********
Enter customer number
and password:
ternet Users - Concept



Based on the service started, all Internet users are logged on to the R/3 System with the same R/3 user.
Initially, these users cannot be distinguished from each other.
If authentication is required for a user of the EasyWebTransaction (for example, if the user actually
wants to order the products selected in the online shop), the user must specify his or her Internet user (for
example, the customer number) and the associated password.
The prompt for the Internet user must be implemented at a suitable point in the R/3 transaction.

(C) SAP AG BC440 5-31
SAP AG 1999
BAPIUSW01
SCUSTOMER SCUSTOMER
(Flight (Flight
customer) customer)
OBJTYPE OBJID
LFA1 200
KNA1 200
PASSWORD
BDC3238AB8651EF
AAAAGB12F4G5R6T
SCUSTOMER 200 ALIK8675J11K1UZ
SCUSTOMER 201 HGD234HDS134GFT
MANDANT
400
400
400
400
...
...
...
...
...
SCUSTOM
ID NAME
199 Smith
200 Meier
201 SAP
202 Hendriks
MANDT
400
400
400
400
...
...
...
...
...
Internet User - Object Type Dependency



Internet users are created for business objects. For example, there may be a customer with customer
number 200, a vendor with vendor number 200, and an applicant with applicant number 200.
An Internet user makes sense only if the corresponding entry has been maintained in the master data
table associated with the business object.
Internet users are client-specific.

(C) SAP AG BC440 5-32
SAP AG 1999
M
User Edit Goto System Help
q q +

Maintain Internet User



q
+
+
200
ID: Delete
SCUSTOMER
Type:
Create
Rename
Lock/unlock
Initialize
(create password
automatically)
Change password
BAPIUSW01
BFUSER_TYP
aintaining Internet Users



You create Internet users in transaction SU05.
For each business object maintained in table BFUSER_TYP you can create an Internet user in table
BAPIUSW01.
The password is generated by the maintenance transaction and can also be changed with this transaction.
Note: When you create an Internet user, the maintenance transaction automatically checks if the
corresponding record exists in the master data table.

(C) SAP AG BC440 5-33
SAP AG 1999
List the components that the ITS consists of
Explain what an ITS service is
Describe the most important parameters that are
used in service files
Explain what explicit and implicit logon means
Explain the concept of Internet users and create
Internet users
Describe how the ITS generates HTML pages
You are now able to:
ITS: Unit Summary




(C) SAP AG BC440 5-34
Internet Transaction Server: Exercises



Unit: Internet Transaction Server
Topic: Parameters in Service Files


At the conclusion of these exercises, you will be able to:
Create projects and site definitions in Web Studio.
Import service files from ITS



1-1 Web B
e service bc440e_syst1. This transaction displays some R/3 System
ame and port.
1-2
1-2-1

Import the service bc440e_syst1 from the ITS. Open the service file. Which
R/3 transaction belongs to the service bc440e_syst1?
to Project Import Import Service
1-3 R/3:
Create a new project and site definition. Import various service files and
analyze the parameters in them.
rowser:
1-1-1 Start th
fields. The WGate URL is:
http://<Web-Server:Port>/scripts/wgate.
Your instructor will tell you the server n
Web Studio:
Create a new project in C:\Projects. You can choose a name for the project.
Path: File N s ew Project
1-2-2 Create a new site definition for the training environment. You can choose a name
for the site definition. Your instructor will tell you the name of the server.
Path: Project Site Definition New
1-2-3
Path: Project Add
from Site
1-3-1 Logon to the R/3 System.
1-3-2 Start the transaction belonging to the service bc440e_syst1. Compare the
display in SAPGUI to the HTML page you displayed in the browser. What
difference do you notice?

(C) SAP AG BC440 5-35
1-4 Web Studio:
1-4-1 Import the service Global into your project. Search for the param
determine which R/3 System and which R/3 user is used. Is load balancing used?
rowser:
eters that
1-5 Web B
e service bc440e_syst2. How is it different to service
2
Global.srvc are overridden?
1-7 Web B
1-7-1 Restart the service bc440e_syst2 and add the client and the logon language
directly to the URL:
.../wgate/bc440e_syst2/!?~client=...&~language=...
1-5-1 Start th
bc440e_syst1? In which parameters must the services bc440e_syst1 and
bc440e_syst2 be different?
1-6 Web Studio:
1-6-1 Check your answers to the last question by importing the service bc440e_syst
into your project. Which parameters from
rowser

(C) SAP AG BC440 5-36
Exercises



Unit: Internet
Transaction
Server
Topic: Creating and Using Internet Users


At the conclusion of these exercises, you will be able to:
Creating Internet users



Create an Internet user for an existing flight customer.
2-1 R/3:
an Internet user for flight customer 4##. Enter a new password (##
2-2 Web S
Import the service bc440e_cust into your project. Open the service file to find
2-3 R/3:
transaction for service bc440e_cust. Enter your flight customer
2-4 Web B
2-4-1 Start the service bc440e_cust. What are the similarities and the differences
between the R/3 transaction and the ITS service?


2-1-1 Create
indicates your group number).
tudio:
2-2-1
out which R/3 transaction belongs to this service.
2-3-1 Start the
number 2## and the new password. Change the address. Save the changes.
rowser:


(C) SAP AG BC440 5-37
Internet-Transaction-Server Solutions



Unit: Internet Transaction Server
Topic: Parameters in Service Files


Create projects and site definitions in Web Studio.
Import service files from ITS

Create a new project and site definition. Import various service files and
analyze the parameters in them.


1-3-2 tart the transaction belonging to the service bc440e_syst1. Compare the
eters that
load balancing used?
1-5-1
enter client and language
In which services parameters must the services bc440d_syst1 and
bc440d_syst2 be different?
~client and ~language
1-2-3 Which R/3 transaction belongs to the service bc440e_syst1?
BC440D_SYSTEM_FIELDS

S
display in SAPGUI to the HTML page you displayed in the browser. What
difference do you notice?
The HTML page displays less fields than the R/3 screen.

1-4-1 Import the service Global into your project. Search for the param
determine which R/3 System and which R/3 user is used. Is
(dependent on training system)
Start the service bc440e_syst2. How is it different to service
bc440e_syst1?
When you logon you have to


(C) SAP AG BC440 5-38
Solutions



Unit: Internet Transaction Server
Topic: Creating and Using Internet Users


Creating Internet users



Create an Internet user for an existing flight customer.
2-4-1 Start the service bc440e_cust. What are the similarities and the differences
between the R/3 transaction and the ITS service?
The R/3 user is also displayed in the R/3 transaction. In the browser you
cannot change all the fields.


2-2-1 Import the service bc440e_cust into your project. Open the service file to find
out which R/3 transaction belongs to this service.
BC440D_CUSTOMER


(C) SAP AG BC440 6-1
SAP AG 1999
Programming Model
Service and Templates
Web Debugger
Synchronization
Internet users
Connecting to the Workbench Organizer
Theme and language
Output with Step Loop
HTML
Business
Functions and Operators
MIME Objects
Context Macros
Frame Transactions
Contents:
Web Transaction




(C) SAP AG BC440 6-2
SAP AG 1999
Describe the programming model
"WebTransaction"
Create and edit service files and HTML templates
Use language dependencies in Web transactions
Define methods of transferring data from HTML
forms to R/3 Systems
Implement synchronization in Web transactions
Use MIME objects
Transfer the components of Web transactions to
the R/3 Workbench Organizer
At the conclusion of this unit, you will be able to:
Web Transaction: Unit Objectives




(C) SAP AG BC440 6-3
SAP AG 1999
C
o
u
r
s
e
O
v
e
r
v
i
e
w
P
r
e
f
a
c
e
1
2
S
u
m
m
a
r
y

a
n
d

O
u
t
l
o
o
k
9
Overview Diagram Web Transaction
Internet, Intranet and WWW
Internet
Transaction
Server
HTML
Web
Transaction
Web RFC
3
6 7
4
Administration 8
5




(C) SAP AG BC440 6-4
SAP AG 1999
Programming Model
Programming Model
Service and Templates
Service and Templates
Web Debugger
Web Debugger
Synchronization
Synchronization
Internet Users
Internet Users
Frame Transactions
Frame Transactions
Output with Step Loop
Output with Step Loop
HTML
Business
Functions
and Operators
HTML
Business
Functions
and Operators
Connecting to the
Workbench Organizer
Connecting to the
Workbench Organizer
Theme and Language
Theme and Language
Context Macros
Context Macros
MIME Objects
MIME Objects
Web Transactions




(C) SAP AG BC440 6-5
SAP AG 1999
WebTransactions
Simple!
Intended for use by everyone
(large number of users)
Users do not need to be
trained
Uses multimedia
and hyperlinks
to other systems
Standard R/3 Transaction
Processing is efficient in all
possible situations
Intended for professional
users
Users must be trained
Transaction Attributes



A WebTransaction makes a small part of the entire R/3 functions available to Internet users. This means
that untrained Internet users can also use this functionality.


(C) SAP AG BC440 6-6
SAP AG 1999
System Help
SAP R/3

q
q

q
+
+

+
System Hilfe
SAP R/3

q
q

q
+
+

+
R/3 R/3
Web Web
browser browser
ITS ITS
HTTP HTTP
server server
HTTP HTTP
HTTP HTTP
CGI CGI
CGI CGI
Carrier ID: LH
Carrier name:
Lufthansa
200
100
DIAG DIAG
DIAG DIAG
1 Screen =
1 Template =
1 HTML page
EasyWebTransaction (EWT) Components
Service
file
HTML
Business
templates



EasyWebTransactions consist of three components: R/3 transaction, service file and HTML
Business
templates. Complex EasyWebTransactions have more components. For simplicity these are not shown
on the above slide.
The R/3 transaction is created especially for use by the ITS:
- Only use "simple" screens that can be easily converted into HTML
- The transaction must allow synchronization through the ITS
- Use a special technique to provide users with input help in HTML forms
- Users must be able to log on to the Internet while the transaction is being processed
- The business logic can be created quickly using BAPIs
The service file contains information required by the ITS to log on to the R/3 System and to start the
transaction.


(C) SAP AG BC440 6-7
SAP AG 1999
P
System Help

q
q

q
+
+

+
mple screens
and screen sequences
SAP R/3 Generates si
Business
Object
Booking no. 561966
Cancel
BAPIs
rogramming Model
Uses the logic of SAP
business objects via BAPIs
Transaction supports:
Synchronization
1:1 relationship between
screens and templates
Special form of F4 help
Internet users



When a WebTransaction is created, the whole transaction does not have to be implemented again.
Business functions already developed by SAP can be re-used.
SAP encapsulates business data in business objects. The next topic describes this concept and explains
how BAPIs are used to access these objects.


(C) SAP AG BC440 6-8
SAP AG 1999
PROGRAM ...
TABLES ...
DATA ...
MODULE init OUTPUT.
CALL FUNCTION 'BAPI_...' ...
ENDMODULE.
MODULE read_data INPUT.
CALL FUNCTION 'BAPI_...' ...
ENDMODULE.
MODULE confirm_reservation.
CALL FUNCTION 'BAPI_...'...
IF ... .
CALL FUNCTION 'BAPI_...' ...
ENDIF.
ENDMODULE.
ABAP program
Business Object Business Object
Repository Repository
Business object A: Business object A:
Method 1 = M1 Method 1 = M1
Method 2 = M2 Method 2 = M2
R/3 R/3
Function modules: Function modules:
BAPI_A_M2
BAPI_A_M1
Accessing BAPIs with ABAP



Within R/3 Systems BAPIs are called in an ABAP program with the command "CALL FUNCTION".
If a BAPI is to be called in a remote system, a remote function call (RFC) "CALL FUNCTION ..." is
used. DESTINATION ..."
The naming convention for BAPI function modules is:
BAPI_<Business object>_<method>


(C) SAP AG BC440 6-9
SAP AG 1999
Error Handling
ters (structure or table)

N
Error handling with export parame
o restrictions
Parameter name RETURN
ABAP dictionary structure BAPIRET2



As BAPIs can also be called from non-SAP systems, exceptions cannot be used. Instead, the export
parameter RETURN is used
RETURN is defined in accordance with the ABAP Dictionary structure BAPIRET2. (BAPIs from
Release 3.1 can also use the structure BAPIRETURN):
TYPE CHAR 1 Message type: S Success, E Error, W Warning, I Information
ID CHAR 20 Message-ID
NUMBER NUMC 3 Message-Number
MESSAGE CHAR 220 Message text
LOG_NO CHAR 20 Application log: log number
LOG_MSG_NO NUMC 6 Application log: current message number
MESSAGE_V1 CHAR 50 Message variable
MESSAGE_V2 CHAR 50 Message variable
MESSAGE_V3 CHAR 50 Message variable
MESSAGE_V4 CHAR 50 Message variable
If a BAPI is successfully called, the parameter RETURN may be empty, either all the fields contain the
correct initial values, or TYPE has the value 'S'. The BAPI documentation will provide more
information.



(C) SAP AG BC440 6-10
SAP AG 1999
BAPIs with Update Semantics
BAPIs are always called synchronously
Exception: sent asynchronously in an IDoc packet in ALE but
called synchronously in the target system
Database changes in the BAPI via update task
No COMMIT WORK in BAPI, it is in the calling system
Service object SAP0001 has BAPIs (here names of
function modules):
BAPI_TRANSACTION_COMMIT
BAPI_TRANSACTION_ROLLBACK
(and others)




(C) SAP AG BC440 6-11
SAP AG 1999
Task flow
BAPI search
HTML
Business
R/3
transaction
Requirement
The Design Process - Step by Step



This topic outlines the order of the steps required to design a WebTransaction.


(C) SAP AG BC440 6-12
SAP AG 1999
Task flow BAPI search
HTML
Business
R/3
transaction
New product or existing
products?
Is the product
appropriate for the
Internet?
What is the target
group?
Requirement
Internet Internet
Requirement



The first step in the design process of a WebTransaction is to consider what is to be marketed on the
Internet:
- Is the product appropriate for the Internet?
- Are the potential customers accessible on the Internet?
- What hardware resources do customers have? (such as network connections, screen size, number of
colors displayed)?
- Are the products/information already available on the Internet? Do your products/information offer
more than your competitors?


(C) SAP AG BC440 6-13
SAP AG 1999
T
Steps required to
design transaction for
the Web
Simple process flow
Use multimedia
Consider feasibility of
developing an R/3
transaction
Logon
Password correct?
Yes
No
Enter posting number
Are you sure?
Cancel End
Yes
No
Cancel flight
Task flow BAPI search
tr
equirement
HTML
Business
R/3
ansaction
R
ask Flow



The second step in designing a WebTransaction is to describe the steps Internet customers will have to
follow. Keep in mind the following:
- The process should be self-explanatory for the Internet user
- Make use of WWW features, that is, incorporate multimedia
- Think in HTML: only use forms and hyperlinks
- Consider viability for use in R/3. WebTransactions are based on R/3 Transactions.


(C) SAP AG BC440 6-14
SAP AG 1999
Search for existing
business objects
Select required methods
(BAPIs)
BAPI search Task flow
HTML
Business
R/3
transaction
Requirement
Business Object Business Object
Repository Repository
R/3 R/3
Business object A: Business object A:
Method 1 = Method 1 = BAPI_A_M1 BAPI_A_M1
Method 2 = Method 2 = BAPI_A_M2 BAPI_A_M2
Business object B: Business object B:
Method X = Method X = BAPI_B_MX BAPI_B_MX
Method Y = Method Y = BAPI_B_MY BAPI_B_MY
Searching for BAPIs



The third step is to search for business objects and BAPIs.
The Business Object Builder has a search function.


(C) SAP AG BC440 6-15
SAP AG 1999
Create an
R/3 Transaction
Use existing BAPIs
Create simple screens
R
R/3
HTML
transaction
Task flow BAPI search
Business
Requirement
SAP R/3

q
q

q
+
+

+
System Help
MODULE cancel_booking INPUT.
CALL FUNCTION 'BAPI_A_M1'
...
ENDMODULE.
Booking no. 561966
Cancel
BO BO
BAPIs
/3 Transaction



The fourth step is to create a transaction in R/3. Create simple screens, create input fields for
transferring data to the BAPIs and output fields for displaying the data delivered by the BAPIs.
The Internet Transaction Server uses these screens like a "normal" GUI user. The Internet user can enter
data in all the input fields and all the output fields can be sent to the Internet user. Internal fields in the
associated ABAP program cannot be modified or read.


(C) SAP AG BC440 6-16
SAP AG 1999
Business logic
in R/3
Display on Web browser
using HTML
Business
templates
Language-independent
Templates are generated
using SAP@Web Studio
HTML
Business
Task flow BAPI search
R/3
transaction
Requirement
Booking no.
561966
Book id: 561966
HTML
Business



The fifth and last step in designing a WebTransaction is to create
HTMLBusiness
templates.
The complete business logic of WebTransactions is in the R/3 System and can be developed separately
from the visual appearance of the HTML pages.
The SAP@Web Studio generates a raw version of HTMLBusiness templates from the WebTransaction
screens in R/3. These templates enable the WebTransaction to be fully tested. After the test, only the
visual appearance of the raw version has to be edited.
URLs of graphics, sound and other MIME objects are displayed in HTMLBusiness templates through
placeholders which the ITS replaces with "real" URLs at runtime. The replacement depends on the
theme determined at runtime. This means that the screen display of the WebTransaction can be roughly
defined and then the ITS can automatically generate the final screen display at runtime.
Together with language support, WebTransactions can be displayed to suit customer needs (for example,
use colors or images appropriate to different cultures or nationalities).


(C) SAP AG BC440 6-17
SAP AG 1999
Programming Model
Programming Model
Service and Templates
Service and Templates
Web Debugger
Web Debugger
Synchronization
Synchronization
Internet Users
Internet Users
Connection to the
Workbench Organizer
Connection to the
Workbench Organizer
Frame Transactions
Frame Transactions
Output with Step Loop
Output with Step Loop
HTML
Business
Functions
and Operators
HTML
Business
Functions
and Operators
Theme and Language
Theme and Language
Context Macros
Context Macros
MIME Objects
MIME Objects
Web Transactions




(C) SAP AG BC440 6-18
SAP AG 1999
Global.srvc
~systemName XYP
~login Meier
~password ***
~client 400
~language DE
SAP R/3

q
q

q
+
+

+
System Help
Password
*****
Book
Customer no. 31415
Transaction ABCD
Transaction EFGH
abcd.srvc
~transaction ABCD
SAP R/3

q
q

q
+
+

+
System Help
LH
Display name
Carrier ID:
~transaction
Service
files
test.srvc
~transaction EFGH
~theme 66
~login
~language



Each ITS service is based on a service description that specifies, for instance, the R/3 System and the
transaction to be used.
For each ITS there is a global service description containing standard settings for all the services in an
ITS. These settings can be added to or overidden by the individual service descriptions.
Each service description is kept in its own service file (ASCII file with extension srvc) in the file system
of the AGate server. The HTML
Business
templates required for the EasyWebTransaction are also kept
here (HTML files with special placeholders for R/3 data).
Service names can have a maximum of 14 characters.



(C) SAP AG BC440 6-19
SAP AG 1999
S
Servic
bc440demo.srvc
e name BC440Demo
~transaction bc440
~client 400
~login Smith
~language DE
SAP@Web SAP@Web
Studio Studio
stem <none>
ABC
R/3 Sy
XYZ
Client 400
User Smith
Service
files
Password ******* use DIAG
Language EN
Transaction BC440
use RFC
ervice Wizard



The Service Wizard automatically creates a service file according to the user's requirements. Only
entries that complement the settings from Global.srvc are created. Entries in Global.srvc can be
overwritten.
The following entries in Global.srvc can be overwritten:
- R/3 System used
- R/3 user used
- Logon language
- Theme (see slides later in this Unit)
Be careful when entering the system and user. When the service is later transported into the test and
production system, these entries still indicate the development system.
The service file is created without a connection to R/3. User requirements are not checked first.
The automatically generated service file can be modified at any time.


(C) SAP AG BC440 6-20
SAP AG 1999
MIME
Project BC440_Demo
Services Templates Texts
SAP@Web SAP@Web
Studio Studio
Web Web
Browser Browser
Start service
HTTP HTTP
W
G
a
t
e
ITS ITS
A
G
a
t
e
R/3 R/3
Publish Service Files
abcd.srvc
test.srvc
Publish



The service files and templates created on the hard drive must be copied to the file system on the AGate
server so that the service can be used. This process, called "Publish" is supported by SAP@Web Studio.


(C) SAP AG BC440 6-21
SAP AG 1999
Syntax in HTML
Business
HTML
Business
syntax is very similar to C programming
language
HTML
Business
commands appear in "normal" HTML and are
enclosed between ` (backticks)
`SDYN_BOOK-NAME.LABEL` <p>
<em> `SDYN_BOOK-NAME` </em>
The SAP@Web Studio displays HTML
Business
commands in
blue.



HTML
Business
expressions are case-insensitive.
The character ` (backtick) was chosen because it has no special usage in "normal" HTML.
Another way of embedding HTML
Business
in HTML is described later.


(C) SAP AG BC440 6-22
SAP AG 2001
Output of Screen Fields
System Help
SAP R/3

q
q

q
+
+

+
Customer name:
Mller & Co
200
`SDYN_BOOK-NAME.label` <p>
`SDYN_BOOK-NAME.value`




Output fields and field labels are displayed on the
screen by using the same field names in the template
that are used on the screen
The screen fields can be placed anywhere in the
template
All the names in HTML
Business
expressions are interpreted as names of fields in R/3 screens.
The following additions can be used with each screen field:
.name Name and index of the field
.value Field value
.label Field label
.max Number of lines in a multiple-line field
.exists Does the field exist or is it suppressed (dynamically)?
.disabled Ready for input status of a field
.type Field type
.maxSize Maximum input length of field
.visSize Visible length

(C) SAP AG BC440 6-23
SAP AG 2001
Naming Conventions for Templates
<prg>_<dynpro_no>.html
System Help

+

SAP R/3

q
q

q
+
+
sapits050d_100.html
System Help
SAP R/3

q
q

q
+
+

+
Program Program
SAPITS050D SAPITS050D
Carrier ID: LH
Carrier name:
Lufthansa Lufthansa
200
100
`SCARR-CARRID.label`
`SCARR-CARRID.value`
sapits050d_200.html
`SCARR-CARRNAME.label` <p>
`SCARR-CARRNAME.value`



The ITS requires one HTML
Business
template for each R/3 screen of a WebTransaction.
One screen is always visible in R/3 at runtime. The ITS selects the relevant template from the file system
in the AGate using the naming convention described above.
The logic determining the screen sequence is completely in R/3 and is not known to the ITS.
In Releases earlier than 4.0 program names can only be a maximum of eight characters.


(C) SAP AG BC440 6-24
SAP AG 1999
R/3 System ABC
XYZ
GHJ
TZU
SAP@Web
Studio
SAP@Web SAP@Web
Studio Studio
Program
<none>
Screen Number
Language
Service
Theme
sapbc440d
100; 200
BC440Demo
99
R/3 Logon R/3 Logon
<body>
<form action="`wgateURL()`"...>
...
</form>
`~messageLine`
</body>
R/3 R/3
Template Wizard
HTML
Business
templates



The Template Wizard automatically creates an HTML
Business
template for each R/3 screen.
HTML
Business
expressions are automatically created for all the input fields, output fields and field labels.
The Wizard also embeds these fields into an HTML form using <input type=text ...>
Depending on the application, some HTML commands may have to be deleted.
The HTMLBusiness command ~messageLine is described later in this Unit.
The ITS manages templates according to theme and language. (discussed later in Unit). Basically, the
theme is determined by the service parameter ~theme and the language by the service parameter
~language. The parameter values should be passed to the Template Wizard.
The tempaltes are generated in R/3. The SAP@Web Studio must establish an RFC connection to an R/3
System to run a program from here. You can chose the R/3 System. All user data required for logon
must be specified.
The automatically generated templates can be modified at any time.



(C) SAP AG BC440 6-25
SAP AG 2001
File Hierarchy - Services and Templates
ITS ( ITS (AGate AGate) )
The service files and the
HTML
Business
templates
are stored in the file
system of the AGate
Global.srvc contains
global settings that can
be added to or over-
written with special
service files
In each service there is
one template for each
screen
GLOBAL (srvc)
ITS050demo (srvc)
99
SAPITS050_100.html
SAPITS050_200.html
Test (srvc)
99
SAPTEST_301.html
SAPTEST_305.html
...
...




(C) SAP AG BC440 6-26
SAP AG 1999
MIME
Project BC440_Demo
Services Templates Texts
SAP@Web SAP@Web
Studio Studio
Start service
Web Web
Browser Browser HTTP HTTP
W
G
a
t
e
ITS ITS
A
G
a
t
e
R/3 R/3
Publish Templates
<b>`i`</b>
`itab[i]`
abcd.srvc
test.srvc
Publish



The service files and templates created on the hard drive must be copied to the file system on the AGate
server so that the service can be used. This process, called "Publish" is supported by SAP@Web Studio.


(C) SAP AG BC440 6-27
SAP AG 2001
Publish, Build and Go
Publish
Copy files from the project to the ITS
Note: Save open files first!
Build (active service)
Syntax check for all templates of the service
Save all open files
Copy all files of the service to the ITS
Go (active service)
Build and
Start the service in the Web browser




(C) SAP AG BC440 6-28
SAP AG 2001
Input Using HTML Forms
The ITS as CGI program for HTML input
<form action="`wgateURL()`">
<input type=text name=`CUSTOMER.name` ...>
<select name=`CARRID.name`> ... </select>
<input type=radio name=`DURATION.name` ... >
<input type=checkbox name=`NONSTOP.name` ... >
<input type=submit ...>
</form>
Converting data in the AGate at runtime (example)
action="/scripts/wgate/XY/~flNXlPTQ...MwMg=="



The ITS transfers data entered in HTML forms to screen fields ready for input.
All types of HTML input elements can be used.
The URL of the ITS (WGate) must be specified as the value of the action parameter in the HTML
form. In HTML
Business
the function wgateURL()can be used for the ITS to automatically generate this
URL at runtime. Details are described later in Unit.


(C) SAP AG BC440 6-29
SAP AG 2001
T
HTML Form Screen
System Help
SAP R/3

q
q
+
+
200
Customer no.
q +
Customer no.
****
Password
Duration 4 ho
a
t
e
Password
Direct flight
Carrier
Duration
4 ho
12 hours
A
G
urs
other
12 hours
X
Direct flights only
other
ITS ITS
X
Lufthansa
urs
Display
Display
Exit
Exit
ransferring Input to the R/3 Screen



The ITS receives the query string from an HTTP request:
- Standard
name1=value1&name2=value2&...
- Example:
CUSTMR_NO=200&PWD=abap&DURATION=12&NONSTOP=+&NONSTOP=X&SCARR-
CARRID=LH&%7EOkCode%3DDISP=display
The ITS transfers the values in the request into screen fields with the same names as the screen.
If the service parameter ~submitChecking is set to 1, an error will occur if a name in the query
string of an HTTP request has no matching screen field name. An HTML page is displayed with an ITS
administration message.
Besides the input fields, the ITS also fills the command field (also called OK code field). It is of no
importance in this context whether menus, icons or pushbuttons exist for the screen.
The ITS sends the completed screen as a DIAG packet to the R/3 System. The R/3 System is unable to
distinguish between the ITS and a "normal" SAP GUI user.



(C) SAP AG BC440 6-30
SAP AG 1999
System Help
SAP R/3

q
q

q
+
+

+
Customer no.
Password
Duration
Direct flight
Carrier
4 hours
12 hours
other
X
200
****
HTML Forms - Text and Password
Template
<input type=text
name=`CUSTMR_NO.name` >
<input type=password
name=`PWD.name` >
Query string (example)
CUSTMR_NO=200&PWD=abap
Screen



HTML input elements of types input and password are mapped to input and output fields of the
same name.


(C) SAP AG BC440 6-31
SAP AG 1999
H
System Help
SAP R/3
name="`RB_04.group`"

q
q

q
+
+

+ value="`RB_04.name`">
Customer no.
<input type=radio
Password
Duration
Direct flight
Carrier
4 hours
12 hours
other
X
TML Forms Radio Buttons
Template
<in
Screen
put type=radio
name="`RB_12.group`"
value="`RB_12.name`">
Query string (example)
%%RBGROUP001=RB_12



As the selection buttons belonging to one selection button group have different names in R/3, but all
radio buttons belonging to one group have to have the same name in HTML, the attribute .group that
the ITS generates at runtime from the screen description is used in HTML
Business
. This attribute does not
exist in R/3.
With the attribute .selected you can determine whether the selection button is selected on the screen.
Alternatively, HTML input elements of type radio can also be mapped to input and output fields of
the same name.
As the user can only select one HTML radio button on the Internet, only valid input values can be
entered in the input field of the R/3 screen.


(C) SAP AG BC440 6-32
SAP AG 1999
System Help
SAP R/3

q
q

q
+
+

+
Customer no.
Password
Duration
Direct flight
Carrier
4 hours
12 hours
other
X X
HTML Forms - Checkbox
Template
<input type=hidden
name=`NONSTOP.name`
value=" ">
<input type=checkbox
name=`NONSTOP.name`
value="X">
Query string (example)
NONSTOP=%20&NONSTOP=X
Screen



HTML input elements of type checkbox are also mapped to input and output fields of the same
name. The R/3 field can be a real checkbox (values and X or an input/output field (all values
possible).
With the attribute .selected you can determine whether the checkbox is selected on the screen.
The "hidden" input field of type hidden is only needed, if the R/3 screen is used several times in
succession.
Example without a hidden field:
- The user selects the HTML checkbox and sends the HTML form to the ITS. The ITS writes an "X "
in the R/3 input field.
- The user then removes the "X" from the HTML checkbox and sends the HTML form to the ITS.
The ITS does not delete the "X" from the input field as the checkbox name is not in the query
string.
Example with a hidden field:
The user selects the HTML checkbox and sends the HTML form to the ITS. The ITS first writes an "
", then an "X" in the R/3 input field.
- Now the user deselects the HTML checkbox and sends the HTML form to the ITS. The ITS only
writes the " " in the input field.

(C) SAP AG BC440 6-33
SAP AG 1999
System Help
SAP R/3

q
q

q
+
+

+
LH LH
Customer no.
Password
Duration
Direct flight
Carrier
4 hours
12 hours
other
X
HTML Forms - Select
Template Screen
Query string (example)
<select
name=`SCARR-CARRID.name` >
<option value="LH">
Lufthansa
...
</select>
SCARR-CARRID=LH



An HTML select is also mapped to input and output fields of the same name.
As the user can only select one entry from the HTML select on the Internet, only valid input values
can be entered in the output field of the R/3 screen (client-side check).


(C) SAP AG BC440 6-34
SAP AG 2001
System Help
SAP R/3

q
q

q
+
+

+
Customer no.
Password
Duration
Direct flight
Carrier
4 hours
12 hours
other
X
DISP DISP
Screen
HTML Forms - Submit
Template
<input type=submit
name="~OkCode=DISP"
value="display">
Query string (example)
%7EOkCode%3DDISP=display



HTML input elements of type submit are mapped to the command field, if ~OkCode is used as a name in
HTML.
A button is not needed in R/3 but it is useful for testing the WebTransaction in R/3. The Template
Wizard creates an HTML submit button for each R/3 button on the screen.


(C) SAP AG BC440 6-35
SAP AG 1999
E

Template
System Help
SAP R/3
<input type=submit
name="~OkCode=/NEX"

q
q

q
+
+

+
Customer no.
Password
Duration
Direct flight
Carrier
4 hours
12 hours
other
X
/NEX /NEX
Screen
xiting a Service
~exitURL /BC440/home.html
%7EOkCode%3D/NEX=exit
value="exit">
Query string (example)
Service parameter



The function code /NEX is processed directly by the R/3 System and terminates the SAPGUI
connection between the ITS and the application server.
The PAI for the current screen is not processed.
The ITS sends the page defined in the Global.srvc with ~exitURL to the Web browser, usually to
the home page of the HTTP server. This is usually the homepage of the HTTP server.



(C) SAP AG BC440 6-36
SAP AG 1999
Using wgateURL() in Forms
HTML
Business
template
<form action="`wgateURL()`"> ...
<input type=submit name="~OkCode=PICK"
value="send"> </form>
HTML page at runtime (service XY):
<form action=".../wgate/XY/~flNPTQ...MwMg==">
... </form>



The character string following the service name contains:
- Session ID with which the ITS assigns requests to the correct session memory
- HTTP content charset to select an appropriate character set for the browser
- Status information about synchronization.



(C) SAP AG BC440 6-37
SAP AG 1999
Skipping the First Screen in a WebTransaction
Enter data in all the mandatory input fields of the
first screen
Send function code with ~OkCode
.../wgate/XY/!?~OkCode=DISP&
CUSTMR_NO=200&DEPARTS=X&...



No values will be entered on the screen without ~okCode.


(C) SAP AG BC440 6-38
SAP AG 1999
Output With Table Control
Example: Output of table control MY_TC
<table>
<tr> <td><!-- rowselection --></td>
`repeat with j from 1 to MY_TC.columncount`
<td>`MY_TC-column[j].title`</td>
`end` </tr>
`repeat with j from MY_TC.firstvisible to
MY_TC.lastvisible`
<tr>
<td><input type=radio name="MY_TC"
value="`MY_TC-rowselect[j]`"
`if(MY_TC-rowselect[j].selected)` checked
`end`></td>
<td>`SDYN_CONN-CARRID[j].value`</td> ...
<td>`SDYN_CONN-CARRID[j].value`</td> ...
`end`
</table>



The extract comes from a template that was generated by the template wizard.
`repeat with <index> from <start> to <end>` ... `end` is a loop in HTML
Business
.
The loop counter <index> does not have be especially declared. It can be output with `<index>`.
You can specify the column headers of a TableControl in your template with <tc>-
column[<index>].title. <index> refers to an index for the column (from 1 to
<tc>.columncount).
Field values in TableControl line cannot be directly accessed within the R/3 System. In HTML
Business
all
the TableControl lines visible on the screen can be accessed. The line number is added in square
brackets to the name of the screen field. The numbering begins with the attribute
<tc>.firstvisible and ends with <tc>.lastvisible.
If the TableControl has a selection column, this can be specified with <tc>-rowselect[index].
Note: rowselect is a fixed expression and does not depend on what you have called the selection
column in R/3. Depending on the type of selection column the Wizard generates the correct
HTML
Business
:
Simple selection: <input type=radio name="`<tc>.name`"
value="`MY_TC-rowselect[j].name`
Multiple selection: <input type=checkbox name="`MY_TC-rowselect[j]`"
value="X"

(C) SAP AG BC440 6-39
SAP AG 1999
Programming Model
Programming Model
Service and Templates
Service and Templates
Web Debugger
Web Debugger
Synchronization
Synchronization
Internet Users
Internet Users
Connection to the
Workbench Organizer
Connection to the
Workbench Organizer
Frame Transactions
Frame Transactions
Output with Step Loop
Output with Step Loop
HTML
Business
Functions
and Operators
HTML
Business
Functions
and Operators
Theme and Language
Theme and Language
Context Macros
Context Macros
MIME Objects
MIME Objects
Web Transactions




(C) SAP AG BC440 6-40
SAP AG 1999
System Help
SAP R/3

q
q

q
+
+

+
200
****
LH
Customer no.
Password
Duration
Direct flight
Carrier
4 hours
12 hours
other
X
SAP GUI
Web Browser
200
****
X
Lufthansa
Name
Password
Duration
Direct flights only
4 hours
12 hours
other
Display
Display
Exit
Exit
Debugging an EWT Using SAP GUI



ITS debugging allows you to display an EasyWebTransaction simultaneously in the browser and in the
SAP GUI for Windows.
To use the ITS debugging feature, you must explicitly switch it on on the virtual ITS. To do this, you
choose Configuration/Debug in the ITS Administration tool and set the switch Debug to On. This sets
the following key in the Windows NT Registry:

Key: HKEY_LOCAL_MACHINE /
SOFTWARE / SAP / its / 2.0 /
<virtual ITS> / Programs / Agate / AdminEnabled

Value: 1


(C) SAP AG BC440 6-41
SAP AG 1999
P
3 3 6 6
e
2 2
W
G
a
t
e
H
T
T
P
s
e
r
v
e
r
W
e
b
o
w
s
e
5 5
5 5
P

G
4 4
R/3 applic. R/3 applic.
server server
DIAG
HTTP
TCP/IP
1 1
assive Debugging Using SAP GUI
r
B
r
A
G
U
I
S
A
a
t



ITS debugging of a service requires that the service is first started from the Web browser. Once the
browser has received the first HTML page from the ITS, a SAP GUI connection must be established to
the AGate.
From the point of view of the SAP GUI the AGate behaves like an R/3 application server. The user name
and password are not requested because the AGate is already connected to R/3 through starting the
service. The SAP GUI displays each screen sent by the application server to the AGate.
The following steps take place:
- An HTTP request of the browser arrives at the HTTP server. The HTTP server forwards it to the
WGate.
- The WGate sends the request to the AGate.
- The AGate creates a DIAG data packet and sends it to the R/3 application server which processes the
data.
- The next screen is sent as a DIAG data packet to the AGate.
- The AGate converts the DIAG data packet into an HTML page and sends it to the WGate. The AGate
then sends a copy of the DIAG data packets received to the SAP GUI. The user sees the screen that
arrived at the AGate before.
- The HTTP server sends the HTML page that the WGate received as an HTTP response to the Web
browser.

(C) SAP AG BC440 6-42
SAP AG 1999
2 2
4 4
3 3
1 1
W
G
a
t
e
H
T
T
P
s
e
r
v
e
r
DIAG
HTTP
TCP/IP
R/3 application R/3 application
server server
Debugging Using SAP GUI Active
W
e
b
b
r
o
w
s
e
r
S
A
P

G
U
I
A
G
a
t
e



If the user enters data via the SAP GUI, the AGate sends it to the R/3 application server. The result is
forwarded by the AGate directly to the SAP GUI.
An HTML page cannot be sent to the Web browser because the HTTP client/server structure requires an
HTTP request from the browser (client), before an HTTP response can be sent.
To establish a connection to the AGate using the SAP GUI, you must specify the instance number. You
set this instance number for each virtual ITS in the ITS Administration tool. To do this, choose
Configuration/Debug and set the SapguiDebuggerPort switch to sapdp<xx> where <xx> is the instance
number. This sets the following key in the Windows NT Registry:

Key: HKEY_LOCAL_MACHINE /
SOFTWARE / SAP / its / 2.0 /
<virtual ITS> / Programs / Agate / SapguiDebuggerPort

Value: sapdp<xx>

After a virtual ITS has been installed, the value sapdp00 is set for the SapguiDebuggerPort.



(C) SAP AG BC440 6-43
SAP AG 1999
Programming Model
Programming Model
Service and Templates
Service and Templates
Web Debugger
Web Debugger
Synchronization
Synchronization
Internet Users
Internet Users
Connection to the
Workbench Organizer
Connection to the
Workbench Organizer
Frame Transactions
Frame Transactions
Output with Step Loop
Output with Step Loop
HTML
Business
Functions
and Operators
HTML
Business
Functions
and Operators
Theme and Language
Theme and Language
Context Macros
Context Macros
MIME Objects
MIME Objects
Web Transactions




(C) SAP AG BC440 6-44
SAP AG 1999
+ +
R/3 R/3
Details
SAP R/3
LH 400
01.06.00
300
SAP R/3
300
ITS ITS
AGate AGate
LH 400 01.06.00
LH 400 02.06.00
LH 400 05.06.00
LH 400
01.06.00
LH 400
01.06.00
LH 400
01.06.00
PICK PICK
Synchronization Problem
300
300
1 1 2 2
200 3 3
6 6
4 4
5 5



Provided that the user only clicks hyperlinks and sends forms in an EasyWebTransaction, the browser
and the R/3 System are synchronized.
If the user clicks the Back button in the browser, he or she is taken one step back (in the browser
history). The R/3 System, however, retains its previous status. Now the browser and R/3 have different
statuses and are no longer synchronous.
If the user goes forward again by clicking hyperlinks or sending forms, he sends data of a screen to R/3
that is not displayed at the moment. The data and the function code are ignored by R/3 - the status of
R/3 does not change. As the ITS responds passively to the screens sent by R/3, the ITS creates a suitable
HTML page.

(C) SAP AG BC440 6-45
SAP AG 1999
Synchronization - Simple Solution
Details
R/3 R/3
SAP R/3
LH 400
01.06.00
LH 400
01.06.00
ID Scrn.
1 1 2 2
300
03
01 100
ITS ITS
AGate AGate
LH 400 01.06.00
02
03
200
300
+
LH 400 02.06.00
LH 400 05.06.00
ITS:
Browser Back
not supported
~SyncBehaviour NoResync
02
3 3
4 4
+



The ITS "hides" a status number in each HTML page. Details of this number (e.g. the screen number)
are stored in the ITS. This enables the ITS to check for each HTTP request whether the browser and R/3
are synchronized.
If the ITS determines that the browser and R/3 are no longer synchronized, dependent on the service
parameter ~SyncBehaviour it can execute one of the following actions:
- Simple solution: Generate an HTML page that tells the user that BACK is not allowed. The
transaction in R/3 does not know anything about this.
- Comfortable solution: Request the R/3 transaction to roll back as far as required for the browser and
R/3 to be synchronous again. This must be incorporated into the R/3 transaction.

(C) SAP AG BC440 6-46
SAP AG 1999
Details
R/3 R/3
SAP R/3
LH 400
01.06.00
300
SAP R/3
200
SAP R/3
300
LH 400 01.06.00
LH 400 02.06.00
LH 400 05.06.00
AWSY... AWSY...
PICK PICK
03
02
04
LH 400 01.06.00
LH 400 02.06.00
LH 400 05.06.00
LH 400
01.06.00
LH 400
05.06.00
LH 400
05.06.00
Synchronization - Comfortable Solution
ITS ITS
AGate AGate
ID
01
02
03
04
Scrn.
100
200
300
300
1 1 2 2
3 3
5 5
7 7 8 8
6 6
4 4
+ +



Synchronization in detail (example):
- The ITS receives screen 300 by DIAG.
- The ITS generates the associated HTML page and sends this page with the status number 03 to the
browser.
- The user chooses the BACK button in the browser. The ITS is not aware of this action. The Web
browser sends a completed HTML form to the ITS via the HTTP server.
- The ITS checks the status number 02 and determines that synchronization is necessary. The ITS then
sends the function code AWSY<prog><screen_no> to the R/3 System.
- The ABAP program uses SET SCREEN to display the correct screen 200. The ITS receives the
correct screen 200 by DIAG.
- The ITS fills the input fields and sends the associated function code.
- The input is processed in R/3 and the result screen 300 is sent by DIAG to the ITS. The ITS receives
screen 300 by DIAG.
- The ITS generates the associated HTML page and sends this page with the status number 04 to the
browser.
Note: The ITS sends AWSY... only once - R/3 has only one chance to send the correct screen.

(C) SAP AG BC440 6-47
SAP AG 1999
Synchronization Table
DATA: sync_itab TYPE TABLE OF sitssync,
sync_wa TYPE sitssync.
subsc repid dynnr
MAIN sapmits100 200
LEFT sapmits100 100
RIGHT1 sapmits100 300
RIGHT2 sapmits100 400



The ITs provides the information about what screen is required in an internal table. This table contains
one or more rows
- Always a row with SUBSC = MAIN. This row contains the program name and the number of the
(main) screen required by the ITS.
- Further rows only if the main screen contains subscreen areas that also have to be synchronized (see
unit Frame Transactions).

(C) SAP AG BC440 6-48
SAP AG 1999
DATA sync_itab TYPE TABLE OF sitssync,
sync_wa TYPE sitssync.
...
CASE ok_code(4).
WHEN 'AWSY'.
CALL FUNCTION 'ITS_GET_SYNC_INFO'
TABLES
sync_info = sync_itab
EXCEPTIONS
its_not_available = 1
others = 2.
ENDCASE.
See next slide
Synchronization ABAP Coding (1)



To allow an EasyWebTransaction to be synchronized, the ITS sends a function code beginning with
AWSY. The other characters are no longer relevant.
In the ABAP program the function module ITS_GET_SYNC_INFO must then be called. The
synchronization information is requested from the ITS using RFC and stored in the internal table
(interface parameters).

(C) SAP AG BC440 6-49
SAP AG 1999
Synchronization ABAP Coding (2)
READ TABLE sync_itab INTO sync_wa
WITH KEY subsc = 'MAIN'.
IF sy-subrc = 0.
... " internal roolback

LEAVE TO SCREEN sync_wa-dynnr.
ENDIF.

Possibly:
Deletes internal tables
Initializes fields
Releases database locks
...



Before the LEAVE TO SCREEN ..., the internal logic of the ABAP program must be synchronized,
which means that the previous input must be discarded.


(C) SAP AG BC440 6-50
SAP AG 1999
Programming Model
Programming Model
Service and Templates
Service and Templates
Web Debugger
Web Debugger
Synchronization
Synchronization
Internet Users
Internet Users
Connecting to the
Workbench Organizer
Connecting to the
Workbench Organizer
Frame Transactions
Frame Transactions
Output with Step Loop
Output with Step Loop
HTML
Business
Functions
and Operators
HTML
Business
Functions
and Operators
Theme and Language
Theme and Language
Context Macros
Context Macros
MIME Objects
MIME Objects
Web Transactions




(C) SAP AG BC440 6-51
SAP AG 1999
BAPIUSW01
SCUSTOMER SCUSTOMER
(Flight (Flight
customer) customer)
OBJTYPE OBJID
LFA1 200
KNA1 200
PASSWORD
BDC3238AB8651EF
AAAAGB12F4G5R6T
SCUSTOMER 200 ALIK8675J11K1UZ
SCUSTOMER 201 HGD234HDS134GFT
MANDANT
400
400
400
400
...
...
...
...
...
In
SCUSTOM
ID NAME MANDT
...
199 Smi 400 th
200 Meier
201 SAP
202 Hendriks
400
400
400
...
...
...
...
ternet User - Object Type Dependency



Internet users are created for business objects. For example, there may be a customer with customer
number 200, a vendor with vendor number 200, and an applicant with applicant number 200.
An Internet user makes sense only if the corresponding entry has been maintained in the master data
table associated with the business object.
Internet users are client-specific.

(C) SAP AG BC440 6-52
SAP AG 1999
Check at Runtime
When Internet users are created, the system does not
check if the master record exists.
At runtime the following checks are carried out:
Does the master record exist in the relevant application table?
Does the Internet user exist in table BAPIUSW01?
Is the Internet user unlocked?
Is the password correct?
Standard name for BAPIs (here name of FM):
BAPI_<Business Object>_CHECKPASSWORD



The Internet user is normally checked by means of a BAPI to which the Internet user ID and password
are passed.

(C) SAP AG BC440 6-53
SAP AG 1999
Programming Model
Programming Model
Service and Templates
Service and Templates
Web Debugger
Web Debugger
Synchronization
Synchronization
Internet Users
Internet Users
Connection to the
Workbench Organizer
Connection to the
Workbench Organizer
Frame Transactions
Frame Transactions
Output with Step Loop
Output with Step Loop
HTML
Business
Functions
and Operators
HTML
Business
Functions
and Operators
Theme and Language
Theme and Language
Context Macros
Context Macros
MIME Objects
MIME Objects
Web Transactions




(C) SAP AG BC440 6-54
SAP AG 2001
PRD PRD
R
The R/3 Workbench Organizer and Transport System
QAS QAS
DEV DEV
R
An R/3 system landscape consists of at
least three systems:
DEV - Development of new objects
QAS - Consolidation (testing, quality
assurance)
PRD - Production operation
The original of each object is in the
system in which it was created
Any changes made to an object are
entered in the Workbench Organizer
(WBO) and transferred to subsequent
systems by the Transport System




(C) SAP AG BC440 6-55
SAP AG 1999
R
R
ITS ITS
A
G
a
t
e
HTTP HTTP
ITS ITS
A
G
a
t
e
HTTP HTTP
ITS ITS
A
G
a
t
e
HTTP HTTP
R/3 SystemLandscape with ITS Integration (IACOR)
PRD PRD
QAS QAS
DEV DEV




(C) SAP AG BC440 6-56
SAP AG 1999
R R
QAS QAS PRD PRD DEV DEV
Add
Add
DEV DEV QAS QAS PRD PRD
Get
Get
Get
Get
Transporting an ITS Service



Note: The SAP@Web Studio is not shown in the slide although all transports between R/3 and ITS
always run via SAP@Web-Studio.
There are four types of transport between R/3 and SAP@Web-Studio:
- Add - create objects in R/3 (only executed once for each object)
- Get - read objects from the R/3 System (Corrections not possible)
- Check out - lock and read objects in R/3
- Check in - write changed objects back to R/3 and remove lock


(C) SAP AG BC440 6-57
SAP AG 1999
ITS ITS
P
A
G
a
W
G
a
R
t
e
t
e
R/3 R/3
Web Web
browser browser
HTTP HTTP
SAP@Web SAP@Web
Studio Studio
MIMEs Services Templates Texts Flow Files
<b>`i`</b>
`itab[i]`
abcd.srvc
test.srvc
start
list
Seats
seats
Project ITSxxx_Demo
roject - WBO Connection via SAP@Web Studio
Check in
Check out



The SAP@Web Studio enables all the objects of a project to be transferred to the WBO or to the R/3
Transport system. These are transported together with the relevant ABAP programs.
Following the transport into the Consolidation or Production system, the objects can be loaded from R/3
into a project and copied to WGate and AGate using Publish.


(C) SAP AG BC440 6-58
SAP AG 2001
R
DEV DEV
Project Project File View File View
Assign
WBO request
Assign
WBO request
R/3 Logon R/3 Logon
for RFC from
SAP@Web Studio
into R/3
SAP@Web SAP@Web
Studio Studio
Add to the Development System
2 2
1 1
Add
Add
GLOBAL (srvc)
BC440demo (srvc)
50
SAPBC440_100.html
SAPBC440_200.html
BC440demo_DE.htrc



All the required objects are selected in the Project - File View of the SAP@Web Studio.
These objects are written by RFC to the R/3 database using Add.
The objects must be assigned to a development class and a development task in R/3. Language-
dependent objects can be translated using R/3 translation tools.
With Add language-dependent objects are transferred only in the logon language to R/3.
With the R/3 translation tools text files of a service can be translated in R/3. Use the translation tools
for logical objects. Choose the Sie dazu logical object IARC. Use F4 input help to select the text
name.
Alternatively you can select the R/3 attribute multi-language. Then you can also use add to transfer
objects into R/3 in other languages.
For the latter way you have to use language-dependent MIME objects. These cannot be translated in
R/3.
The tables containing the objects belong to development class SBF_WEB.

(C) SAP AG BC440 6-59
SAP AG 2001
R
DEV DEV
Project Project File View File View
Assign
WBO request
Assign
WBO request
SAP@Web SAP@Web
Studio Studio
Check out
Check out
Check in
Check in
Corrections (Check Out and Check In)
2 2
1 1
3 3
4 4
GLOBAL (srvc)
BC440demo (srvc)
50
SAPBC440_100.html
SAPBC440_200.html
BC440demo_DE.htrc




(C) SAP AG BC440 6-60
SAP AG 2001
Project Project File View File View
R/3 Logon R/3 Logon
for RFC from
SAP@Web Studio
into R/3
ITS ITS
A
G
a
t
e
HTTP HTTP
Publish
Publish
SAP@Web SAP@Web
Studio Studio
PRD PRD
Get from the Production System
2 2
1 1
Get
Get
GLOBAL (srvc)
BC440demo (srvc)
99
SAPBC440_100.html
SAPBC440_200.html
BC440demo_DE.htrc



With Get objects are read by RFC from the R/3 database into a project.
From the project these objects must be copied using "Publish" to the AGate and HTTP server.
Objects cannot be changed in SAP@WebStudio. The functions Check out and Check in can be used for
repairs. These functions can lock and unlock the objects for correction.


(C) SAP AG BC440 6-61
SAP AG 1999
Programming Model
Programming Model
Service and Templates
Service and Templates
Web Debugger
Web Debugger
Synchronization
Synchronization
Internet Users
Internet Users
Connection to the
Workbench Organizer
Connection to the
Workbench Organizer
Frame Transactions
Frame Transactions
Output with Step Loop
Output with Step Loop
HTML
Business
Functions
and Operators
HTML
Business
Functions
and Operators
Theme and Language
Theme and Language
Context Macros
Context Macros
MIME Objects
MIME Objects
Web Transactions




(C) SAP AG BC440 6-62
SAP AG 1999
Airline carrier: LH
Airline carrier LH
`SCARR-CARRID.label`<p>
<form ...> ... </form>
<img src="...">
...
ITS ITS
A
G
a
t
e
50 50
99 99
R/3 R/3
...
<img src="...">
`SCARR-CARRID.label`<p>
<form ...> ... </form>
...
50 50
99 99
System Help
SAP R/3

q
q

q
+
+

+
Airline carrier:
LH
100
Theme Different Layouts for a Screen
For each
screen:
1 theme =
1 template
HTML
Business
templates



The whole business logic of an EasyWebTransaction is in R/3. However, the actual appearance (layout)
is determined by the HTML
Business
templates used.
If the same EasyWebTransaction is to be used by different user groups, it may be necessary to provide
different screen layouts. The ITS uses themes for this.
A theme is a logical name for the screen layout of EasyWebTransactions. The name consists of two lines
(letters or digits). Any number of themes can be used for one EasyWebTransaction.
A theme is specified at the start of a service and it cannot be modified while the service is running.


(C) SAP AG BC440 6-63
SAP AG 2001
File Hierarchy - Themes
ITS ( ITS (AGate AGate) )
The theme determines
the look-and-feel of a
WebTransaction
For each screen a
template can (must) be
created for each theme
The name of a theme
consists of two digits or
characters
GLOBAL (srvc)
ITS050demo (srvc)
50
SAPITS050_100.html
SAPITS050_200.html
...
...
99
SAPITS050_100.html
SAPITS050_200.html
...
...



All the objects in a WebTransaction are stored in the file system of the AGate and sorted by theme. The
directory name is the same as the name of the respective theme.


(C) SAP AG BC440 6-64
SAP AG 1999
Theme from
<srvc>.srvc
Theme from
<srvc>.srvc
Theme from
URL
Theme from
URL
Theme from
Global.srvc
Theme from
Global.srvc
~theme in
Global.srvc?
Yes
No
Theme =
Theme =
~theme in
<srvc>.srvc?
~theme in
URL?
Yes
Yes
No
No
General Special
Which Theme is Used?



The theme used by the ITS at runtime is determined by the value of the parameter ~theme in
Global.srvc or in the service file of the service. This value can still be changed by entering a value
for ~theme in the URL that starts the service.
If ~theme is not specified or is not set in the URL (~theme= " " ), no theme is used.



(C) SAP AG BC440 6-65
SAP AG 1999
...
<img src="...">
`SCARR-CARRID.label`<p>
<form ...> ... </form>
...
ITS ITS
A
G
L
a
t
e

q
q
+
+
Fluggesellschaft:
q +
LH Fluggesellschaft:LH
DE DE DE DE
Carrier: LH
1 Screen =
1 Template
System Hilfe
Flge anzeigen
EN EN EN EN
System Help
Display flights

q
q

q
+
+

+
Carrier:
LH
anguage Independency Through DDIC Reference
HTML
Business
templates



If the same EasyWebTransaction is to be used by different user groups, different languages may be
required. The ITS also supports this requirement.
When a service is started, a language is determined that cannot be changed while the service is running.
This language is used to log on to the R/3 System.
All field labels on screens that have been created with Data Dictionary reference are automatically
displayed in R/3 in the correct language. The ITS uses these texts when the HTML
Business
templates are
converted into HTML pages.
Language-dependent screen texts are provided without any additional maintenance required.


(C) SAP AG BC440 6-66
SAP AG 1999
...
<em>`~windowTitle`</em>
`SCARR-CARRID.label`<p>
<form ...> ... </form>
<em>`~messageLine`</em>
...
ITS ITS
A
G
a
t
e
Carrier: XY
Fluggesellschaft:XY
DE DE
EN EN
DE DE
EN EN
System Hilfe
Flge anzeigen

q
q

q
+
+

+
XY nicht bekannt
System Help
Display flights

q
q

q
+
+

+
XY unknown
XY nicht bekannt
XY unknown
Flge anzeigen
Display flights
R/3 Window Title and Status Bar
HTML
Business
templates



The window title and the messages in the status bar on the R/3 screen are also displayed in the logon
language.
The HTML
Business
command ~windowTitle transfers the text displayed in the title bar on a screen
(ABAP: SET TITLE) to the relevant HTML page.
The HTML
Business
command ~messageLine transfers the text displayed in the status bar on a screen
(ABAP: MESSAGE) to the relevant HTML page.
If the status bar is empty, ~messageLine is deleted (replaced by an empty character string).


(C) SAP AG BC440 6-67
SAP AG 1999
...
<img src="...">
`SCARR-CARRID.label`<p>
<form ...> ... </form>
<font ...>`#slogan`</font>
...
ITS ITS
A
G
a
t
e
1 Language =
1 Text file
L
System Hilfe
Flge anzeigen

q
q

q
+
+

+
Fluggesellschaft:
LH
Carrier: LH
Fluggesellschaft: LH
DE DE
EN EN
Testen Sie uns!
Test us!
DE DE
EN EN
System Help
Display flights

q
q

q
+
+

+
Carrier:
LH
anguage Independency Through Text Files
HTML
Business
templates
Language-
dependent
texts



If not all language-dependent texts can be fetched from the R/3 System, HTML
Business
enables
placeholders for language-dependent text to be used in templates. At runtime these placeholders
are replaced by the relevant text from language-dependent text files


(C) SAP AG BC440 6-68
SAP AG 2001
Language-Dependent Placeholders
... <table>
<tr>
<th>`#header1`</th>
<th>`#header2`</th>
<th>`#header3`</th>
</tr>
...
</table> ...
Template for
service ITS100
German text file:
ITS100_DE.htrc
header1 Nr.
header2 Startort
header3 Flughafen
English text file:
ITS100_EN.htrc
header1 No.
header2 City from
header3 Airport



A placeholder for language-dependent texts is identified in HTML
Business

by `#<name>`. <name> can
be any character string with a maximum of 132 characters.
The Web Application Builder allows you to maintain placeholders in the original language only.
Placeholders are translated using the translation tool (SE63).

(C) SAP AG BC440 6-69
SAP AG 2001
Maintaining Language-Dependent Placeholders
System Help
SAP R/3

q
q

q
+
+

+
Internet s ce Theme 99
Attributes Parameters
ervi
ITS100Demo
Parameter Value
header1 No.
header2 City from
header3 Airport
ITS100Demo
Theme 50
HTML templates
Theme 99
HTML templates
Translation of language-dependent placeholders for themes SE63



For each theme, the Web Application Builder automatically provides for the maintenance of language-
dependent placeholders.
You can use the Adjust parameters function to find all language-dependent placeholders in a theme that
are used in one of the HTML
Business
templates.
Language-dependent placeholders are translated using the R/3 translation tool (SE63, Translation
-> Logical objects -> Logical objects -> Object type IARP).

(C) SAP AG BC440 6-70
SAP AG 2001
File Hierarchy - Texts
ITS ( ITS (AGate AGate) )
For each service, text
files for any number of
languages can be
created for each theme
GLOBAL (srvc)
ITS100DEMO (srvc)
50
SAPITS100D_100.html
SAPITS100D_200.html
ITS100demo_DE.htrc
ITS100demo_EN.htrc
99
SAPITS100D_100.html
SAPITS100D_200.html
ITS100demo_DE.htrc
ITS100demo_EN.htrc



A text file is required for each language and for each theme to be provided in the Internet.
If no text is available for a placeholder at runtime, the placeholder is deleted (by replacing it with an
empty character string).


(C) SAP AG BC440 6-71
SAP AG 2001
Logon Language and Template Language
R/3
R/3 R/3
Language to log on to R/3
Logon language: ~language
AGate
AGate AGate
You cannot log on if this language has not been
installed in R/3
Template language: ~templateLanguage
Language for templates
Allows communication with Internet users in a
language that has not been installed in R/3
Therefore, language-dependent texts from R/3
cannot be used
If ~templateLanguage has not been specified,
~language is used



If a language to be used on the Internet is not available in R/3, different languages can be used for logon
to R/3 and for converting language-dependent texts (template language)
The disadvantage of this approach is that the field labels transferred from R/3 will not be in the same
language as the texts from the ITS text files.


(C) SAP AG BC440 6-72
SAP AG 1999
LL from
<srvc>.srvc
LL from
<srvc>.srvc
LL from
URL
LL from
URL
LL from
Global.srvc
LL from
Global.srvc
~language=""
in Global.srvc?
Yes
No
Prompt for
LL
Prompt for
LL
~language in
Global.srvc?
~language in
<srvc>.srvc?
~language=""
in <srvc>.srvc?
~language in
URL?
No
No
No
No
Yes
Yes
Yes
Yes
General Special
Which Logon Language is Used?



The language the ITS uses at runtime is determined by the value in the parameter ~language in
Global.srvc or in the relevant service file.
If ~language is set to "" (empty), the language can be specified be entering a value for ~language
in the URL.
If a language has not been specified either by the service file or by the URL when a service is started, the
ITS automatically generates an HTML form requesting the user to specify a language.


(C) SAP AG BC440 6-73
SAP AG 1999
Logon language
from <srvc>.srvc
Logon language
from <srvc>.srvc
Logon language
from URL
Logon language
from URL
Logon language
from Global.srvc
Logon language
from Global.srvc
~language
in Global.srvc?
W
Yes
o N
~language
Prompt for
logon language
Prompt for
logon language
~language
in <srvc>.srvc?
in URL?
Yes
Yes
No
No
General Special
hich Logon Language is Used?



The language the ITS uses at runtime is determined by the value in the parameter ~language in
Global.srvc or in the relevant service file. This value can still be changed by entering a value for
~language in the URL that starts the service.
If no language has been set either by the service file or by the URL when a service is started, the ITS
automatically generates an HTML page requesting the user to specify a language.

(C) SAP AG BC440 6-74
SAP AG 1999
Publishing Language-Dependent Texts to the ITS
Web Web
browser browser
HTTP HTTP
W
G
a
t
e
ITS ITS
A
G
a
t
e
R/3 R/3
MIMEs Flow Files Services
abcd
test
Templates
<b>`i`</b>
`itab[i]`
Texts
Seats
seats
IACOR Publish



The language-dependent placeholders maintained in the Web Application Builder must be transferred to
the file system of the AGate to enable the ITS to generate the HTML pages based on the templates. This
process, called "Publish" is supported by the Web Application Builder.
The language-dependent placeholders are stored as text files (.htrc) in the file system of the AGate.


(C) SAP AG BC440 6-75
SAP AG 1999
Programming Model
Programming Model
Service and Templates
Service and Templates
Web Debugger
Web Debugger
Synchronization
Synchronization
Internet Users
Internet Users
Connection to the
Workbench Organizer
Connection to the
Workbench Organizer
Frame Transactions
Frame Transactions
Output with Step Loop
Output with Step Loop
HTML
Business
Functions
and Operators
HTML
Business
Functions
and Operators
Theme and Language
Theme and Language
Context Macros
Context Macros
MIME Objects
MIME Objects
Web Transactions




(C) SAP AG BC440 6-76
SAP AG 1999
Flow Flow
logic logic
System Help
SAP R/3

q
q

q
+
+

+
AA 77
LH 400
LH 402
PROCESS BEFORE OUTPUT.
MODULE fill_itab.
LOOP.
MODULE read_line.
ENDLOOP.
ITAB CARRID CONNID
AA 77
LH 400
LH 402
Step Loop in R/3 (1)
MODULE read_line OUTPUT.
count = offset + sy-stepl.
READ TABLE itab
INDEX count
INTO sdyn_conn.
...
ENDMODULE.
Source Source
code code
LH 400
SDYN_CONN



Step loops are used to display tables on R/3 screens.
In the above example, an internal table is filled in the module fill_table ( for example, by accessing
a database table).
Step loops consists of several components:
- Fields of a structure that ideally has the same row type as the internal table are placed as a row on a
screen. This row is converted into a step loop. Then the row is multiplied (to three rows in the
above example).
- In the PBO component of the screen flow control, you must specify a module within the LOOP ...
ENDLOOP loop which is called once for each row of the step loop at runtime. The system field
SY-STEPL containing the number of the row to be filled is in this module. Fields are transferred to
the screen by comparing field names, the same way as "normal" screen fields are transferred.
- There must also be a LOOP .... ENDLOOP loop in the PAI section of the screen flow control. A
module only has to be specified if the step loop is used for input.
The internal table that fills the step loop may contain more entries than can be shown on the screen at
one time. In this case a scroll logic can be programmed that allows the user to display all the rows of an
internal table in sequence.

(C) SAP AG BC440 6-77
SAP AG 2001
Loops to Output Multiple Lines
REPEAT loop
<table> `repeat with j from 1 to
CONNID[j].value` </td>
<table> `for (i=1; i<=SDYN_CONN-CONNID.max; i++)`
<tr> <td> `SDYN_CONN-CONNID[i].value` </td>
...
</tr>
`end` </table>
SDYN_CONN-CONNID.max`
d> `SDYN_CONN- <tr> <t
...
</tr>
`end` </table>
FOR loop



The counter variable in the loops must be declared. As they are used in loops, they are implicitly
defined. The variable is still available after the loop has ended.
REPEAT - variations:
`repeat <expression> times` ... `end`
- <expression> - Fixed number or calculation standard processed at the start of the loop (more
information on standards later in this unit).
FOR - standard syntax:
`for ( <init>; <log. expr.>; <modify>)` ... `end`
- <init> - For expressions executed only before the loop is passed
- <log. expr.> - Logical expression checked before each loop is passed. If the expression is
incorrect, the loop is ended.
- <modify> - For expressions executed after each loop is passed.
Loops can be used without step loops.

(C) SAP AG BC440 6-78
SAP AG 2001
wgateURL() Usage in Hyperlinks (1)
HTML
Business
template:
<a href="`wgateURL(~OkCode="PICK")`">
`#display` </a>
HTML page at runtime (service XY):
<a href=".../wgate/XY/~flNXlPTQ...MwMg==?
~OkCode=PICK">
Display </a>



The hyperlink must send a function code to the R/3 System to start the PAI processing in R/3. As with
forms, ~OkCode is used.


(C) SAP AG BC440 6-79
SAP AG 2001
wgateURL() Usage in Hyperlinks (2)
HTML
Business
CARRID=SDYN_CONN-CARRID[i].value)`">
`SDYN_CONN-CARRNAME[i].value` </a>
HTML page at runtime (service XY):
<a href=".../wgate/XY/~flNXlPTQ...MwMg==?
~OkCode=PICK&CARRID=LH">
Lufthansa </a>
template:
<a href="`wgateURL(~OkCode="PICK",



As well as the function code, a hyperlink can also enter values in other input and output fields in the
current screen.
Note: If hyperlinks are used in a form, only the data in the URL of the hyperlink is submitted, not the
data in the input elements of the form.



(C) SAP AG BC440 6-80
SAP AG 1999
System Help
SAP R/3

q
q

q
+
+

+
AA 77
LH 400
CARRID CONNID
AA 77
LH 400
LH 402
SQ 13
AA 77
LH 400
ITS ITS
A
G
a
t
e
R/3
R/3
More entries in the
internal table than in
the step loop
Step Loop Without Scrolling Function



The ITS can only access the values in fields that are visible on the screen. If there are more entries in the
internal table than can be displayed on the screen, the Internet user cannot display all the table rows.
This problem can be solved with a transaction used by "true" GUI users which provides users with
scrolling keys that allow them to scroll page-wise. The next slide shows how this works.
Note: The maximum size of a DIAG data packet is 30KByte! More data cannot be displayed on one
screen. A step loop with scrolling functions can deal with this problem.

(C) SAP AG BC440 6-81
SAP AG 1999
System Help
S
SA
AA 77 a
t
e
P R/3

q
q

q
+
+

+
AA 77
LH 400
LH 402
SQ 13
A
G
LH 400
CARRID CONNID
AA 77
internal table than in
the step loop
tep Loop with Scrolling Function
More entries in the
LH 400
LH 402
SQ 13
System Help
SAP R/3

q
q

q
+
+

+
LH 402
SQ 13
ITS ITS
The ITS pages up/down the step
loop with the key combinations
Shift+F9 and Shift+F11



If a scrolling function exists for the step loop, the ITS uses it to forward the entire contents of the
internal table to the Internet user. The ITS proceeds as follows:
- "Pressing" function key "Shift+F9" (first page).
- "Pressing" function key "Shift+F11" (next page) as many times until the step loop no longer changes.
The ITS notes all the lines that are visible.
- "Pressing" function key "Shift+F9" (first page).
- The ITS fills the template corresponding to this screen with all the data that was visible beforehand.
The generated HTML page contains a "long" table with all rows from the internal table.
- The HTML page containing the table can be scrolled in the browser.

Technically, the ITS requires that a GUI status is set in which the function keys "Shift+F9" and
"Shift+F11" are active. The ITS sends those function codes to the R/3 System that are stored for these
keys in the GUI status.
The scrolling icons are only used for testing in R/3 and are not recognized by the ITS.

(C) SAP AG BC440 6-82
SAP AG 1999
Programming Model
Programming Model
Service and Templates
Service and Templates
Web Debugger
Web Debugger
Synchronization
Synchronization
Internet Users
Internet Users
Connection to the
Workbench Organizer
Connection to the
Workbench Organizer
Frame Transactions
Frame Transactions
Output with Step Loop
Output with Step Loop
HTML
Business
Functions
and Operators
HTML
Business
Functions
and Operators
Theme and Language
Theme and Language
Context Macros
Context Macros
MIME Objects
MIME Objects
Web Transactions




(C) SAP AG BC440 6-83
SAP AG 2001
Embedding HTML
Business
in HTML
Linking several HTML
Business
tags with ";"
`repeat with i from 1 to 5` `i` `end`
can be replaced with
`repeat with i from 1 to 5; i; end`




(C) SAP AG BC440 6-84
SAP AG 2001
Functions in HTML
Business
(1)
writeEnc() Output "URL-coded"
"`write(CITY.value)`" -
"`writeEnc(CITY.value)`"
"New York" - "New%20York
wgateURL()
Generates URLs for forms and hyperlinks
mimeURL()
Includes MIME objects stored in the file system
of the WGate
String functions



The following string functions are available:
strCat Link character strings
strCmp Compare character strings
strCat Copy character strings
striCmp Compare character strings (case-insensitive)
strLen Length of character string
strLwr Copy a character string to lower case
StrnCmp Compare the first characters of two character strings
striCmp Compare the first characters of two character strings (case-insensitive)
strStr Search character sub-string
strSub Copy character sub-strings
strLwr Copy a character string to upper case
For more information refer to the application help documentation.

(C) SAP AG BC440 6-85
SAP AG 1999
E
Error messages for an input field
<form action="`wgateURL()`">
<input type=text name=`ID.name`> `assert(ID.name)`
<input type=text name=`DATE.name`> `assert(DATE.name)`
</form> <p> `~messageLine`
~errorMarker <img src="....">
SAP R/3
L
Carrier
Date
LH
H
11/31/00
Invalid date!
R/3 R/3
11/31/00
Invalid date!
rror Handling - assert() (1)



A check against valid input can be added to each input field of a screen in R/3 Systems. A FIELD
statement for the input field is used in the flow logic of the screen and the input is checked in a PAI
module.
If the input is invalid, a message of type E (Error) is triggered. As a result, the screen is resent to the user
with only the invalid field ready for input. The message is displayed in the status bar of the screen.
On the HTML side, you can use the HTML
Business
function assert() to display a text and/or an image
beside the field whose value was recognized as invalid in R/3. The service parameter ~errorMarker
determines by what the assert() function is replaced.
You can freely choose the value of the service parameter ~errorMarker for each service. As
~errorMarker is neither language- nor screen-dependent, you should use ~messageLine to
transfer the error message from the status bar on the R/3 screen to the HTML page.
R/3 screens on which an error message is issued can only be quit after the correct field values are entered
or a function code of type E is triggered. Since when synchronization is enabled, the function code sent
by the ITS (AWSS... or AWSY...) is not of type E, you should set the service parameter
~syncBehaviour to NoReSync if you use the assert() function.

(C) SAP AG BC440 6-86
SAP AG 2001
Operators in HTML
Business
(1)
Value assignment
= (Help fields must not be declared)
Arithmetic operators
& Links character strings
+, ++ Addition
* Multiplication
-, -- Subtraction
/ Division
% Modulo division
|| Logical OR
&& Logical AND



++ and -- have the same meaning as in C/C++, that is, increase by 1 and decrease by 1.


(C) SAP AG BC440 6-87
SAP AG 2001
Operators in HTML
Business
(2)
Relational operators
== Equal to
!= Not equal to
> Greater than
< Less than
>= Greater than or equal to
<= Less than or equal to



Note: As in C/C++, "=" is used to assign values, not to compare values.


(C) SAP AG BC440 6-88
SAP AG 2001
Conditional Replacement
Basic form
`if (SCARR-CARRID.value == "LH")`
<em> Lufthansa </em>
`else`
<span id="blue"> other airline </span>
`end`
`if (SPFLI-CITYFROM.value == "New York")`
<em> Empire State Building </em>
`elseif (SPFLI-CITYFROM.value == "London")`
<b> Tower Bridge </b>
`elseif (SPFLI-CITYFROM.value == ...)`
...
`end`
Query different values in same field



If directly copying the value of a screen field is not sufficient, you can use the HTML
Business
expressions
above to make a conditional replacement.
else and elseif can be used together in a `if ... end`.
Logical expressions are formulated the same as in C/C++.
- Logical expressions are enclosed in round brackets
- The logical operators ==, !=,<, <, >= and <= can be used.
- Note: If a fixed value (literal) is to be compared as in the above example, enclose it in " ". Without
" the value of the screen field of the same name is compared.
- Strings are case-sensitive.


(C) SAP AG BC440 6-89
SAP AG 2001
User-Defined Functions
" value=", text, " >");
end`
Example of calling a function (at a later point in the same template)
... `button("Display details", "PICK")`
... `button(#exit, "/NEX")`
Definition of a function:
`function button(text, fcode)
write("<input type=submit name=~OkCode=", fcode,



The function definition must come before the first call in the template.
Since HTML
Business
does not know local variables, the following applies:
All variables of the template can be read and changed in the function.
Variables that are used in the function and are therefore declared implicitly, are available for global
use once the function has been processed.

(C) SAP AG BC440 6-90
SAP AG 2001
Include Example
Template for screen 100
... `Include(~name="button_functions.html")`
... `button("Cancel", "/NEX")`
File button_functions.html:
`function button(text, fcode)
write("<input type=submit name=~OkCode=", fcode,
" value=", text, " >")
end`
Template for screen 300
... `Include(~name="button_functions.html")`
... `button("Cancel", "/NEX")`




(C) SAP AG BC440 6-91
SAP AG 2001
Include Syntax
General syntax of include()
include([~service = <service>,]
[~theme = <theme>, ]
[~language = <language>,]
~name = <name>)
If parameters have not been specified, they are filled
with the current values in the service parameters
(~service, ~theme, ~templateLanguage)



In the SAP@Web Studio the include statement can be created simply using Drag&Drop.

(C) SAP AG BC440 6-92
SAP AG 1999
Programming Model
Programming Model
Service and Templates
Service and Templates
Web Debugger
Web Debugger
Synchronization
Synchronization
Internet Users
Internet Users
Connection to the
Workbench Organizer
Connection to the
Workbench Organizer
Frame Transactions
Frame Transactions
Output with Step Loop
Output with Step Loop
HTML
Business
Functions
and Operators
HTML
Business
Functions
and Operators
Theme and Language
Theme and Language
Context Macros
Context Macros
MIME Objects
MIME Objects
Web Transactions




(C) SAP AG BC440 6-93
SAP AG 2001
MIME Objects for a WebTransaction
Use any MIME objects
(images, sounds, videos, ...)
Book id:
561966 50 50
Book id:
561966
99 99
MIME objects are stored
Dependent on language
and theme
<img src="`mimeUrl(...)`">
on the HTTP server
HTML
Business
function
mimeURL() creates the
correct URL at runtime



MIME objects can be linked to WebTransactions in several ways:
- Static URL to access objects in the file system of the HTTP server
- Dynamic URL using HTML
Business
to access objects in the file system of the HTTP server
- Send MIME objects from R/3 to the ITS
The second option has the following advantages:
- The business logic of a WebTransaction can be developed in R/3 separately from the visual
appearance of the resulting HTML pages.
- MIME objects can be included dependent on the selected theme and logon language at runtime.
- In combination with language support customer-specific information can be presented on the Web.
The first option ideally should not be used. This topic focuses on the second option. The third option is
described in the topic "Macros".


(C) SAP AG BC440 6-94
SAP AG 2001
Logical File Hierarchy MIME Objects
Hierarchy in the WGate file
system:
OService
OTheme
OLanguage
OName of the image
At each level:
The order is fixed
Individual levels can be
omitted
Images can be stored at
each level
ITS ( ITS (WGate WGate) )
Global
. ITS050DEMO
.66
.DE
banner.gif
.EN
banner.gif
.99
DE
EN
banner.gif



MIME objects can be stored in the file system of the HTTP server at any directory level below a service
node.
Language-dependent MIME objects are assigned to directory nodes whose name corresponds to the
language chosen for converting the templates.
The Web Application Builder does not (yet) support the administration of language-dependent MIME
objects. You can store MIME objects in the file system of the HTTP server and in the R/3 database using
the SAP@Web Studio. The steps involved are as follows:
- Check out the service from R/3. This requires that the service has been assigned to an open transport
request.
- Create language nodes in the service and assign the MIME objects to the language nodes.
- Check in the service or add the MIME objects to R/3.
- Publish the MIME objects to the ITS (function in the SAP@Web Studio).

(C) SAP AG BC440 6-95
SAP AG 1999
Structure of the "MIME URL" with ITS Support
Standard mimeURL()Syntax
If parameters have not been specified, they are
filled with the current values in the service
parameters (~service, ~theme,
~templateLanguage)
URL for the highest level node in the MIME
hierarchy is determined in the service parameter:
mimeUrl([~service = <service>,]
[~theme = <theme>, ]
[~language = <language>,]
~name = <name>)
~URLmime



In SAP@Web Studio the mimeURL statement can be created simply using drag-and-drop.

(C) SAP AG BC440 6-96
SAP AG 2001
mimeULR() Example: Using Images
HTML
Business
template:
<img src="`mimeUrl(~language = "",
~name = "banner.gif")`">
HTML page at runtime:
(~service = BC440DEMO, ~theme = 99)
<img src=".../MIMES/BC440DEMO/99/banner.gif">




(C) SAP AG BC440 6-97
SAP AG 1999
Project MIME Objects
MIME
Project BC440_Demo
Services Templates Texts
SAP@Web SAP@Web
Studio Studio
Web Web
Browser Browser
Start service
HTTP HTTP
W
G
a
t
e
ITS ITS
A
G
a
t
e
R/3 R/3
<b>`i`</b>
`itab[i]`
abcd.srvc
test.srvc
seats
seats
Publish



MIME objects are copied by "Publish" into the file system of the WGate, (the HTTP server).


(C) SAP AG BC440 6-98
SAP AG 1999
Programming Model
Programming Model
Service and Templates
Service and Templates
Web Debugger
Web Debugger
Synchronization
Synchronization
Internet Users
Internet Users
Connection to the
Workbench Organizer
Connection to the
Workbench Organizer
Frame Transactions
Frame Transactions
Output with Step Loop
Output with Step Loop
HTML
Business
Functions
and Operators
HTML
Business
Functions
and Operators
Theme and Language
Theme and Language
Context Macros
Context Macros
MIME Objects
MIME Objects
Web Transactions




(C) SAP AG BC440 6-99
SAP AG 1999
Motivation: HTML Select as "F4 Help"
HTML
Business
template
R/3 R/3
SAP R/3
_
Carrier
SCARR
`SCARR-CARRID.name`>
`"
>
`CARRNAME[i].value`
`end`
</select>
<select
name=
`repeat with i from 1
to CARRID.max`
<option
value="`CARRID[i].value



Input help can be linked to each input field in the R/3 System. When the user selects the F4 key or the
appropriate icon, a list of possible entries for the input field is displayed.
In HTML, such an input help can be implemented as a <select>. The following slides show how
values for HTML <select> are compiled in R/3 and how they are sent to the ITS.
Sending the permitted values of a field with context macros is an alternative to the HTML
Business
function
searchhelp().

- Advantages of searchhelp():
You can implement complex search helps (collective search helps).
Input help values are only requested if required.

- Advantages of context macros
No additional communication required between the ITS and R/3 to display the search help
Full integration of the input help into the HTML page

(C) SAP AG BC440 6-100
SAP AG 1999
R/3 R/3
SAP R/3
_
Carrier
PBO
PBO
PAI
PAI
Web Web
browser browser
ITS ITS
HTTP HTTP
server server
HTTP HTTP CGI CGI
CGI CGI HTTP HTTP
RFC RFC
RFC RFC
DIAG DIAG
DIAG DIAG
Transporting Data By RFC



As well as the data transport between the ITS and R/3 by DIAG, data can also be sent to the ITS by
RFC.
Fields, internal tables and MIME objects can be sent to the ITS in the event PBO or PAI.
Context fields of the ITS or MIME objects from R/3 can be read in the event PBO or PAI.


(C) SAP AG BC440 6-101
SAP AG 1999
AGate AGate
System fields
Fields in the HTTP request
Fields in the current screen
Fields sent by RFC
IT
ITS context
ITS context
DIAG DIAG
HTTP
S Context Fields
RFC RFC



System fields are all possible service parameters on the one hand, and internal ITS parameters on the
other hand whose values are determined by the ITS at runtime.
The retention period of the ITS context is limited to one HTTP request/response cycle. Once the AGate
has generated the HTTP page to be sent, the ITS context is discarded.

(C) SAP AG BC440 6-102
SAP AG 1999
Macros for Transporting ITS Context Fields
Exporting ITS context fields (from R/3 into the ITS)
field-set <name> <index> <value>.
Importing ITS context fields (from the ITS into R/3)
Definition in include AVWRTCXM
field-get <name> <index> <itab> <length>.
field-transport.



The macros field-set and field-transport (as well as others) are defined in the include
program AVWRTCXM (ALE via Web Runtime Context Macros).
field-set (Creation of a list containing all fields to be transported)
- name - Name of ITS context field (text)
- index - Number of ITS context field, beginning with 1 (numeric)
- value - Value of ITS context field (text)
field-transport (Actual transport of the data to the ITS through RFC)
field-get
- name - Name of ITS context field (text)
- index - Number of ITS context field, beginning with 1 (numeric)
- itab - Name of an internal table into which values are to be entered (text)
- length - Name of the ABAP field into which the length of the ITS context field is to be
entered (numeric)
Unlike field-set, field-get is executed immediately.

(C) SAP AG BC440 6-103
SAP AG 1999
ITS ITS
Context
counter = 1.
LOOP AT itab into wa.
field-set 'CARRID'
counter wa-carrid.
field-set 'CARRNAME'
counter wa-carrname.
ADD 1 TO counter.
ENDLOOP.
field-transport.
Exporting Context Fields to the ITS
SCARR
R
F
C
R
F
C
1 AA CARRID
1 American Airlines
nada
... ... ...
AC
Air Ca
CARRID
CARRNAME
2
2
CARRNAME
United Airlines CARRNAME 17



Sending mass data by RFC offers an alternative to transferring data using step loops with a scroll logic.

- Advantages of step loops:
Formatting of internal data on the screen
Debugging supported
Transaction can be used with the SAP GUI

- Advantages of RFC
Higher performance for large volumes of data (less communication steps between the R/3 and the
ITS)


(C) SAP AG BC440 6-104
SAP AG 1999
ITS ITS
Context
CARRID CARRNAME
AA American Airlines 1
AC Air Canada 2
AF Air France 3
... ...
UA United Airlines dim
<select name=`SCARR-CARRID.name`>
`repeat with i from 1 to CARRID.max`
<option value="`CARRID[i].value`">
`CARRNAME[i].value`
</option>
`end`
</select>
American Airlines
Air Canada
Air France
...
United Airlines
Usage in HTML
Business



After field-transport the fields of the table sent can be processed in HTML
Business

in the same
way as if they had been transferred in a step loop.
Example above: `carrid[1].value` AA
`carrname[1].value` American Airlines

(C) SAP AG BC440 6-105
SAP AG 1999
G
CALL FUNCTION 'ITS_PING'
EXCEPTIONS
its_not_available = 1
others = 2.
IF sy-subrc = 0.
ENDIF.
UI User or ITS?
Read data,
field-set,
field-transport



Formatting data with field-set and sending data with field-transport only makes sense if the
communication partner of the R/3 System is an ITS.
By calling the function module ITS_PING you can determine whether the transaction is controlled by a
GUI or by an ITS.
ITS_PING encapsulates a C function that triggers a callback to the frontend, that is, to the ITS or the
GUI.

(C) SAP AG BC440 6-106
SAP AG 1999
<select name=`SCARR-CARRID.name`>
`repeat with i from 1 to CARRID.max`
<option value="`CARRID[i].value`"
`if (CARRID[i].value ==
SCARR-CARRID.value)`
selected
`end`
> `CARRNAME[i].value`
</option>
`end`
</select>
HTML Select Pre-Assigned in R/3



The above extract from an HTML
Business
template generates an HTML select where not the first value is
preset, but the value in the relevant R/3 input field.


(C) SAP AG BC440 6-107
SAP AG 1999
ITS ITS
Context
Im
CREW
Jonathan Riker 1
Dianna Troi 2
Jean
-Luc
Pic
crewtab
Jean-Luc Picard 3
...
Beverly Crusher
TYPES line(4).
DATA: crewtab TYPE TABLE OF line,
crewlength TYPE i.
field-get 'CREW' 3
crewtab crewlength.
17
ard
crewlength
15
porting Context Fields from the ITS
R
F
C
R
F
C



Note that when ITS context fields are imported, the rows of a table of the ITS context must be read out
individually.
The contents of one table row are transferred into one internal table of the R/3 System. If the value of
the ITS context field to be read out exceeds the row length of the internal table, the value of the ITS
context field is split into several rows in the internal table (see example on slide).
The field crewlength specifies the length of the ITS context field in bytes.


(C) SAP AG BC440 6-108
SAP AG 1999
Programming Model
Programming Model
Service and Templates
Service and Templates
Web Debugger
Web Debugger
Synchronization
Synchronization
Internet Users
Internet Users
Connection to the
Workbench Organizer
Connection to the
Workbench Organizer
Frame Transactions
Frame Transactions
Output with Step Loop
Output with Step Loop
HTML
Business
Functions
and Operators
HTML
Business
Functions
and Operators
Theme and Language
Theme and Language
Context Macros
Context Macros
MIME Objects
MIME Objects
Web Transactions




(C) SAP AG BC440 6-109
SAP AG 1999
Post box
Fax
R
First name
System Help
SAP R/3
Telephone
System Help
SAP R/3

q
q

q
+
+

+
Name
address

q
q

q
+
+

+
Name
Meyer
address
First name
Peter
Telephone
45678
System Hilfe
SAP R/3

q
q

q
+
+

+
Name
Meyer
address
Post box
11334
Fax
67890
200
300
300
200
/3 Subscreens



Subscreens are rectangular areas on a screen reserved for displaying other screens at runtime. Another
screen (of type subscreen) can be displayed on each subscreen area at runtime.


(C) SAP AG BC440 6-110
SAP AG 1999
Calling Subscreens
Controlling the Main Screen
PROCESS BEFORE OUTPUT.
CALL SUBSCREEN address INCLUDING
sy-repid '200'.
...
PROCESS AFTER INPUT.
COPY_OK_CODE.
CALL SUBSCREEN address.
...
MODULE user_command_2000.



At the time the event PBO is processed it is decided which screen is displayed for each subscreen area.
The standard syntax is:
CALL SUBSCREEN <subscreen-area> INCLUDING <prg> <dynpro_no>.
The PAI and PBO processing is executed for each subscreen in the same way as with "normal" screens.
The sequence of "CALL SUBSCREEN" calls in the flow logic of the main screen determines the
sequence in which the flow logic of individual subscreens is processed.
Note:
- The function code can only be processed via the main screen
- Subscreens do not have a command field of their own.
- Subscreens must not set a GUI status.



(C) SAP AG BC440 6-111
SAP AG 1999
F
<html> <head> ... </head>
<frameset cols="20%,80%">
SAP R/3
<frame name="F1"
src="...">
<frame name="F2"
src="...">
</frameset>
</html>
F1 F1 F2 F2
System Help

q
q

q
+
+

+
F1
F1
F2
F2
rames Subscreens



R/3 subscreens are mapped to HTML pages via an HTML <frameset>:
- A <frameset> in an HTML
Business
template corresponds to the main screen.
- An HTML
Business
template corresponds to each subscreen.
The naming convention for the HTML
Business
templates is(<prg>_<dynpro_no>.html.)



(C) SAP AG BC440 6-112
SAP AG 1999
Using wgateURL() in Framesets
HTML
Business
template
<frame name = "F1"
src="`wgateURL(~FrameName="F1")`">
HTML page at runtime (service XY):
<frame name = "F1"
src=".../wgate/XY/~flQ...Mwg==?~FrameName=F1">



wgateURL() must be used if you want the AGate to automatically generate the URL for the individual
frames.


(C) SAP AG BC440 6-113
SAP AG 1999
target="..." CALL SUBSCREEN ...
F1 F1 F2 F2
F1 F1 F2 F2
In
System Help
SAP R/3

q
q

q
+
+

+
F1 F2
System Help
SAP R/3

q
q

q
+
+

+
F1 F2
100 200
100 300
teraction Between Frames and Subscreens



On the HTML side, the target parameter (parameter of the <a> tag) determines which frame contents
are replaced with the target of a hyperlink.
In the flow logic of the subscreen container of an R/3 transaction, the CALL SUBSCREEN...
command determines which subscreen is inserted in which subscreen area.

(C) SAP AG BC440 6-114
SAP AG 1999
Using wgateURL() for target
HTML
Business
template
<a href="`wgateURL(~target="F2",
~okCode="DISPLAY")`">
`#display`</a>
<a href="/scripts/wgate/XY/~flNXlPTQ...MwMg==?
~target=F2&~okCode=DISPLAY"
target="F2">
Display </a>
HTML page at runtime (service XY):



The parameter ~target in the function wgate() enables the target parameter to be automatically
generated in hyperlinks and forms.
The AGate generates two additions in the hyperlink:
- The addition ~target=F2 is attached to the URL. As a result, the AGate converts only the
subscreen in subscreen area F2. The Web server sends only the corresponding HTML page
for this subscreen as the HTTP response.
- The addition target="F2" is attached to the hyperlink. As a result, the browser replaces the
contents of frame F2 with the HTML page generated by the AGate.


(C) SAP AG BC440 6-115
SAP AG 1999
Calling the Subscreens Dynamically
Flow Control in the Main Screen
PROCESS BEFORE OUTPUT.
CALL SUBSCREEN f1 INCLUDING
sy-cprog dynpro_f1.
CALL SUBSCREEN f2 INCLUDING
sy-cprog dynpro_f2.
...
PROCESS AFTER INPUT.
COPY_OK_CODE.
CALL SUBSCREEN f1.
CALL SUBSCREEN f2.
...
MODULE user_command_2000.



If different subscreens are to be displayed dynamically at runtime on one subscreen area, a field must be
entered in the flow logic of the main screen for each subscreen area.
The value of this field determines which subscreen is to be displayed


(C) SAP AG BC440 6-116
SAP AG 1999
Synchronization Table
DATA sync_itab TYPE TABLE OF sitssync.
subsc progid dynnr
MAIN sapmits100 2000
F1 sapmits100 100
F2 sapmits100 300



Synchronizing a frame transaction requires that all subscreen areas and the frame contents displayed in
the browser are synchronized. For frame transactions, the AGate therefore returns a synchronization
table which contains one entry for the main screen and each subscreen area.

(C) SAP AG BC440 6-117
SAP AG 1999
S
DATA sync_itab TYPE TABLE OF sitssync,
sync_wa TYPE sitssync.
...
CASE save_ok_code(4).
WHEN 'AWSY' OR 'AWSS'.
CALL FUNCTION 'ITS_GET_SYNC_INFO'
TABLES
sync_info = sync_itab
EXCEPTIONS
its_not_available = 1
others = 2.
ENDCASE.
See next slide
ynchronization with Frames - ABAP Coding (1)



To synchronize an EasyWebTransaction, the ITS sends a function code beginning with AWSY or AWSS.
The other characters are not relevant.
The function code AWSY is sent if the subscreen container needs to be synchronized.
The function code AWSS is sent if one or more subscreens need to be synchronized.
In the ABAP program the function module ITS_GET_SYNC_INFO must then be called. When the
function module ITS_GET_SYNC_INFO is called, the internal table is filled by an RFC from R/3 to the
ITS.

(C) SAP AG BC440 6-118
SAP AG 1999
LOOP AT sync_itab INTO sync_wa.
CASE sync_wa-subsc.
WHEN 'MAIN'.
... " internal rollback
SET SCREEN sync_wa-dynnr.
WHEN 'F1'.
... " internal rollback
dynpro_f1 = sync_wa-dynnr.
WHEN 'F2'.
... " internal rollback
dynpro_f2 = sync_wa-dynnr.
ENDCASE.
ENDLOOP.
LEAVE SCREEN.
Synchronization with Frames - ABAP Coding (2)




(C) SAP AG BC440 6-119
SAP AG 1999
Describe the programming model
"WebTransaction"
Create and edit service files and HTML templates
Use language dependencies in Web transactions
Define methods of transferring data from HTML
forms to R/3 Systems
Implement synchronization in Web transactions
Use MIME objects
Transfer the components of Web transactions to
the R/3 Workbench Organizer
You are now able to:
Web Transaction: Unit Summary




(C) SAP AG BC440 6-120
Web Transaction: Exercises



Unit: WebTransactions
Topic: Designing a WebTransaction


At the conclusion of these exercises, you will be able to:
Design a WebTransaction.



Specify the task flow of an online flight booking. Search for appropriate
BAPIs in R/3 and assign these to the task flow steps.
1-1 Paper
Sketch the task flow for an online flight booking transaction.
1-2 R/3:
usiness Object Repository and search for the BAPIs that provide the
1-3 Paper
1-3-1 Assign BAPI calls to the individual steps in your task flow. If necessary, modify
your task flow.
and pencil:
1-1-1
Note: Think about the steps you are taken through in a normal travel agency.
1-2-1 Go into the B
objects SFLIGHT, SCUSTOMER, SBOOK and SAGENCY.
and pencil:

(C) SAP AG BC440 6-121
Exercises



Unit: WebTransactions
Topic: Creating Dialog Transactions in R/3


Preparations for the next exercises

Create a new development class. Copy a part finished R/3 transaction.
Create a new transaction code. Test your transaction.


2-1 R/3:

2-1-2 opy the program SAPBC440_WT_T_A with all its sub-objects (such as screens,
interface, includes) from the development class BC440 into your own
developm . From now on you
are to w m.

n
2-1-1 Create a new development class ZBC440_##. A task in a development request has
been set up for you.
From now on, you are going to work only with this development class, which will
be referred to as your development class.
C
ent class. Name your copy SAPMZBC440_WT_##A
ork only with this copy, which will be referred to as your progra going
Scree Function
100 Data input for departure city, destina
c
tion and restrictions to one
arrier and afternoons only.
200 Displays list of suitable flights with a table control.
210 Displays same list with a step loop.

300 Displays details of one flight.
400 Requests customer number and booking (later asks for the
password of the customer number).

(C) SAP AG BC440 6-122
2-1-3 Navigate to the TOP include of your program. You have to change the data so
bookings made with your transaction are also assigned to your travel age
that
ncy.
with your group number 1##.
2-1-5 b-objects in your program.
2-1-6 Test your transaction. Book a flight with your customer number 4## (## = group
number) and the password that you assigned yourself in the exercise on user
maintenance.

Replace the number 100 in the marked row
2-1-4 Create the transaction code ZBC440_##A for screen 100 of your program.
From now on, this transaction will be referred to as your transaction".
Activate the su

(C) SAP AG BC440 6-123
Exercises



Unit: WebTransactions
Topic: Service Wizard


At the conclusion of these exercises, you will be able to:
Use the Service Wizard


Create a new service with

the service wizard. Use Publish to copy your
service onto the AGate.
3-1
3-1-1 A for your transaction
going to work only with this service, which will be referred
e New File Wizards Service Wizard
3-2
3-2-1 ice. The result is an error message from ITS saying that the service
es this happen?
3-3
3-3-1 u in the hierarchy view of your
copy the service file to the AGate.
3-4
3-4-1 he
hat went wrong this time.
(In the next exercise you will solve the problem).
Web Studio:
Using the Service Wizard create a new service ZBC440_##
in the R/3 System. View the contents of the service file.
From now on you are
to as your service.
Path: Fil
Web Browser:
Open your serv
does not exist.
Why do
Web Studio:
Use the entry "Publish" from the context men
project to
Web Browser:
Restart your service (select Refresh). The result is a new error message from t
ITS. Take a look at the error message to find out w

(C) SAP AG BC440 6-124
Exercises



Unit: WebTransactions
Topic: Template Wizard


At the conclusion of these exercises, you will be able to:
Use the Template Wizard

Using the TemplateWizard create a new Template for the screens in your
R/3 transaction. Improve the templates. Add a hyperlink to your travel
agency home page to open the service.

tudio:

4-1 Web S

New
Wizards Template Wizard
or Project Set
e Service ZBC440_##A

4-3 Web S
utput template.
4-3-2 on
meter to your service file and set the
.html from unit "HTML". This enables Internet
s to return to the homepage of your travel agency after your service has
4-3-3
4-1-1 Use the Template Wizard to create new HTML
Business
templates for all the screens
in your program. Choose language-independent and theme 99. File
File
4-1-2 Change your service to "Active Service" (context menu
). Select Go to start your service. Activ
4-2 Web Browser:
4-2-1 Book a flight. Use your customer number 1.81kg#.
tudio:
4-3-1 View the templates that the wizard has generated. Template 100 contains all the
possible input elements, template 300 is a typical o
The details of the table control and the step loop are provided later in this unit.
Create a new HTML button in all of the HTML
Business
templates to send the functi
code /NEX to R/3. This button ends your service.
The service parameter ~ exitURL determines which HTML page is displayed
after your service has ended. Add this para
value to the URL of your frames
customer
ended.
Select "Go" to start the service.

(C) SAP AG BC440 6-125
4-4 Web Browser:
4-4-1 Cancel the current service by clicking on the new button to test if you can get to the
home page of your travel agency.
4-5 Notepad:
4-5-1 Open the HTML page, home.html from the Unit "HTML" and create a hyperli
to start your service. Use target=_
nk
top.
4-6 Web Browser:
4-6-1 Load your frames.html from the Unit "HTML" and select the new hyperlink in
home.html to start your service.

(C) SAP AG BC440 6-126
Exercises



Unit: WebTransactions
Topic: Changing Input Elements


At the conclusion of these exercises, you will be able to:
Change HTML
Business
templates



Open the template for screen 100. Use hidden input fields and HTML
selects for entering data on departure and destination countries.
5-1 Web S
5-1-1

o longer displayed but that the "Departure country =
00 in
5-1-2
.
he R/3 table SGEOCITY.
ated online, suitable for the R/3 transaction, is
dealt with later in this unit.
5-1-3 Select "Go" to start the service.
tudio:
Open the template 100 and search for the HTML commands that define the input
fields for the departure and destination countries. Change them so that the fields in
the Web browser are n
Germany" and "Destination country = USA" are still transferred to screen 1
your R/3 transaction.
Replace the input fields for departure city and destination city with HTML
selection lists (SELECT). Enter some names of cities in Germany or in the USA
You can find valid cities in t
How the lists of the cities are cre

(C) SAP AG BC440 6-127
Exercises



Unit: WebTransactions
Topic: Web Debugger and Synchronization


At the conclusion of these exercises, you will be able to:
Use the Web debugger.
Implement synchronization in Web transactions.

Use the Web debugger to go through your Web transaction to find out
why the synchronization is not working. Implement the synchronization
in your R/3 transaction.


Debugging" with the AGate as the
6-2 Web S
6-2-1
6-2-2
ck
m the list. Details of the first flight selected
are displayed again.
6-3 R/3:
6-3-1 e
the
0 user_command_200, user_command_210 and
6-3-2 e IF statement for the
6-1 SAPlogon:
6-1-1 Create a new server entry "AGate
application server. Your instructor will tell you the instance numbers.
tudio/Web Browser/SAPlogon:
Select "Go" to start your service.
Start the Web debugger using the entry just created. Display the list in the table
control (200) in the browser. Select a flight and display its details. Select the Ba
button and select a different flight fro
The debugger indicates the reason for this error: R/3 displays screen 300, even
though the ITS requires screen 200.
Go to the PAI module user_command_300 of your program to implement th
necessary synchronization. The branch OTHERS already contains the call to
subroutine special_ok_code. This subroutine is called from the modules
user_command_10 ,
user_command_400, that is all the screens that are to be synchronized.
Go to the subroutine special_ok_code and complete th
function code AWSY.
Use the function module ITS_GET_SYNC_INFO, so that the ITS fills an internal

(C) SAP AG BC440 6-128
table containing all the required synchronization details.
You have to define this table (row structure ) yourselves: .
nal table that is valid for the subsc = 'MAIN'.
equired by the ITS with the command LEAVE
TO SCREEN....
6-4 Web Studio/Web Browser/SAPlogon:
6-4-1 No changes are needed. Start your service and start the Web debugger. Display
flight details again. Select Back and choose a different flight. The debugger
indicates that synchronization has worked this time. The correct information should
now be displayed.
Then read the rows from the inter
Then you can display the screen r

(C) SAP AG BC440 6-129
Exercises



Unit: WebTransactions
Topic: Internet Users


At the conclusion of these exercises, you will be able to:
Use Internet users in Web transactions



Enhance the Web transaction to query the password of a customer
number.
7-1 R/3:
7-1-1
already
.
ining the
er number or password
7-1-2

OMER is
If the check shows that the data entered is invalid, create an error message
7-2 Web S
ord in template 400. Think about what type of
input field would be best.
7-2-2 Select "Go" to start the service.
Using the Screen Painter modify screen 400 of your program. The input field for
the customer number (customernumber) is on this screen.
Create a new input field for the password of an Internet user (input field
password, field label bapiuid-password). The field password is
defined in theTOP include. Use the function Fetch from Dictionary/program
Activate the attribute upper/lower case so that the data in this field is not
automatically converted into upper case.
Change the text for the button on the screen from Book to Logon and book.
In the flow logic insert the field password into the chain conta
customernumber. This is necessary so that if the custom
was entered incorrectly, the fields will be ready for input again
Go to the subroutine logon_and_book via the module
user_command_400. Modify this subroutine so that the customer number and
the password are checked when the BAPI of the business object SCUST
called.
(type E) that the BAPI returns in the export parameter return-type
tudio:
7-2-1 Insert an input field for the passw

(C) SAP AG BC440 6-130
7-2-3 Book a flight with your customer number (1.81kg#) and the password that you
assigned in the Unit "Internet Transaction Server". If you cannot remember it,
assign a new one (see exercise 2 in Unit "ITS").

(C) SAP AG BC440 6-131
Exercises



Unit: WebTransactions
Topic: Connection to the Workbench Organizer


At the conclusion of these exercises, you will be able to:
Create service files and templates using the R/3 Workbench Organizer.

Send your service file and templates to R/3 and assign them to a WBO
task in R/3. Release your task in the request.


Studio:
8-2 R/3:
8-2-1 Assign the objects of your service to the change request created by your instructor.
8-2-2 Use the Workbench Organizer to release your task. Then the instructor will release
the joint development task. The originals of your service file and templates are in
the same system where your original program is.
8-1 Web
8-1-1 Select Add to source control to send your service together with all the files to the
R/3 System.

(C) SAP AG BC440 6-132
Exercises



Unit: WebTransactions
Topic: Theme and Language


At the conclusion of these exercises, you will be able to:
Use language dependencies in Web transactions
Define various themes for a Web transaction


Create a new theme in your service. Use p

laceholders for all the texts that
could not be transferred by R/3 screens.
9-0
us
m to a new change request in R/3, before you can make
Go into R/3, if you get the message "...not on an open
n the Web Studio.
9-1
9-1-1 the Resource Wizard, create a text file in the language DE and for the theme
9-1-2
utton on screen 100, the
older is to be transferred into the text file just created. Answer Yes to this
9-1-4
9-1-5 Select "Go" to start the service. The text you have just created should be displayed.
Note:
As you transferred your service objects to the R/3 source control at the end of the previo
exercise, you have to assign the
changes with the Web Studio.
This procedure is explained here:
correction..." i
Web Studio:
Using
99.
Think of a suitable text to use for the button in template 100 that sends the
function code /NEX. As there is no pushbutton for this b
ITS cannot transfer any text from R/3 for it at runtime.
When you enter the name of the placeholder `#...`in the template, you are asked if
the placeh
question.
9-1-3 Open the text file and enter the text for the placeholder.
Modify all the templates as the button to end the service is used in each template.
As soon as you enter `#, the placeholder is offered to you in a selection list box.

(C) SAP AG BC440 6-133
9-1-6 Create a text file in the language EN and for the theme 99. The placeholder from
the file created earlier in the language DE is copied over and you just have to
translate it.
9-1-7 You can not simply start your service in the language EN by attaching the
parameter, ~language=EN, to the URL. Beforehand you have to include
~language without a value in your service file to overwrite the default logon
language specified in Global.srvc.
9-1-8 Select "Go" to start the service. The ITS automatically generates an HTML form
which prompts you to select a logon language. To avoid this prompt, you can now,
for example, specify the logon language by including ~language=EN in the URL
to start the service.
9-1-9 Create the theme 66.
9-1-10 Copy all the files from theme 99 to the theme 66 and change the copied templates
to get a different screen display. For example, change the background color or the
headings.
9-1-11 Open your service with theme 66 by adding ?~language=DE&~theme=66 to
the URL that starts the service. Experiment with the URL.
9-2 Notepad:
9-2-1 Open the HTML page, home.html, from the Unit "HTML" and add more
hyperlinks so that Internet customers can open your service in different languages
and themes with one mouse click.
9-3 Web Browser:
9-3-1 Load your frames.html and start your service by clicking on the new hyperlink in -
home.html

(C) SAP AG BC440 6-134
Exercises



Unit: WebTransactions
Topic: Step Loop and Hyperlinks


At the conclusion of these exercises, you will be able to:
Use step loops to display internal tables
Use hyperlinks to select a row

Display the table of suitable flights with a step loop instead of with a
table control. Enable users to select table rows by hyperlink.

tudio:

10-1 Web S
0.
button sends the function code
10-1-3 Use the HTML command <a>, and the HTML
Business
function wgateURL() to
turn the loop counter into a hyperlink. Click on the loop counter to put the loop
counter value into the R/3 input field line_itab and also to send the function
code PICK to R/3. Select "Go" to start the service.
10-1-1 In R/3 the function code TC displays the flight list by table control on screen 20
SL on the other hand, displays the list by step loop on screen 210.
Change the template 100. Copy the button that sends the function code TC.
Change the copy so that this SL.
10-1-2 Change the HTML
Business
template for screen 210. Create a new column in the
table in which you display the loop counter (`j`). Select "Go" to start your
service.

(C) SAP AG BC440 6-135
Exercises



Unit: WebTransactions
Topic: Scrolling in Step Loop



At the conclusion of these exercises, you will be able to:
Use the ITS automatic scrolling of a step loop.



3 transaction, implement the scroll logic for the step loop so
that the ITS scrolls the step loop fully and sends a "long" page to the Web
browser.
11-0
nges.
rocedure is explained here: Select the new change request when the system asks you
11-1 R/3:
11-1-1
l
st +
determines the number of the first row to be displayed. In this
11-1-2 n the
11-1-3 to the newly

In your R/
Note:
As you have released your change request in an earlier exercise, you have to assign the
sub-objects of your R/3 program to a new change request, before you can save the
cha
This p
to.
The individual lines in the step loop on screen 210 are filled in the module
itab_to_steploop. In this module a row is read from the body of the interna
table itab into the structure wa. The field line_itab = line_fir
sy-stepl - 1
exercise you are going to implement a scrolling logic to modify the field
line_first.
First, change the status 210 of your program using the Menu Painter. Assig
function FIRST_PAGE to the key combination Shift-F9 and the function
PAGE_DOWN to the key combination Shift-F11. Generate the status.
Modify the module user_command_0210. Include a WHEN branch
defined functions FIRST_PAGE and PAGE_DOWN in the CASE structure. Assign
an appropriate value in the field line_first. Activate the include.

(C) SAP AG BC440 6-136
11-1-4 Start the transaction and enter the function code SL to go directly to screen 210.
the
11-2 Web Studio:
11-2-1 No changes are needed. Select Go to start your service. More than ten flights
should now be displayed in the list..
You should be able to page down using the key combination Shift-F11 in
step loop. Shift-F9 should display the first page again.

(C) SAP AG BC440 6-137
Exercises



Unit: WebTransactions
Topic: Calculating with HTML
Business


At the conclusion of these exercises, you will be able to:
Use HTML
Business
for simple calculations and branching

Calculate the number of free seats on each flight and display this number
in color.


12-1
w column in the flight list. Use HTML

lor=...>.
12-1-3 Select Go to start your service.
12-2-4 Create a placeholder for the new column heading in the template and modify your
HTRC files accordingly.

Web Studio:
12-1-1 Change the HTML
Business
template for screen 210 (step loop) so that the number of
available seats can be displayed in a ne
Business
s number. to calculate thi
12-1-2 The number of available seats should be displayed in different colors. Red - up to
10 free seats Orange - more than 10 free seats . Change the background color in the
table cell with <td bgco

(C) SAP AG BC440 6-138
Exercises



Unit: WebTransactions
Topic: Functions and Includes


At the conclusion of these exercises, you will be able to:
Implement your own functions in HTML
Business

Use includes


Encapsulate the calculations of the free seats in one function. Create this
function in an

include so that it can be used in both templates that display
the flight list.
13-1
13-1-1 function
_seats" with two input parameters seats_max and
lation and the ent in the HTML table with the function
13-1-3 e a new file in your
13-1-5
and delete the file at the beginning of the template.
13-1-7
drag & drop) in this template and the function call
Create a new heading for the new column.
Web Studio:
Open the template 210 again. At the beginning of the template define a
"write_free
seats_occ.
Copy the calculation and the IF statement from the last task in this function.
Change the names of the parameters. Use the function write() for the output.
Replace the calcu IF statem
call just created.
13-1-2 Select Go to start your service.
To be able to also use the function in the template 200, creat
. service in the theme 99. Name the file functions.html
13-1-4 Copy the function from the template 210 into the new file.
Delete the function in the template 210 and instead use the include command for
functions.html. Move the file functions.html from your project
hierarchy into the template 210
13-1-6 Select Go to start your service.
Open template 200 (table control). Also use the include command for
functions.html (by
write_free_seats.

(C) SAP AG BC440 6-139
13-1-8 Select Go to start your service.

(C) SAP AG BC440 6-140
Exercises



Unit: WebTransactions
Topic: MIME Objects


At the conclusion of these exercises, you will be able to:
Use MIME objects in Web transactions

Add language and theme-dependent background images to your
templates. Display the image of the airplane used next to the flight
details.

rowser:
Enter the following URL:

14-1 Web B
14-1-1
//<Web-Server:Port>/sap/mimes.

14-2
14-2-1
14-2-2 100. Search for the tag <body>. Change this tag to
ove the image online.gif from the service
14-2-3
e theme and language.
he
of your service to test whether another background image is
http:
Click through the subdirectories and display some MIME objects. Look especially
in the directories of the service BC440_Global.
Web Studio:
Import the service BC440_Global into your project. You should find the same
images that you saw earlier in the Web browser.
Now open the template
<body background="">. M
BC440_Global into the template. Put it exactly between the " " in <body
background="">.
Select Go to start your service.
14-2-4 The command mimeURL()generated by Web Studio does function but is static in
the sense that language and theme are almost predefined. Change the parameter in
mimeURL, so that the image URL is dependent on th
14-2-5 Select Go to start your service. Attach ?~language=EN or ?~theme=66 to t
URL at the start
actually displayed for a different language or theme.

(C) SAP AG BC440 6-141
14-2-6
14-2-7 xt to

BC440_Global to between the "" in <img src="">. This is
lly.
Think about how you could assign online the correct file name of the current
airplane to the parameter ~name in mimeURL(). Tip: You can insert character
strings in HTML
Business
with &.
14-2-8 Select Go to start your service.
Copy the changes from template 100 into the remaining templates (200, 210,
300 and 400).
Change the template 300, so that a picture of the airplane used is displayed ne
the flight details.
Use the HTML command <img src=""> and move one of the airplane images
from the service
how an image is selected statica

(C) SAP AG BC440 6-142
Exercises



Unit: WebTransactions
Topic: Context Macros


At the conclusion of these exercises, you will be able to:
Use context macros to send data by RFC to the ITS.



he German and American cities known to R/3 and send
them to the ITS. Then use this data to dynamically create selects for the
city selection.
15-1 R/3:
15-1-1 clude avwrtcxm into the include
and
15-1-2
S.
e German city after another from
eld-set between SELECT and ENDSELECT.
macro field-transport after the second ENDSELECT to send both
15-2 Web S
15-2-1 epeat loop in
erate the <option ...> entries in the HTML
15-2-2
Determine all t
Insert the instruction in
zbc440_wt_##atop. You can then use the context macros field-set
field-transport.
Go to the PBO module preset_cities of screen 100 and further to the
subroutine send_cities_to_its.
Insert additional coding that sends the list of available German/US cities to the IT
First read with the command SELECT to read on
the table sgeocity in the field string wa_city. Use the macro field-set
between SELECT and ENDSELECT.
Then read out all the US cities from the table sgeocity using another SELECT
command. Use the macro fi
Use the
city lists by RFC to the ITS.
tudio:
Change the HTML
Business
template for screen 100. Use a r
HTML
Business
to dynamically gen
Select commands for departure and destination cities.
Select Go to start your service.

(C) SAP AG BC440 6-143
15-2-3 d
as those suggested in the input fields of
To do this u rameter selected within the <option> command in the
HTML- .
15-3
15-3-1 e send_cities_to_its. Only read the cities from the
by an ITS. Use the function module
ITS_PING for this.
Make sure that in both HTML-SELECTs the cities that appear as the suggeste
value are the same your R/3 transaction.
se the pa
Select
R/3:
Enhance the subroutin
database, if your transaction is used

(C) SAP AG BC440 6-144
Exercises



Unit: WebTransactions
Topic: HTML Frames and
R/3 Subscreens


At the conclusion of these exercises, you will be able to:
Create a Web transaction that uses HTML frames



16-1 R/3:
16-1-1
SAPMZBC440WT_##B
will be referred to as your second
16-1-2 e data

ber in the marked row with your group number .
16-1-3
rred to as your second transaction". The
to now will be referred to as your first
e the sub-objects in your program.
16-2 Web S
Copy an R/3 program that uses subscreens. Create a new service file and
copy all the templates from your old service. Use the Template Wizard to
generate a template for the screen container. Change the names of all
your frame templates.
Copy the program SAPBC440WT_T_B with all its sub-objects (such as screens,
interface, includes) from the development class BC440 into your own
development class. Name your copy . From now on you are
going to work only with this copy, which
program. The program you have been working with up to now will be referred to
as your first program.
Navigate to the TOP include of your second program. You have to change th
so that bookings made with your transaction are also assigned to your travel
agency.
Replace the num 100 1##
Create the transaction code ZBC440_##B for screen 2000 of your second
program.
From now on, this transaction will be refe
transaction you have been working with up
transaction.
16-1-4 Activat
16-1-5 Test your second transaction. Book a flight (customer number 4##).
tudio:

(C) SAP AG BC440 6-145
16-2-1
of the service file.
ur
oose language-independent and theme
16-2-3 es
ject Set
rms or hyperlinks. Choose suitable names for the
16-2-6
16-2-7
16-2-8 improvements to the screen. Increase the size of
the ~messageLine in the template for screen 10, so that the message cannot be
missed. Delete the texts "Dummy" and "Banner" from the templates for screens 10
and 20 and use mimeURL() to display background images.
Select Go to start your service.
Using the Service Wizard create a new service ZBC440_##B for your transaction
in the R/3 System. View the contents
Path: File New File Wizards Service Wizard
From now you will work only with this service that is called "your second service.
The transaction you have been working with up to now will be referred to as yo
first transaction.
16-2-2 Use the Template Wizard to create new HTML
Business
templates for screens 10, 20
and in your second program. Ch 2000
99. File New File Wizards Service Wizard
Copy all the files from your first service to your second service. Change the nam
of the files to suit the second service.
16-2-4 Change your second service to "Active Service" (context menu or Pro
Active Service ZBC440_##A). Select "Go" to start your service. As you are
testing you will ascertain that your transaction has not yet been modified for
frames.
16-2-5 Make the modifications by inserting ~target=... into the function
in the HTML fo wgateURL()
frames.
Start your service with Go and book a flight. Also test error cases and cancel
buttons in the various frames.
Delete the old cancel buttons from the various templates and create a new cancel
button for screen 20. Now your second transaction is complete.
If you want, you can make more

(C) SAP AG BC440 6-146
Exercises



Unit: WebTransactions
Topic: Synchronization with Frames


At the conclusion of these exercises, you will be able to:
Implement synchronization in Web transactions with frames

Use the Web debugger to


go through your Web transaction to find out
why the synchronization is not working. Implement the synchronization
in your R/3 transaction.
17-1
17-1-1
17-1-2
d select a
different flight from the list. The ITS incorrectly sends the complete frameset again.
17-2 R/3:
17-2-1 and_2000 of your program to implement the
17-2-2
al
es: .
he table and enter the values required by the ITS into the
npro_right2.
17-3 Web S
Web Studio:
Select "Go" to start your service.
Start the Web debugger using the entry in SAPlogon. Display the list in the
browser. Select a flight and display its details. Select the Back button an
This is because your second transaction has not yet been synchronized
Go to the PAI module user_comm
necessary synchronization. The branch OTHERS already contains the call to the
subroutine special_ok_code.
Go to the subroutine special_ok_code and complete the IF statement for the
function codes AWSY and AWSS.
Use the function module ITS_GET_SYNC_INFO, so that the ITS fills an intern
table containing all the required synchronization details.
You have to define this table (row structure ) yourselv
Evaluate the rows of t
fields, dynpro_right1 and dy
Activate the include.
tudio/Web Browser/SAPlogon:

(C) SAP AG BC440 6-147
17-3-1 No changes are needed. Start your service and start the Web debugger. Display
flight details again. Select Back and choose a different flight. The debugger
indicates that synchronization has worked this time. The correct information should
now be displayed.




(C) SAP AG BC440 6-148
WebTransaction Solutions


Unit: Web Transaction
Overview of All Solutions in This Unit

All programs belong to development class BC440.
All services can be transferred by AGate.
Project Add To Project Import Import Service From Site

Exercise Service Program Transaction
1 Design - - -
2 Copy transaction
in R/3
-
3 Service wizard bc440s_wiz_s
4 Template wizard bc440s_wiz_t
5 Select and hidden bc440s_input
SAPBC440_WT_S_A_COPY BC440S_A_COPY
6 Debugger and
Synchronization
bc440s_sync SAPBC440_WT_S_A_SYNC BC440S_A_SYNCH
7 Internet user bc440s_user
8 WBO -
9 Theme and
language
bc440s_theme
10 Step loop bc440s_sl
SAPBC440_WT_S_A_USER BC440S_A_USER
11 Scrolling bc440s_sl_pag
12 Calulations bc440s_calc
13 Functions and
include
bc440s_func
14 MIMEs bc440s_mime
SAPBC440_WT_S_A_PAGING BC440S_A_PAGING
15 Field set bc440s_macro SAPBC440_WT_S_A_MACRO BC440S_A_MACRO
16 Frames bc440s_frame SAPBC440_WT_S_B_FRAME BC440S_B_FRAME
17 Frames with
synchronization
bc440s_frame_s SAPBC440_WT_S_B_FRAME_SYNC BC440S_B_FRAME_SYNC


(C) SAP AG BC440 6-149
Solutions


Unit: Web Transaction
Topic: Designing a Web Transaction

Design a Web Transaction


Determine the task flow of an online flight booking. Search for
appropriate BAPIs in R/3 and assign them to the steps in the task flow.

You will find the solution to this exercise on the last page of this unit.


(C) SAP AG BC440 6-150
Solutions


Unit: Web Transaction
Topic: Creating Dialog Transactions in R/3

Preparations for the next exercises

Create a development class. Copy a partly completed R/3 transaction.
Create a transaction code. Test the transaction.

Main program (SAPBC440_WT_S_A_COPY):
*&---------------------------------------------------------------------*
Modulpool SAPBC440_WT_S_A_COPY * *&
*& *
----------------------------------------*
*
-----------------------------------------*
KE bapisbdtin-agencynum VALUE '100'.
*&-----------------------------

INCLUDE bc440_wt_s_a_copytop.
CLUDE bc440_wt_s_a_copyo01. IN
INCLUDE bc440_wt_s_a_copyi01.
INCLUDE bc440_wt_s_a_copyf01.

Global data (BC440_WT_S_A_COPYTOP):
*&---------------------------------------------------------------------*
*& Include BC440_WT_S_A_COPYTOP
---------------------------- *&

OGRAM sapbc440_wt_s_a_copy. PR

TA agencynum LI DA

** Screen fields


(C) SAP AG BC440 6-151
DATA: ok_code LIKE sy-ucomm,
save_ok LIKE ok_code.
TA cities_initial VALUE checked.
TA list_screen LIKE sy-dynnr.
TA: rb_aa,
rb_any VALUE checked.
200 - List via Table Control
NTROLS: my_tc TYPE TABLEVIEW USING SCREEN 0200.
matic paging by ITS
LIKE sy-stepl,
line_itab LIKE line_first.
300 - Details
password LIKE bapiuid-password. "#EC NEEDED
g work area
TA: itab TYPE TABLE OF bapisflist,
wa TYPE bapisflist,
my_flightdata TYPE bapisfdeta.


TABLES sdyn_conn.

CONSTANTS checked VALUE 'X'.
DA

DA

* 100 - Input

DA
rb_lh,


*

CO

* 210 - List via Step Loop with auto

DATA: line_first


*

* 400 - Logon and Book

DATA: customernumber LIKE bapiscdeta-id,


** Internal tables and matchin

DA





(C) SAP AG BC440 6-152


PBO-Module (BC440_WT_S_A_COPYO01):
*----------------------------------------------------------------------*
----------------------------------*
-----------------------*
-------------------------------------------*
Set status and titlebar for screen 100
-----------------------------------------*
.
SET TITLEBAR '0100'.
" STATUS_0100 OUTPUT
-----------------------*
-------------------------------------------*
Set status and titlebar for screen 210
-----------------------------------------*
.
TATUS_0210 OUTPUT
------------------*
--------------------------------------*
Fill one step-loop line from internal table
-----------------------------*
rst + sy-stepl - 1.
*& Include BC440_WT_S_A_COPYO01 *
*------------------------------------

*&----------------------------------------------
*& Module STATUS_0100 OUTPUT
*&--------------------------
*
*-----------------------------
MODULE status_0100 OUTPUT

SET PF-STATUS '0100_MAIN'.


ENDMODULE.

*&----------------------------------------------
*& Module STATUS_0210 OUTPUT
*&--------------------------
*
*-----------------------------
MODULE status_0210 OUTPUT

SET PF-STATUS '0210_MAIN'.
SET TITLEBAR '0210'.

ENDMODULE. " S

*&---------------------------------------------------
*& Module ITAB_TO_STEPLOOP OUTPUT
*&-------------------------------
*
*-----------------------------------------
MODULE itab_to_steploop OUTPUT.

line_itab = line_fi

(C) SAP AG BC440 6-153

READ TABLE itab INDEX line_itab INTO wa.
ROM STEP-LOOP.
ELSE.
ENDIF.
" ITAB_TO_STEPLOOP OUTPUT
---------------------------------------------------------*
-------------------------------------------*
text
-----------------------------------------*
T.
SET TITLEBAR '0200'.
S_0200 OUTPUT
---------------*
----------------------------------*
Fill one TableControl line from internal table
--------------------------------*
DULE itab_to_tablecontrol OUTPUT.
MOVE-CORRESPONDING wa TO sdyn_conn.
" ITAB_TO_TABLECONTROL OUTPUT
-----------------------*
-------------------------------------------*
Set status and titlebar for screen 300
-----------------------------------------*
T.
IF sy-subrc <> 0.
EXIT F

MOVE-CORRESPONDING wa TO sdyn_conn.


ENDMODULE.

*&------------
*& Module STATUS_0200 OUTPUT
*&--------------------------
*
*-----------------------------
MODULE status_0200 OUTPU

SET PF-STATUS '0200_MAIN'.


ENDMODULE. " STATU

*&------------------------------------------------------
*& Module ITAB_TO_TABLECONTROL OUTPUT
*&-----------------------------------
*
*--------------------------------------
MO



ENDMODULE.

*&----------------------------------------------
*& Module STATUS_0300 OUTPUT
*&--------------------------
*
*-----------------------------
MODULE status_0300 OUTPU

(C) SAP AG BC440 6-154

SET PF-STATUS '0300_MAIN'.
SET TITLEBAR '0300'.
" STATUS_0300 OUTPUT
--------------------------------*
UT
cities
Set list of cities to ITS
---------------------------------------*
.
onn-cityfrom = 'WALLDORF'. "#EC NOTEXT
sdyn_conn-countryto = 'US'. "#EC NOTEXT
YORK'. "#EC NOTEXT
ENDIF.
PERFORM send_cities_to_its.
PRESET_CITIES OUTPUT
-------------------------------------*
---------------------------------------*
Initialize line selector
---------------------------------------------------*
DULE reset_line_itab OUTPUT.
CLEAR line_itab.
" RESET_LINE_ITAB OUTPUT
-----------------------*

ENDMODULE.

*&-------------------------------------
*& Module PRESET_CITIES OUTP
*&---------------------------------------------------------------------*
* Set default values for
*
*-------------------------------
MODULE preset_cities OUTPUT

IF cities_initial = checked.
CLEAR cities_initial.
sdyn_conn-countryfr = 'DE'. "#EC NOTEXT
sdyn_c

sdyn_conn-cityto = 'NEW




ENDMODULE. "

*&--------------------------------
*& Module RESET_LINE_ITAB OUTPUT
*&------------------------------
*
*-------------------
MO



ENDMODULE.

*&----------------------------------------------
*& Module STATUS_0400 OUTPUT

(C) SAP AG BC440 6-155
*&---------------------------------------------------------------------*
Set status and titlebar for screen 400
-----------------------------------------*
T.
SET TITLEBAR '0400'.
STATUS_0400 OUTPUT
------------------------------------------*
----------------------------------------*
Initialize password
----------------------------------------------------*
DULE clear_password OUTPUT.
CLEAR password.
---------------------------------------------------------------------*
----------------------------------*
----------------------*
-------------------------------------------*
Process "exit" ok codes for all screens
-----------------------------------------------------*
d INPUT.
CASE sy-dynnr.
0.
CASE ok_code.
*
*-----------------------------
MODULE status_0400 OUTPU

SET PF-STATUS '0400_MAIN'.


ENDMODULE. "

*&---------------------------
*& Module CLEAR_PASSWORD OUTPUT
*&-----------------------------
*
*------------------
MO



ENDMODULE. " CLEAR_PASSWORD OUTPUT

PAI-Module (BC440_WT_S_A_COPYI01):
*-
*& Include BC440_WT_S_A_COPYI01 *
*------------------------------------

*&-----------------------------------------------
*& Module EXIT_COMMAND INPUT
*&--------------------------
*
*-----------------
MODULE exit_comman


WHEN '0100'.
LEAVE TO SCREEN

WHEN '0200'.


(C) SAP AG BC440 6-156
WHEN 'EXIT'.
LEAVE PROGRAM.

WHEN 'CANCEL'.
LEAVE TO SCREEN 100.

WHEN 'STEP_BACK'.
LEAVE TO SCREEN 100.
CASE ok_code.
EP_BACK'.
LEAVE TO SCREEN 100.
CASE ok_code.
EP_BACK'.
LEAVE TO SCREEN list_screen.
CASE ok_code.


ENDCASE.

WHEN '0210'.

WHEN 'EXIT'.
LEAVE PROGRAM.

WHEN 'CANCEL'.
LEAVE TO SCREEN 100.

WHEN 'ST


ENDCASE.

WHEN '0300'.

WHEN 'EXIT'.
LEAVE PROGRAM.

WHEN 'CANCEL'.
LEAVE TO SCREEN 100.

WHEN 'ST


ENDCASE.

WHEN '0400'.


(C) SAP AG BC440 6-157
WHEN 'EXIT'.
LEAVE PROGRAM.

WHEN 'CANCEL'.
LEAVE TO SCREEN 100.

WHEN 'STEP_BACK'.
LEAVE TO SCREEN 300.
ENDCASE.
ENDCASE.
" EXIT_COMMAND INPUT
--------------------------------*
-------------------------------------------*
Copy ok code to internal data field
-------------------------------------------------*
e INPUT.
CLEAR ok_code.
OPY_OK_CODE INPUT
------------------------------*
--------------------------------------*
Process ok codes for screen 100
------------------------------------------------------*
d_0100 INPUT.
CASE save_ok.






ENDMODULE.

*&-------------------------------------
*& Module COPY_OK_CODE INPUT
*&--------------------------
*
*---------------------
MODULE copy_ok_cod

save_ok = ok_code.


ENDMODULE. " C

*&---------------------------------------
*& Module USER_COMMAND_0100 INPUT
*&-------------------------------
*
*----------------
MODULE user_comman


WHEN 'BACK'.
LEAVE TO SCREEN 0.

WHEN 'TC' OR 'SL'.

(C) SAP AG BC440 6-158
PERFORM fill_itab.

IF save_ok = 'TC'.
SET SCREEN 200.
ELSE.
0.
ENDIF.
ERS.
PERFORM special_ok_code.
ENDCASE.
SER_COMMAND_0100 INPUT
------------------------------*
--------------------------------------*
Process ok codes for screen 210
-*
DULE user_command_0210 INPUT.
PERFORM process_back. " Same coding for all screens
N 'EXIT'. " User want's to leave after saving
---
oop paging here!
K'.

SET SCREEN 21


LEAVE SCREEN.

WHEN OTH




ENDMODULE. " U

*&---------------------------------------
*& Module USER_COMMAND_0210 INPUT
*&-------------------------------
*
*---------------------------------------------------------------------
MO



CASE save_ok.

WHE
LEAVE PROGRAM.

*
* Implement step l
* ---

WHEN 'PICK'.
PERFORM read_itab.

WHEN 'STEP_BAC

(C) SAP AG BC440 6-159
LEAVE TO SCREEN 100.

WHEN OTHERS.
PERFORM special_ok_code.
ENDCASE.
SER_COMMAND_0210 INPUT
------------------------------*
--------------------------------------*
Process ok codes for screen 200
-*
DULE user_command_0200 INPUT.
PERFORM process_back. " Same coding for all screens
" User want's to leave after saving
K'.
ERS.
PERFORM special_ok_code.
ENDCASE.
SER_COMMAND_0200 INPUT
------------------------------*
--------------------------------------*




ENDMODULE. " U

*&---------------------------------------
*& Module USER_COMMAND_0200 INPUT
*&-------------------------------
*
*---------------------------------------------------------------------
MO



CASE save_ok.

WHEN 'EXIT'.
LEAVE PROGRAM.

WHEN 'PICK'.
PERFORM read_itab.

WHEN 'STEP_BAC
LEAVE TO SCREEN 100.

WHEN OTH




ENDMODULE. " U

*&---------------------------------------
*& Module USER_COMMAND_0300 INPUT
*&-------------------------------

(C) SAP AG BC440 6-160
* Process ok codes for screen 300
-*
DULE user_command_0300 INPUT.
PERFORM process_back. " Same coding for all screens
" User want's to leave after saving
K'.
n.
ERS.
PERFORM special_ok_code.
ENDCASE.
-------------------------*
----------------------------------------*
Save selected line from TableControl
-------------------------------------------*
IF sdyn_conn-mark = 'X'.
ENDIF.
ET_MARKED_LINE INPUT
------------------------------*
*---------------------------------------------------------------------
MO



CASE save_ok.

WHEN 'EXIT'.
LEAVE PROGRAM.

WHEN 'BOOK'.
LEAVE TO SCREEN 400.

WHEN 'STEP_BAC
LEAVE TO SCREEN list_scree

WHEN OTH




ENDMODULE. " USER_COMMAND_0300 INPUT


*&--------------------------------------------
*& Module GET_MARKED_LINE INPUT
*&-----------------------------
*
*---------------------------
MODULE get_marked_line INPUT.


line_itab = my_tc-current_line.


ENDMODULE. " G

*&---------------------------------------

(C) SAP AG BC440 6-161
*& Module USER_COMMAND_0400 INPUT
*&---------------------------------------------------------------------*
---------------------------------------------------------------------*
nd_0400 INPUT.
PERFORM process_back. " Same coding for all screens
" User want's to leave after saving
.
K'.
ERS.
PERFORM special_ok_code.
ENDCASE.
---------------------------------------------------------------------*
-------------------------------------------*
--------------*
---------------------------------------------------*
Process ok code BACK for all subsequent screens
-----------------------------------------------*
IF save_ok = 'BACK'.
* Process ok codes for screen 400
*-
MODULE user_comma


CASE save_ok.

WHEN 'EXIT'.
LEAVE PROGRAM.

WHEN 'LOGON'.
PERFORM logon_and_book

WHEN 'STEP_BAC
LEAVE TO SCREEN 300.

WHEN OTH




ENDMODULE. " USER_COMMAND_0400 INPUT

Subroutines (BC440_WT_S_A_COPYF01):
*-
*& Include BC440_WT_S_A_COPYF01 *
*---------------------------

*&-------------------------------------------------------
*& Form PROCESS_BACK
*&------------------
*
*-----------------------
FORM process_back.


LEAVE TO SCREEN 100.

(C) SAP AG BC440 6-162
ENDIF.
" PROCESS_BACK
---------------------------*
------------------------------------------------------*
Call BAPI to get a list of flights

RM fill_itab.
DATA my_return TYPE bapiret2. "Return structure for BAPI call
rrid = 'AA'.
onn-carrid = 'LH'.
WHEN OTHERS.
r

yto
= sdyn_conn-cityto
arrid
ernoon = sdyn_conn-mark
return = my_return
flightlist = itab.
eturn-type may indicate an error.

ENDFORM.

*&------------------------------------------
*& Form FILL_ITAB
*&---------------
*
*----------------------------------------------------------------------*
FO



CLEAR itab.

CASE checked.
WHEN rb_aa.
sdyn_conn-ca
WHEN rb_lh.
sdyn_c

CLEAR sdyn_conn-carrid.
ENDCASE.

CALL FUNCTION 'BAPI_SFLIGHT_GETLIST'
EXPORTING
fromcountrykey = sdyn_conn-countryf
fromcity = sdyn_conn-cityfrom
tocountrykey = sdyn_conn-countr
tocity
airlinecarrier = sdyn_conn-c
aft
IMPORTING

TABLES


* sy-subrc is always 0. However r


(C) SAP AG BC440 6-163
IF my_return-type <> ' ' AND my_return-type <> 'S'.
NUMBER my_return-number
WITH my_return-message_v1 my_return-message_v2
my_return-message_v3 my_return-message_v4.
step loop on 210
DESCRIBE TABLE itab LINES my_tc-lines. " Last line for TableControl
" FILL_ITAB
----------------*
------------------------------------------------------*
Get the selected line from the internal table
--------------------------------------*
RM read_itab.
DATA: line_sel LIKE sy-stepl.
apiret2. "Return structure for BAPI call
IF line_itab IS INITIAL.

S)
tab = my_tc-top_line + line_sel - 1.
ELSE.
e_itab = line_first + line_sel - 1.
MESSAGE ID my_return-id
TYPE my_return-type




ENDIF.

line_first = 1. "First visible line in


ENDFORM.

*&-----------------------------------------------------
*& Form READ_ITAB
*&---------------
*
*--------------------------------
FO



DATA my_return TYPE b


* Mark column not used
GET CURSOR LINE line_sel.

IF line_sel > 0.
* Use cursor postion for selecting (R/3 only, not IT

IF sy-dynnr = 200.
line_i

lin
ENDIF.

ELSE.

(C) SAP AG BC440 6-164
* No line selected
AGE s319(bc440). " Please mark one line
LEAVE SCREEN.

line number via input field on 210
MESSAGE s319(bc440). " Please mark one line
ecarrier = wa-carrid
IMPORTING
flightdata = my_flightdata.
eturn-type may indicate an error.
urn-type <> 'S'.
NUMBER my_return-number
WITH my_return-message_v1 my_return-message_v2
my_return-message_v3 my_return-message_v4.
ENDIF.
flightdata TO sdyn_conn.
return to here.
LEAVE TO SCREEN 300.
" READ_ITAB
MESS

ENDIF.
ENDIF.

READ TABLE itab INDEX line_itab INTO wa.
IF sy-subrc <> 0.
* illegal

LEAVE SCREEN.
ENDIF.

CALL FUNCTION 'BAPI_SFLIGHT_GETDETAIL'
EXPORTING
airlin
connectionnumber = wa-connid
dateofflight = wa-fldate

return = my_return


* sy-subrc is always 0. However r

IF my_return-type <> ' ' AND my_ret
MESSAGE ID my_return-id
TYPE my_return-type






MOVE-CORRESPONDING my_

list_screen = sy-dynnr. "Remember if user wants to


ENDFORM.

(C) SAP AG BC440 6-165

*&---------------------------------------------------------------------*
K_CODE
---------------------------------------------------------------------*
tion
RM special_ok_code.
data: sync_itab ...
--
t synchronization here
--
ENDIF.
" SPECIAL_OK_CODE
------------------------------------*
nd password
Book the flight (if possible)

RM logon_and_book.
eturn structure for BAPI call
DATA: my_bookingdata LIKE bapisbdeta,
my_bookingdata_in LIKE bapisbdtin,
--
--

*& Form SPECIAL_O
*&
* ITS synchroniza
FO

*

IF save_ok(4) = 'AWSY'.

*-
* Implemen
*-



ENDFORM.

*&---------------------------------
*& Form LOGON_AND_BOOK
*&---------------------------------------------------------------------*
* Check userno a
*
*----------------------------------------------------------------------*
FO

DATA my_return TYPE bapiret2. "R




temp LIKE sy-msgv1.

*-
* Check Customerno and password here!
*-

MOVE-CORRESPONDING my_flightdata TO my_bookingdata_in.

(C) SAP AG BC440 6-166

my_bookingdata_in-customid = customernumber.
omy class
n-agencynum = agencynum.
API_SBOOK_CREATEFROMDATA'

IMPORTING
bookingdata = my_bookingdata.
error.
" flight booked out
my_return-message_v2
turn-message_v3
message_v4.
RM fill_itab.
SET SCREEN list_screen.
my_return-message_v2
my_return-message_v3
my_return-message_v4.
my_bookingdata_in-class = 'Y'. " econ
my_bookingdata_i

CALL FUNCTION 'B
EXPORTING
bookingdata_in = my_bookingdata_in

return = my_return


* sy-subrc is always 0. However return-type may indicate an

IF my_return-type <> 'S'.
IF my_return-number = 155.

my_return-type = 'S'.
MESSAGE ID my_return-id
TYPE my_return-type
NUMBER my_return-number
WITH my_return-message_v1

my_re
my_return-

PERFO


ELSE.

MESSAGE ID my_return-id
TYPE my_return-type
NUMBER my_return-number
WITH my_return-message_v1



ENDIF.

(C) SAP AG BC440 6-167

ELSE.
CONCATENATE my_bookingdata-carrid my_bookingdata-connid
p.
ing created
temp
my_bookingdata-fldate
UNCTION 'BAPI_TRANSACTION_COMMIT'.
AVE TO SCREEN 100.
ENDIF.
" LOGON_AND_BOOK
---------------------------------*
---------------------------------------------*
Dynamic list of city for ITS
-----------------------------------------------------------------*
DATA city LIKE sgeocity-city.
--
ORM. " SEND_CITIES_TO_ITS



INTO tem


MESSAGE ID 'BC440'
TYPE 'S'
NUMBER 160 " book
WITH my_bookingdata-customid


my_bookingdata-bookid.


CALL F
LE



ENDFORM.

*&------------------------------------
*& Form SEND_CITIES_TO_ITS
*&------------------------
*
*-----
FORM send_cities_to_its.

*---
* Send cities to ITS via RFC here
*
*
* SELECT city FROM sgeocity INTO city WHERE...
*-

ENDF

(C) SAP AG BC440 6-168


(C) SAP AG BC440 6-169

(C) SAP AG BC440 6-170

(C) SAP AG BC440 6-171

(C) SAP AG BC440 6-172

(C) SAP AG BC440 6-173
Flow logic screen 100:

PROCESS BEFORE OUTPUT.
* Set status and title bar
MODULE status_0100.
* Default values for cities
MODULE preset_cities.

* ------------------------------------------------------------------

PROCESS AFTER INPUT.
* Process all at exit commands
MODULE exit_command AT EXIT-COMMAND. " Called by all screens

* Save the ok code value
MODULE copy_ok_code. " Called by all screens

* Process user command after all checks completed
CHAIN.
FIELD: sdyn_conn-countryfr, sdyn_conn-cityfrom,
sdyn_conn-countryto, sdyn_conn-cityto,
rb_aa, rb_lh, rb_any,
sdyn_conn-mark.

MODULE user_command_0100.
ENDCHAIN.
Flow logic screen 200:

PROCESS BEFORE OUTPUT.
* Set status and title bar
MODULE status_0200.

LOOP AT itab INTO wa WITH CONTROL my_tc.
* Copy one line from ITAB to TableControl
MODULE itab_to_tablecontrol.
ENDLOOP.

* Forget last choice
MODULE reset_line_itab.

(C) SAP AG BC440 6-174

* ------------------------------------------------------------------

PROCESS AFTER INPUT.
* Process all at exit commands
MODULE exit_command AT EXIT-COMMAND. " Called by all screens

* Save the ok code value
MODULE copy_ok_code. " Called by all screens

LOOP AT itab.
* Get marked line
FIELD sdyn_conn-mark MODULE get_marked_line on input.
ENDLOOP.

* Process user command after all checks completed
MODULE user_command_0200.

(C) SAP AG BC440 6-175
Flow logic screen 210:

PROCESS BEFORE OUTPUT.
* Set status and title bar
MODULE status_0210.

LOOP.
* Copy one line from ITAB to TableControl
MODULE itab_to_steploop.
ENDLOOP.

* Forget last choice
MODULE reset_line_itab.

* ------------------------------------------------------------------

PROCESS AFTER INPUT.
* Process all at exit commands
MODULE exit_command AT EXIT-COMMAND. " Called by all screens

* Save the ok code value
MODULE copy_ok_code. " Called by all screens

LOOP.
ENDLOOP.

* Process user command after all checks completed
MODULE user_command_0210.

Flow logic screen 300:

PROCESS BEFORE OUTPUT.
* Set status and title bar
MODULE status_0300.

* ------------------------------------------------------------------

PROCESS AFTER INPUT.

(C) SAP AG BC440 6-176
* Process all at exit commands
MODULE exit_command AT EXIT-COMMAND. " Called by all screens

* Save the ok code value
MODULE copy_ok_code. " Called by all screens

* Process user command after all checks completed
MODULE user_command_0300.

Flow logic screen 400:

PROCESS BEFORE OUTPUT.
* Set status and title bar
MODULE status_0400.

* Forget last password
MODULE clear_password.

* ------------------------------------------------------------------

PROCESS AFTER INPUT.
* Process all at exit commands
MODULE exit_command AT EXIT-COMMAND. " Called by all screens

* Save the ok code value
MODULE copy_ok_code. " Called by all screens

* Process user command after all checks completed
CHAIN.
FIELD: customernumber.
MODULE user_command_0400.
ENDCHAIN.

(C) SAP AG BC440 6-177
Solutions


Unit: Web Transaction
Topic: Service Wizard

Using the service wizard

Use the service wizard to create a new service. Use publish to copy the
service to AGate.
Service-Datei bc440s_wiz_s:
~transaction bc440s_a_copy


(C) SAP AG BC440 6-178
Solutions


Unit: Web Transaction
Topic: Template Wizard

Using the template wizard


Use the template wizard create templates for the screens in your R/3
ansaction. Improve the templates. Add a hyperlink to the homepage of
your travel agency to start your service.
siness
template for screen 100:
>`~windowtitle`</title>
sageLine`
wgateURL()`">
t type=text name="`SDYN_CONN-COUNTRYFR.name`" value="`SDYN_CONN-
03" size="003">`assert(SDYN_CONN-COUNTRYFR.name)`
t type=text name="`SDYN_CONN-CITYFROM.name`" value="`SDYN_CONN-
" size="020">`assert(SDYN_CONN-CITYFROM.name)`
t type=text name="`SDYN_CONN-COUNTRYTO.name`" value="`SDYN_CONN-
"003" size="003">`assert(SDYN_CONN-COUNTRYTO.name)`
t type=text name="`SDYN_CONN-CITYTO.name`" value="`SDYN_CONN-
0">`assert(SDYN_CONN-CITYTO.name)`
tr

HTML
Bu
<html>
<head>
<title
</head>
<body>
`~mes
<form method="post" action="`
<p>
`SDYN_CONN-COUNTRYFR.label`
<inpu
COUNTRYFR.value`" maxlength="0
<p>
`SDYN_CONN-CITYFROM.label`
<inpu
CITYFROM.value`" maxlength="020
<p>
`SDYN_CONN-COUNTRYTO.label`
<inpu
COUNTRYTO.value`" maxlength=
<p>
`SDYN_CONN-CITYTO.label`
<inpu
CITYTO.value`" maxlength="020" size="02

(C) SAP AG BC440 6-179
<p>
<table><!-- radiogroup %A_RB_AA -->
type=radio name="`RB_AA.group`" value="`RB_AA.name`"
elected)` checked `end`>`RB_AA.label`
>
type=radio name="`RB_LH.group`" value="`RB_LH.name`"
elected)` checked `end`>`RB_LH.label`
>
type=radio name="`RB_ANY.group`" value="`RB_ANY.name`"
selected)` checked `end`>`RB_ANY.label`
r>
<p>
typ CONN-MARK.name`" value=" ">
<input type=checkbox name="`SDYN_CONN-MARK.name`" value="`SDYN_CONN-
RK.v ue`" ed)` checked `end`>
nput type=checkbox name="`SDYN_CONN-MARK.name`" value="X" `if(SDYN_CONN-
`end`>
type=submit name="~okcode=TC" value="`BUTTON100.label`">

body>
<tr>
<td>
<input
`if(RB_AA.s
</td
</tr>
<tr>
<td>
<input
`if(RB_LH.s
</td
</tr>
<tr>
<td>
<input
`if(RB_ANY.
</td>
</t
</table>

<input e="hidden" name="`SDYN_

<!--- Template Wizard 4.6B


MA al `if(SDYN_CONN-MARK.select

Template Wizard 4.6B -->

<i
MARK.selected)` checked

`SDYN_CONN-MARK.label`
<p>
<input
</form>
</
</html>


(C) SAP AG BC440 6-180
HTML
Business
template for screen 200:
>`~windowtitle`</title>
sageline`
wgateurl()`">
_CONN-COUNTRYFR.label`
_CONN-CITYFROM.label`
_CONN-COUNTRYTO.label`
`
_CONN-CITYTO.label`
N-CITYTO.value`
with j from 1 to MY_TC.columncount`
MY_TC-column[j].title`</td>
ue="MY_TC-rowselect[`j`]"
`></td>
<html>
<head>
<title
</head>
<body>
`~mes
<form method="post" action="`
<p>
`SDYN
`SDYN_CONN-COUNTRYFR.value`
<p>
`SDYN
`SDYN_CONN-CITYFROM.value`
<p>
`SDYN
`SDYN_CONN-COUNTRYTO.value
<p>
`SDYN
`SDYN_CON
<p>
<table>
<thead>
<tr>
<td><!-- rowselection --></td>
`repeat
<td>`
`end`
</tr>
</thead>
<tbody>
`repeat with j from MY_TC.firstvisible to MY_TC.lastvisible`
<tr>
<td><input type=radio name="MY_TC" val
`if(MY_TC-rowselect[j].selected)` checked `end
<td>`SDYN_CONN-CARRID[j].value`</td>
<td>`SDYN_CONN-CONNID[j].value`</td>
<td>`SDYN_CONN-FLDATE[j].value`</td>
<td>`SDYN_CONN-AIRPFROM[j].value`</td>

(C) SAP AG BC440 6-181
<td>`SDYN_CONN-AIRPTO[j].value`</td>
<td>`SDYN_CONN-DEPTIME[j].value`</td>
SDYN_CONN-SEATSMAX[j].value`</td>
DYN_CONN-SEATSOCC[j].value`</td>
input type=submit name="~control=MY_TC,~event=nextpage"
></td>
nput type=submit name="~control=MY_TC,~event=lastpage"
age"></td>
>
ble>
/tr>
type=submit name="~okcode=PICK" value="`BUTTON200.label`">
</form>
210:
itle`</title>
wgateurl()`">
<td>`
<td>`S
</tr>
`end`
</tbody>
<tfoot>
<tr>
<table>
<tr>
<td><input type=submit name="~control=MY_TC,~event=toppage"
value="first page"></td>
<td><input type=submit name="~control=MY_TC,~event=prevpage"
value="prev page"></td>
<td><
value="next page"
<td><i
value="last p
</tr
</ta
<
</tfoot>
</table>
<p>
<input

</body>
</html>

Bu
HTML
siness
template for screen
<html>
<head>
<title>`~windowt
</head>
<body>
`~messageline`
<form method="post" action="`
<p>
`SDYN_CONN-COUNTRYFR.label`

(C) SAP AG BC440 6-182
`SDYN_CONN-COUNTRYFR.value`
<p>
`SDYN_CONN-CITYFROM.label`
`SDYN_CONN-CITYFROM.value`
<p>
`SDYN_CONN-COUNTRYTO.label`
`
N-CITYTO.label`
CITYTO.value`

SPFLI-DEPTIME.label`</td>
FLIGHT-SEATSMAX.label`</td>
SFLIGHT-SEATSOCC.label`</td>

D.max`
SDYN_CONN-DEPTIME[j].value`</td>
SDYN_CONN-SEATSMAX[j].value`</td>
DYN_CONN-SEATSOCC[j].value`</td>
end`
`SDYN_CONN-COUNTRYTO.value
<p>
`SDYN_CON
`SDYN_CONN-
<p>
<table>
<thead>
<tr>
<td>`SFLIGHT-CARRID.label`</td>
<td>`SFLIGHT-CONNID.label`</td>
<td>`SFLIGHT-FLDATE.label`</td>
<td>`SPFLI-AIRPFROM.label`</td>
<td>`SPFLI-AIRPTO.label`</td>
<td>`
<td>`S
<td>`
</tr>
</thead>
<tbody>
`repeat with j from 1 to SDYN_CONN-CARRI
<tr>
<td>`SDYN_CONN-CARRID[j].value`</td>
<td>`SDYN_CONN-CONNID[j].value`</td>
<td>`SDYN_CONN-FLDATE[j].value`</td>
<td>`SDYN_CONN-AIRPFROM[j].value`</td>
<td>`SDYN_CONN-AIRPTO[j].value`</td>
<td>`
<td>`
<td>`S
</tr>
`
</tbody>
</table>

(C) SAP AG BC440 6-183
<p>
<input type=text name="`LINE_ITAB.name`" value="`LINE_ITAB.value`"
="004" size="004">`assert(LINE_ITAB.name)`
<input type=submit name="~okcode=PICK" value="`BUTTON210.label`">
300:

method="post" action="`wgateurl()`">
_CONN-CARRID.value`
_CONN-CONNID.value`
_CONN-FLDATE.value`
_CONN-COUNTRYFR.value`
_CONN-AIRPFROM.value`
`
_CONN-COUNTRYTO.value`
maxlength

</form>
</body>
</html>

HTML
Business
template for screen
<html>
<head>
<title>`~windowtitle`</title>
</head>
<body>
`~messageline`
<form
<p>
`SDYN_CONN-CARRID.label`
`SDYN
<p>
`SDYN_CONN-CONNID.label`
`SDYN
<p>
`SDYN_CONN-FLDATE.label`
`SDYN
<p>
`SDYN_CONN-COUNTRYFR.label`
`SDYN
<p>
`SDYN_CONN-AIRPFROM.label`
`SDYN
<p>
`SDYN_CONN-COUNTRYTO.label
`SDYN
<p>
`SDYN_CONN-AIRPTO.label`
`SDYN_CONN-AIRPTO.value`
<p>
`SDYN_CONN-DISTANCE.label`

(C) SAP AG BC440 6-184
`SDYN_CONN-DISTANCE.value`
`SDYN_CONN-DISTID.value`
_CONN-DEPTIME.value`
_CONN-ARRTIME.value`
_CONN-CURRENCY.value`
_CONN-PLANETYPE.value`
_CONN-SEATSMAX.value`
N-SEATSOCC.label`
ONN-SEATSOCC.value`
<input type=submit name="~okcode=BOOK" value="`BUTTON300.label`">
template for screen 400:

<p>
`SDYN_CONN-DEPTIME.label`
`SDYN
<p>
`SDYN_CONN-ARRTIME.label`
`SDYN
<p>
`SDYN_CONN-FLTIME.label`
`SDYN_CONN-FLTIME.value`
<p>
`SDYN_CONN-PRICE.label`
`SDYN_CONN-PRICE.value`
`SDYN
<p>
`SDYN_CONN-PLANETYPE.label`
`SDYN
<p>
`SDYN_CONN-SEATSMAX.label`
`SDYN
<p>
`SDYN_CON
`SDYN_C
<p>

</form>
</body>
</html>

Business
HTML
<html>
<head>
<title>`~windowtitle`</title>
</head>
<body>
`~messageline`
<form method="post" action="`wgateurl()`">
<p>

(C) SAP AG BC440 6-185
`SCUSTOM-ID.label`
<input ty
=
pe=text name="`CUSTOMERNUMBER.name`" value="`CUSTOMERNUMBER.value`"
"008" size="008">`assert(CUSTOMERNUMBER.name)`
<input type=submit name="~okcode=LOGON" value="`BUTTON400.label`">
</body>
</html>

maxlength
<p>

</form>

(C) SAP AG BC440 6-186
Solutions


Unit: Web Transaction
Topic: Changing Input Elements

Using HTML
Business
templates.


Change the template for screen 100. Use hidden input fields and HTML
selects to input departure country and city and destination country and
city.
HTML
Business
template for screen 100 (changes in bold):
>`~windowtitle`</title>
y>

<input type=hidden name="`SDYN_CONN-COUNTRYTO.name`" value="`SDYN_CONN-
.value`" >
YFROM.name`">
<option>Hamburg
<html>
<head>
<title
</head>
<bod
<h1>`~messageLine`</h1>

<form method="post" action="`wgateURL()`">

<input type=hidden name="`SDYN_CONN-COUNTRYFR.name`" value="`SDYN_CONN-
COUNTRYFR.value`" >

COUNTRYTO

<table>

<tr> <td> `SDYN_CONN-CITYFROM.label`

<td> <select name="`SDYN_CONN-CIT

<option>Berlin


(C) SAP AG BC440 6-187
<option selected>Walldorf
TO.name`">
<option selected>New York
n Francisco
</select>
- radiogroup %A_RB_AA -->
type=radio name="`RB_AA.group`" value="`RB_AA.name`"
elected)` checked `end`>`RB_AA.label`
>
type=radio name="`RB_LH.group`" value="`RB_LH.name`"
elected)` checked `end`>`RB_LH.label`
>
type=radio name="`RB_ANY.group`" value="`RB_ANY.name`"
selected)` checked `end`>`RB_ANY.label`
r>
<p>
typ CONN-MARK.name`" value=" ">

</select>

<tr> <td> `SDYN_CONN-CITYTO.label`

<td> <select name="`SDYN_CONN-CITY

<option>Atlanta

<option>Sa



</table>

<table><!-
<tr>
<td>
<input
`if(RB_AA.s
</td
</tr>
<tr>
<td>
<input
`if(RB_LH.s
</td
</tr>
<tr>
<td>
<input
`if(RB_ANY.
</td>
</t
</table>

<input e="hidden" name="`SDYN_

<!--- Template Wizard 4.6B

(C) SAP AG BC440 6-188

ut e=checkbox name="`SDYN_CON
a `if(SDYN_CONN-MARK.selec
<inp typ N-MARK.name`" value="`SDYN_CONN-
RK.v lue`" ted)` checked `end`>
-->
e="`SDYN_CONN-MARK.name`" value="X" `if(SDYN_CONN-
lected)` checked `end`>
MARK.label`
ype=submit name="~okcode=TC" value="`BUTTON100.label`">
</form>
</body>
</html>

MA

Template Wizard 4.6B

<input type=checkbox nam
MARK.se

`SDYN_CONN-
<p>
t <input


(C) SAP AG BC440 6-189
Solutions


Unit: Web Transaction
Topic: Web Debugger and Synchronization

Using the Web debugger
Implementing synchronization in a Web Transaction.

Trace the flow of your Web Transaction with the Web debu
where the missing synchronization is. Th

gger to find
en implement the
synchronization in your R/3 transaction.
----------------------------------------*
------------------------------------------*
------------------------------------------------*
RM special_ok_code.
sitssync,
sync_wa LIKE sitssync.
'ITS_GET_SYNC_INFO'
fo = sync_itab
OTHERS = 2.
Subroutines (BC440_WT_S_A_SYNCF01):
*&-----------------------------
*& Form SPECIAL_OK_CODE
*&---------------------------
* ITS synchronization
*&---------------------
FO

DATA: sync_itab LIKE TABLE OF


IF save_ok(4) = 'AWSY'.
CALL FUNCTION
TABLES
sync_in
EXCEPTIONS
its_not_available = 1






(C) SAP AG BC440 6-190

IF sy-subrc <> 0.
MESSAGE ID sy-msgid
TYPE sy-msgty
NUMBER sy-msgno
WITH sy-msgv1
sy-msgv2
sy-msgv3
sy-msgv4.
ELSE.
READ TABLE sync_itab INTO sync_wa WITH KEY subsc = 'MAIN'.
LEAVE TO SCREEN sync_wa-dynnr.
ENDIF.
ENDIF.
ENDFORM. " SPECIAL_OK_CODE











(C) SAP AG BC440 6-191
Solutions


Unit: Web Transaction
Topic: Internet users

Using Internet users in Web Transactions

Add a subroutine to your Web Transaction to ask for the password of a
customer number.


Subroutines (BC440_WT_S_A_USERF01) (changes in bold):
*&---------------------------------------------------------------------*
*& Form LOGON_AND_BOOK
*&------------------------------------
* Check userno and password
---------------------------------*
-------------------------------------------------*
DATA my_return TYPE bapiret2. "Return structure for BAPI call
E bapisbdtin,
'
mber
my_return.
* Book the flight (if possible)
*---------------------
FORM logon_and_book.




DATA: my_bookingdata LIKE bapisbdeta,
my_bookingdata_in LIK
temp LIKE sy-msgv1.

CALL FUNCTION 'BAPI_SCUSTOMER_CHECKPASSWORD
EXPORTING
customernumber = customernu
password = password
IMPORTING
return =

(C) SAP AG BC440 6-192

IF my_return-type <> 'S'.
my_return-message_v3
my_return-message_v4.
ata_in.
er.
my_bookingdata_in-class = 'Y'. " economy class
ata_in
return = my_return
er return-type may indicate an error.
IF my_return-type <> 'S'.
. " flight booked out
my_return-message_v3
turn-message_v4.
PERFORM fill_itab.
MESSAGE ID my_return-id
TYPE 'E'
NUMBER my_return-number
WITH my_return-message_v1
my_return-message_v2


ENDIF.

MOVE-CORRESPONDING my_flightdata TO my_bookingd

my_bookingdata_in-customid = customernumb

my_bookingdata_in-agencynum = agencynum.

CALL FUNCTION 'BAPI_SBOOK_CREATEFROMDATA'
EXPORTING
bookingdata_in = my_bookingd
IMPORTING

bookingdata = my_bookingdata.

* sy-subrc is always 0. Howev


IF my_return-number = 155

my_return-type = 'S'.
MESSAGE ID my_return-id
TYPE my_return-type
NUMBER my_return-number
WITH my_return-message_v1
my_return-message_v2

my_re



(C) SAP AG BC440 6-193
SET SCREEN list_screen.
my_return-message_v3
my_return-message_v4.
.
CONCATENATE my_bookingdata-carrid my_bookingdata-connid
p.
" booking created
my_bookingdata-fldate
ANSACTION_COMMIT'.
TO SCREEN 100.
ENDFORM. " LOGON_AND_BOOK


ELSE.

MESSAGE ID my_return-id
TYPE my_return-type
NUMBER my_return-number
WITH my_return-message_v1
my_return-message_v2


ENDIF

ELSE.

INTO tem

MESSAGE ID 'BC440'
TYPE 'S'
NUMBER 160
WITH my_bookingdata-customid
temp

my_bookingdata-bookid.

CALL FUNCTION 'BAPI_TR

LEAVE

ENDIF.


(C) SAP AG BC440 6-194

(C) SAP AG BC440 6-195
Flow logic screen 400 (changes in bold):

PROCESS BEFORE OUTPUT.
* Set status and title bar
MODULE status_0400.

* Forget last password
MODULE clear_password.

* ------------------------------------------------------------------

PROCESS AFTER INPUT.
* Process all at exit commands
MODULE exit_command AT EXIT-COMMAND. " Called by all screens

* Save the ok code value
MODULE copy_ok_code. " Called by all screens

* Process user command after all checks completed
CHAIN.
FIELD: customernumber, password.
MODULE user_command_0400.
ENDCHAIN.


HTML
Business
template for screen 400 (changes in bold):
<html>
<head>
<title>`~windowtitle`</title>
</head>
<body>
<h1>`~messageLine`</h1>
<form method="post" action="`wgateURL()`">
<p>

<table>
<tr> <td> `SCUSTOM-ID.label`

(C) SAP AG BC440 6-196
<td> <input type=text name="`CUSTOMERNUMBER.name`"
value="`CUSTOMERNUMBER.value`" maxlength="008"
size="008">`assert(CUSTOMERNUMBER.name)`
<tr> <td> `BAPIUID-PASSWORD.label`
<td> <input type=password name="`PASSWORD.name`" maxlength="008"
size="008">`assert(PASSWORD.name)`
</table>

<input type=submit name="~okcode=LOGON" value="`BUTTON400.label`">
<input type=submit name="~okcode=/NEX" value="Abbrechen">

</form>
</body>
</html>



(C) SAP AG BC440 6-197
Solutions


Topic: Connecting to the WBO

Putting service files and templates under the control of the R/3
Workbench Organizer.

Send your service file and templates to R/3. Assign them to a WBO task
in R/3. Release your task in the request.

No detailed solution required.


(C) SAP AG BC440 6-198
Solutions


Topic: Theme and Language

Dealing with language dependencies in Web Transactions
Defining different themes for one Web Transaction

Create a new theme in your service. Use the placeholder for all texts that
annot be transferred by R/3 screens.

siness
template for screen (same for remaining templates; changes in
`~windowtitle`</title>
d="post" action="`wgateURL()`">
ER.name`"
008"
e)`
e="`PASSWORD.name`" maxlength="008"
"008">`assert(PASSWORD.name)`
e>
abel`">
t type=submit name="~okcode=/NEX" value="`#exit`">
c

HTML
Bu
400
bold):
<html>
<head>
<title>
</head>
<body>
<h1>`~messageLine`</h1>
<form metho
<table>
<tr> <td> `SCUSTOM-ID.label`
<td> <input type=text name="`CUSTOMERNUMB
value="`CUSTOMERNUMBER.value`" maxlength="
size="008">`assert(CUSTOMERNUMBER.nam
<tr> <td> `BAPIUID-PASSWORD.label`
<td> <input type=password nam
size=
</tabl
<p>
<input type=submit name="~okcode=LOGON" value="`BUTTON400.l
<inpu
</form>
</body>

(C) SAP AG BC440 6-199
</html>
Text file DE:
exit Abbrechen
exit Exit
Text file EN:

(C) SAP AG BC440 6-200
Solutions


Unit: Web Transaction
Topic: Step Loops and Hyperlinks

Using step loops to display internal tables
Using hyperlinks to select a row

Display the table of suitable flights using a step loop instead of a table
control. Enable users to select rows by clicking on hyperlinks.


siness
template for screen 210 (changes in bold):
`~windowtitle`</title>
wgateURL()`">

e`
NN-CITYTO.value`
HTML
Bu
<html>
<head>
<title>
</head>
<body>
<h1>`~messageLine`</h1>
<form method="post" action="`
<p>
`SDYN_CONN-COUNTRYFR.label`
`SDYN_CONN-COUNTRYFR.value`
<p>
`SDYN_CONN-CITYFROM.label`
`SDYN_CONN-CITYFROM.value`
<p>
`SDYN_CONN-COUNTRYTO.label`
`SDYN_CONN-COUNTRYTO.valu
<p>
`SDYN_CONN-CITYTO.label`
`SDYN_CO
<p>
<table>

(C) SAP AG BC440 6-201
<thead>
<tr>
<td> `#No` </td>
<td>`SFLIGHT-CARRID.label`</td>
<td>`SFLIGHT-CONNID.label`</td>
<td>`SFLIGHT-FLDATE.label`</td>
SFLIGHT-SEATSMAX.label`</td>
FLIGHT-SEATSOCC.label`</td>
to SDYN_CONN-CARRID.max`
<tr>
teURL(~OKCode="PICK", line_itab.name=j.value)`"> `j.value` </a>
SDYN_CONN-SEATSMAX[j].value`</td>
SDYN_CONN-SEATSOCC[j].value`</td>
body>
t type=submit name="~okcode=/NEX" value="`#exit`">
</body>
</html>
<td>`SPFLI-AIRPFROM.label`</td>
<td>`SPFLI-AIRPTO.label`</td>
<td>`SPFLI-DEPTIME.label`</td>
<td>`
<td>`S
</tr>
</thead>
<tbody>
`repeat with j from 1

<td align=right>

<a href="`wga

</td>
<td>`SDYN_CONN-CARRID[j].value`</td>
<td>`SDYN_CONN-CONNID[j].value`</td>
<td>`SDYN_CONN-FLDATE[j].value`</td>
<td>`SDYN_CONN-AIRPFROM[j].value`</td>
<td>`SDYN_CONN-AIRPTO[j].value`</td>
<td>`SDYN_CONN-DEPTIME[j].value`</td>
<td>`
<td>`
</tr>
`end`
</t
</table>
<p>
<inpu
</form>

(C) SAP AG BC440 6-202
Solutions


Unit: Web Transaction
Topic: Scrolling in Step Loop

Using the ITS automatic scrolling of step loops

In your R/3 transactio

n implement the scrolling logic for the step loop, so
that the ITS scrolls through the entire step loop and sends a "long" page
to the Web browser.
01) (changes in bold):
en 210
---------------------------------------------------------------------*
_back. " Same coding for all screens
WHEN 'EXIT'. " User want's to leave after saving
WHEN 'FIRST_PAGE'.
WHEN 'PAGE_DOWN'.
line_first + 10.
WHEN 'PICK'.
PAI-Module (BC440_WT_S_A_PAGINGI
*&---------------------------------------------------------------------*
*& Module USER_COMMAND_0210 INPUT
*&---------------------------------------------------------------------*
* Process ok codes for scre
*-
MODULE user_command_0210 INPUT.

PERFORM process

CASE save_ok.


LEAVE PROGRAM.


line_first = 1.


line_first =



(C) SAP AG BC440 6-203
PERFORM read_itab.
WHEN 'STEP_BACK'.
EEN 100.
WHEN OTHERS.
M special_ok_code.

ENDMODULE. " USER_COMMAND_0210 INPUT


LEAVE TO SCR


PERFOR

ENDCASE.

(C) SAP AG BC440 6-204
Solutions


Unit: Web Transaction
Topic: Calculations with HTML
Business

Using HTML
Business
for simple calculations and branching.

For each flight calculate the number of available seats and display this
number in color.


siness
template for screen 210 (changes in bold):
`~windowtitle`</title>
wgateURL()`">

e`
NN-CITYTO.value`
HTML
Bu
<html>
<head>
<title>
</head>
<body>
<h1>`~messageLine`</h1>
<form method="post" action="`
<p>
`SDYN_CONN-COUNTRYFR.label`
`SDYN_CONN-COUNTRYFR.value`
<p>
`SDYN_CONN-CITYFROM.label`
`SDYN_CONN-CITYFROM.value`
<p>
`SDYN_CONN-COUNTRYTO.label`
`SDYN_CONN-COUNTRYTO.valu
<p>
`SDYN_CONN-CITYTO.label`
`SDYN_CO
<p>
<table>

(C) SAP AG BC440 6-205
<thead>
<tr>
<td> `#No` </td>
<td>`SFLIGHT-CARRID.label`</td>
<td>`SFLIGHT-CONNID.label`</td>
<td>`SFLIGHT-FLDATE.label`</td>
MAX.label`</td>
SFLIGHT-SEATSOCC.label`</td>
free`</td>
to SDYN_CONN-CARRID.max`
<tr>
<a href="`wgateURL(~OKCode="PICK", line_itab.name=j.value)`">
>
<td>`SDYN_CONN-SEATSMAX[j].value`</td>
[j] - SDYN_CONN-SEATSOCC[j];
<= 10);
color = "green";
<td>`SPFLI-AIRPFROM.label`</td>
<td>`SPFLI-AIRPTO.label`</td>
<td>`SPFLI-DEPTIME.label`</td>
<td>`SFLIGHT-SEATS
<td>`
<td>`#
</tr>
</thead>
<tbody>
`repeat with j from 1

<td align=right>


`j.value` </a

</td>
<td>`SDYN_CONN-CARRID[j].value`</td>
<td>`SDYN_CONN-CONNID[j].value`</td>
<td>`SDYN_CONN-FLDATE[j].value`</td>
<td>`SDYN_CONN-AIRPFROM[j].value`</td>
<td>`SDYN_CONN-AIRPTO[j].value`</td>
<td>`SDYN_CONN-DEPTIME[j].value`</td>

<td>`SDYN_CONN-SEATSOCC[j].value`</td>

`free = SDYN_CONN-SEATSMAX
if (free == 0);
color = "red";
elseif (free
color = "orange";
else;

end`

(C) SAP AG BC440 6-206

<td bgcolor= `color.value`>`free.value`</td>
body>
type=submit name="~okcode=/NEX" value="`#exit`">
</form
</body>
</html>


</tr>
`end`
</t
</table>
<p>
<input
>

(C) SAP AG BC440 6-207
Solutions


Unit: Web Transaction
Topic: Functions and Includes

Implement your own functions in HTML
Business

Use includes

Put the calculation for available seats in one function. Create this fu
in an include so that th
nction
ey can be used in both the templates used to
isplay the flight list.

siness
unction calc_free_seats(max, occ)
return(free);
d`
unction write_free_seats(max, occ)
free = calc_free_seats(max, occ);
= "orange";
= "green";
end;
write("<td bgcolor=", color, ">", free, "</td>");
d

Bu
html: HTML template functions.
`f

free = max - occ;


en

`f



if (free == 0);
color = "red";
elseif (free <= 10);
color
else;
color





(C) SAP AG BC440 6-208
end`
unction show_free_seats(max, occ)
free = calc_free_seats(max, occ);
"orange";
= "green";
end;
", free, "</td><td><img src=/BC440/Images/Icons/Balls/", name,
gif> </td>");
d`
Business
template for screen 210 (same template for screen 200 ; changes in
func", ~theme="99", ~language="",
ame="functions.html")`
`~windowtitle`</title>
method="post" action="`wgateURL()`">
_CONN-COUNTRYFR.value`
_CONN-CITYFROM.value`
_CONN-COUNTRYTO.value`

`f



if (free == 0);
name = "red";
elseif (free <= 10);
name =
else;
name


write("<td>
".

en

HTML
bold):
`include(~service="bc440s_
~n

<html>
<head>
<title>
</head>
<body>
<h1>`~messageLine`</h1>
<form
<p>
`SDYN_CONN-COUNTRYFR.label`
`SDYN
<p>
`SDYN_CONN-CITYFROM.label`
`SDYN
<p>
`SDYN_CONN-COUNTRYTO.label`
`SDYN

(C) SAP AG BC440 6-209
<p>
`SDYN_CONN-CITYTO.label`
`SDYN_CONN-CITYTO.value`

SOCC.label`</td>
#free`</d>
t with j from 1 to SDYN_CONN-CARRID.max`
<td align=right>
ref="`wgateURL(~OKCode="PICK", line_itab.name=j.value)`">
.value` </a>

<td>`SDYN_CONN-SEATSOCC[j].value`</td>
SDYN_CONN-SEATSOCC[j].value)`
<p>
<table>
<thead>
<tr>
<td> `#No` </td>
<td>`SFLIGHT-CARRID.label`</td>
<td>`SFLIGHT-CONNID.label`</td>
<td>`SFLIGHT-FLDATE.label`</td>
<td>`SPFLI-AIRPFROM.label`</td>
<td>`SPFLI-AIRPTO.label`</td>
<td>`SPFLI-DEPTIME.label`</td>
<td>`SFLIGHT-SEATSMAX.label`</td>
<td>`SFLIGHT-SEAT
<td>`
</tr>
</thead>
<tbody>
`repea
<tr>


<a h
`j

</td>
<td>`SDYN_CONN-CARRID[j].value`</td>
<td>`SDYN_CONN-CONNID[j].value`</td>
<td>`SDYN_CONN-FLDATE[j].value`</td>
<td>`SDYN_CONN-AIRPFROM[j].value`</td>
<td>`SDYN_CONN-AIRPTO[j].value`</td>
<td>`SDYN_CONN-DEPTIME[j].value`</td>
<td>`SDYN_CONN-SEATSMAX[j].value`</td>


`write_free_seats(SDYN_CONN-SEATSMAX[j].value,



(C) SAP AG BC440 6-210

</tr>
`end`
</tbody>
le>
t type=submit name="~okcode=/NEX" value="`#exit`">

</html>
</tab
<p>
<inpu
</form>
</body>

(C) SAP AG BC440 6-211
Solutions


Unit: Web Transaction
Topic: MIME Objectse

Use MIME objects in a Web Transaction


Add language-dependent and theme-dependent background images to
your templates. Display the picture of the carrier used next to the flight
information.
HTML
Business
template for screen 300 (changes in bold):
kground="`mimeURL(~service="bc440_global", ~name="online.gif")`">
Line`</h1>
>
r>
<td> `SDYN_CONN-CARRID.label`
r>
<td> `SDYN_CONN-CONNID.label`
r>
<td> `SDYN_CONN-FLDATE.label`
r>
<td> `SDYN_CONN-COUNTRYFR.label`
r>
<html>
<head>
<title>`~windowtitle`</title>
</head>
<body bac
<h1>`~message
<table
<td> <table>
<t

<td> `SDYN_CONN-CARRID.value`
<t

<td> `SDYN_CONN-CONNID.value`
<t

<td> `SDYN_CONN-FLDATE.value`
<t

<td> `SDYN_CONN-COUNTRYFR.value`
<t

(C) SAP AG BC440 6-212
<td> `SDYN_CONN-AIRPFROM.label`
r>
<td> `SDYN_CONN-COUNTRYTO.label`
`
r>
<td> `SDYN_CONN-AIRPTO.label`
r>
<td> `SDYN_CONN-DISTANCE.label`
`SDYN_CONN-DISTID.value`
r>
<td> `SDYN_CONN-DEPTIME.label`
r>
<td> `SDYN_CONN-ARRTIME.label`
r>
<td> `SDYN_CONN-FLTIME.label`
r>
<td> `SDYN_CONN-PRICE.label`
N_CONN-CURRENCY.value`
r>
<td> `SDYN_CONN-PLANETYPE.label`
r>
<td> `SDYN_CONN-SEATSMAX.label`
r>
`SDYN_CONN-SEATSOCC.label`
~language="",
~name="plane/" & SDYN_CONN-PLANETYPE.value&
jpg")`">
<td> `SDYN_CONN-AIRPFROM.value`
<t

<td> `SDYN_CONN-COUNTRYTO.value
<t

<td> `SDYN_CONN-AIRPTO.value`
<t

<td> `SDYN_CONN-DISTANCE.value`
<t

<td> `SDYN_CONN-DEPTIME.value`
<t

<td> `SDYN_CONN-ARRTIME.value`
<t

<td> `SDYN_CONN-FLTIME.value`
<t

<td> `SDYN_CONN-PRICE.value` `SDY
<t

<td> `SDYN_CONN-PLANETYPE.value`
<t

<td> `SDYN_CONN-SEATSMAX.value`
<t
<td>
<td> `SDYN_CONN-SEATSOCC.value`
</table>
<td> <img src="`mimeURL(~service="bc440_global",
~theme="",


".
</table>


(C) SAP AG BC440 6-213
<form method="post" action="`wgateURL()`">
<input type=submit name="~okcode=BOOK" value="`BUTTON300.label`">
type=submit name="~okcode=/NEX" value="`#exit`">
</body>
</html>
<input
</form>

(C) SAP AG BC440 6-214
Solutions


Unit: Web Transaction
Topic: Context Macros

Use context macros to send data by RFC to the ITS.


Find out all the German and US cities known to R/3 and send them to the
ITS. Then use this data to create selects to select cities.
CROF01):
ty for ITS
---------------------------------------------------------------------*
ty.
its_not_available = 1
= 2.
FROM sgeocity INTO city WHERE country = 'DE'.
field-set 'CITY_DE' sy-dbcnt city.
FROM sgeocity INTO city WHERE country = 'US'.
Subroutines (BC440_WT_S_A_MA
*&---------------------------------------------------------------------*
*& Form SEND_CITIES_TO_ITS
*&---------------------------------------------------------------------*
* Dynamic list of ci
*-
FORM send_cities_to_its.

DATA city LIKE sgeocity-ci

CALL FUNCTION 'ITS_PING'
EXCEPTIONS

OTHERS

CHECK sy-subrc = 0.

SELECT city

ENDSELECT.

SELECT city

(C) SAP AG BC440 6-215
field-set 'CITY_US' sy-dbcnt city.
TS
siness
Template for screen 100 (changes in bold):
head>
L(~service="bc440_global", ~name="online.gif")`">

<input type=hidden name="`SDYN_CONN-COUNTRYTO.name`" value="`SDYN_CONN-
.value`" >
].max`
== SDYN_CONN-CITYFROM.value)`
`CITY_DE[i].value`
ENDSELECT.

field-transport.

ENDFORM. " SEND_CITIES_TO_I

Bu
HTML
<html>
<head>
<title>`~windowtitle`</title>
</
<body background="`mimeUR

<h1>`~messageLine`</h1>

<form method="post" action="`wgateURL()`">

<input type=hidden name="`SDYN_CONN-COUNTRYFR.name`" value="`SDYN_CONN-
COUNTRYFR.value`" >

COUNTRYTO

<table>

<tr> <td> `SDYN_CONN-CITYFROM.label`

<td> <select name="`SDYN_CONN-CITYFROM.name`">

`repeat with i from 1 to CITY_DE[i
<option `if (CITY_DE[i].value
selected `end` >

`end`

</select>

<tr> <td> `SDYN_CONN-CITYTO.label`

<td> <select name="`SDYN_CONN-CITYTO.name`">

(C) SAP AG BC440 6-216

`repeat with i from 1 to CITY_US[i
<option `if (CITY_US[i].value
].max`
== SDYN_CONN-CITYTO.value)`
`CITY_US[i].value`
</select>
>
- radiogroup %A_RB_AA -->
type=radio name="`RB_AA.group`" value="`RB_AA.name`"
elected)` checked `end`>`RB_AA.label`
>
type=radio name="`RB_LH.group`" value="`RB_LH.name`"
elected)` checked `end`>`RB_LH.label`
>
type=radio name="`RB_ANY.group`" value="`RB_ANY.name`"
selected)` checked `end`>`RB_ANY.label`
r>
<p>
me="`SDYN_CONN-MARK.name`" value="X" `if(SDYN_CONN-
`end`>
selected `end` >

`end`



</table

<p>

<table><!-
<tr>
<td>
<input
`if(RB_AA.s
</td
</tr>
<tr>
<td>
<input
`if(RB_LH.s
</td
</tr>
<tr>
<td>
<input
`if(RB_ANY.
</td>
</t
</table>

<input type="hidden" name="`SDYN_CONN-MARK.name`" value=" ">

<input type=checkbox na
MARK.selected)` checked

`SDYN_CONN-MARK.label`
<p>

(C) SAP AG BC440 6-217
<input type=submit name="~okcode=TC" value="`BUTTON100.label`">
pe=submit name="~okcode=SL" value="Step-Loop">
pe=submit name="~okcode=/NEX" value="`#exit`">

</body>
</html>
<input ty
<input ty
</form>

(C) SAP AG BC440 6-218
Solutions


Unit: Web Transaction
Topic: HTML Frames and R/3 Subscreens

Create a Web Transaction that uses HTML frames

Copy an R/3 program that uses subscreens. Create a new service file and
copy all the templates from your previous service. Use the template
wizard to get a template for the screen container. Modify all your
templates to accommodate frames.

Program SAPBC440_WT_S_B_FRAME:
*&---------------------------------------------------------------------*
*& Modulpool SAPBC440_WT_S_B_FRAME *
*& *
*&---------------------------------------------------------------------*
CLUDE bc440_wt_s_b_framef01.
---------------------------------------------------------------------*
OGRAM sapbc440_wt_s_b_frame.
CLUDE avwrtcxm.
TA agencynum LIKE bapisbdtin-agencynum VALUE '100'.

INCLUDE bc440_wt_s_b_frametop.
INCLUDE bc440_wt_s_b_frameo01.
INCLUDE bc440_wt_s_b_framei01.
IN

Global data (BC440_WT_S_B_FRAMETOP):
*&---------------------------------------------------------------------*
*& Include BC440_WT_S_B_FRAMETOP *
*&

PR

IN

DA


(C) SAP AG BC440 6-219
** Screen fields
save_ok LIKE ok_code.
BLES sdyn_conn.
TA cities_initial VALUE checked.
TA list_screen LIKE sy-dynnr.
10 - Dummy
20 - Banner
100 - Input
rb_any VALUE checked.
200 - List via Table Control
NTROLS: my_tc TYPE TABLEVIEW USING SCREEN 0200.
210 - List via Step Loop with automatic paging by ITS
line_itab LIKE line_first.
300 - Details
400 - Logon and Book
password LIKE bapiuid-password. "#EC NEEDED
2000 - Main screen

DATA: ok_code LIKE sy-ucomm,


TA

CONSTANTS checked VALUE 'X'.
DA

DA

*

*

*

DATA: rb_aa,
rb_lh,


*

CO

*

DATA: line_first LIKE sy-stepl,


*

*

DATA: customernumber LIKE bapiscdeta-id,


*

(C) SAP AG BC440 6-220

DATA: dynpro_right1 LIKE sy-dynnr VALUE '0010', "#EC NEEDED
dynpro_right2 LIKE sy-dynnr VALUE '0010'. "#EC NEEDED
Internal tables and matching work area
sflist,
my_flightdata TYPE bapisfdeta.
*----------------------------------------------------------------------*
---------------------------------------------------------------------*
-----------------------------*
------------------*
--------------------------------------*
DULE itab_to_steploop OUTPUT.
line_itab = line_first + sy-stepl - 1.
EX line_itab INTO wa.
FROM STEP-LOOP.
ORRESPONDING wa TO sdyn_conn.
ENDIF.
DMODULE. " ITAB_TO_STEPLOOP OUTPUT
-------------------------*
---------------*
----------------------------------*


**

DATA: itab TYPE TABLE OF bapi
wa TYPE bapisflist,


PBO-Module (BC440_WT_S_B_FRAMEO01):
*& Include BC440_WT_S_B_FRAMEO01 *
*-

*&----------------------------------------
*& Module ITAB_TO_STEPLOOP OUTPUT
*&---------------------------------------------------
* Fill one step-loop line from internal table
*--------------------------------
MO



READ TABLE itab IND
IF sy-subrc <> 0.
EXIT
ELSE.
MOVE-C


EN

*&--------------------------------------------
*& Module ITAB_TO_TABLECONTROL OUTPUT
*&------------------------------------------------------
* Fill one TableControl line from internal table
*------------------------------------

(C) SAP AG BC440 6-221
MODULE itab_to_tablecontrol OUTPUT.
MOVE-CORRESPONDING wa TO sdyn_conn.
DMODULE. " ITAB_TO_TABLECONTROL OUTPUT
--------------------------------*
--------------------------------*
es
-----------------------------------------*
DULE preset_cities OUTPUT.
ed.
onn-cityto = 'NEW YORK'. "#EC NOTEXT
ENDIF.
PERFORM send_cities_to_its.
DMODULE. " PRESET_CITIES OUTPUT
------------------------------*
-------------------------------------*
---------------------------------------*
DULE reset_line_itab OUTPUT.
CLEAR line_itab.
DMODULE. " RESET_LINE_ITAB OUTPUT
-------------------------------*



EN

*&-------------------------------------
*& Module PRESET_CITIES OUTPUT
*&-------------------------------------
* Set default values for citi
* Set list of cities to ITS
*-----------------------------
MO

IF cities_initial = check
CLEAR cities_initial.
sdyn_conn-countryfr = 'DE'. "#EC NOTEXT
sdyn_conn-cityfrom = 'WALLDORF'. "#EC NOTEXT
sdyn_conn-countryto = 'US'. "#EC NOTEXT
sdyn_c




EN

*&---------------------------------------
*& Module RESET_LINE_ITAB OUTPUT
*&--------------------------------
* Initialize line selector
*-------------------------------
MO



EN

*&--------------------------------------
*& Module CLEAR_PASSWORD OUTPUT

(C) SAP AG BC440 6-222
*&---------------------------------------------------------------------*
----------------------------------------*
DULE clear_password OUTPUT.
CLEAR password.
DMODULE. " CLEAR_PASSWORD OUTPUT
----------------------------------*
---------------------------------------------------------*
-------------------------------------------*
DULE status_2000 OUTPUT.
IN'.
SET TITLEBAR '2000'.
S_2000 OUTPUT
---------------------------------------------------------------------*
----------------------------------*
----------------------*
-------------------------------------------*
DULE exit_command INPUT.
LEAVE TO SCREEN 0.
DMODULE. " EXIT_COMMAND INPUT
----------------------------------*
--------------------------------*
* Initialize password
*------------------------------
MO



EN

*&-----------------------------------
*& Module STATUS_2000 OUTPUT
*&------------
* text
*---------------------------
MO

SET PF-STATUS '2000_MA


ENDMODULE. " STATU
PAI-Module (BC440_WT_S_B_FRAMEA01):
*----------------------------------------------------------------------*
*& Include BC440_WT_S_B_FRAMEI01 *
*-

*&-----------------------------------
*& Module EXIT_COMMAND INPUT
*&-----------------------------------------------
* Process "exit" ok codes for all screens
*---------------------------
MO



EN

*&-----------------------------------
*& Module COPY_OK_CODE INPUT
*&-------------------------------------

(C) SAP AG BC440 6-223
* Copy ok code to internal data field
*----------------------------------------------------------------------*
DULE copy_ok_code INPUT.
e.
CLEAR ok_code.
DMODULE. " COPY_OK_CODE INPUT
-------------------------------*
-------------------------*
----------------------------------------*
DULE get_marked_line INPUT.
line_itab = my_tc-current_line.
DMODULE. " GET_MARKED_LINE INPUT
-----------------------------*
-----------------------------*
--------------------------------------*
DULE user_command_2000 INPUT.
CASE save_ok.
screen independent
IT'.
LEAVE PROGRAM.
screen 100
MO

save_ok = ok_cod


EN


*&--------------------------------------
*& Module GET_MARKED_LINE INPUT
*&--------------------------------------------
* Save selected line from TableControl
*------------------------------
MO



EN


*&----------------------------------------
*& Module USER_COMMAND_2000 INPUT
*&----------------------------------------
* Process ok codes for screen 2000
*--------------------------------
MO



*

WHEN 'BACK' OR 'EX


*

WHEN 'TC' OR 'SL'.

(C) SAP AG BC440 6-224
* itab is filled at PAI of subscreen 100
o_right1 = '0200'.
_right1 = '0210'.
ENDIF.
screen 200 and 210
dynpro_right1 = '0300'.
screen 210 only
line_first = 1.
line_first = line_first + 10.
screen 300
dynpro_right2 = '0400'.
screen 400
PERFORM logon_and_book.
all screens
PERFORM special_ok_code.
ENDCASE.

IF save_ok = 'TC'.
dynpr
ELSE.
dynpro



*

WHEN 'PICK'.
PERFORM read_itab.


*

WHEN 'FIRST_PAGE'.


WHEN 'PAGE_DOWN'.


*

WHEN 'BOOK'.


*

WHEN 'LOGON'.


*

WHEN OTHERS.




(C) SAP AG BC440 6-225

ENDMODULE. " USER_COMMAND_2000 INPUT
--------------------------------*
-----------------------------------------------*
-----------------------------------------*
DULE check_password INPUT.
DATA my_return TYPE bapiret2. "Return structure for BAPI call
React only to "Book me!"
CHECK save_ok = 'LOGON'.
API_SCUSTOMER_CHECKPASSWORD'
mber
rd = password
return = my_return.
rn-id
my_return-message_v4.
ENDIF.
DMODULE. " CHECK_PASSWORD INPUT
-------------------------------------*
--------------------------------------*

*&-------------------------------------
*& Module CHECK_PASSWORD INPUT
*&----------------------
* check password
*-----------------------------
MO



*



CALL FUNCTION 'B
EXPORTING
customernumber = customernu
passwo
IMPORTING


IF my_return-type <> 'S'.
MESSAGE ID my_retu
TYPE 'E'
NUMBER my_return-number
WITH my_return-message_v1
my_return-message_v2
my_return-message_v3




EN

*&--------------------------------
*& Module FILL_ITAB INPUT
*&-------------------------------

(C) SAP AG BC440 6-226
* Fill itab via BAPI call
*----------------------------------------------------------------------*
DULE fill_itab INPUT.
React only to "Gimme that list!"
CHECK save_ok = 'TC' OR save_ok = 'SL'.
PERFORM fill_itab.
DMODULE. " FILL_ITAB INPUT
---------------------------------------------------------------------*
----------------------------------------------*
---------------------------*
------------------------------------------------------*
RM fill_itab.
DATA my_return TYPE bapiret2. "Return structure for BAPI call
CLEAR itab.
arrid = 'AA'.
rrid = 'LH'.
sdyn_conn-carrid.
ENDCASE.
API_SFLIGHT_GETLIST'
MO

*





EN

Subroutines (BC440_WT_S_B_FRAMEF01):
*----------------------------------------------------------------------*
*& Include BC440_WT_S_B_FRAMEF01 *
*-

*&-----------------------
*& Form FILL_ITAB
*&------------------------------------------
* Call BAPI to get a list of flights
*----------------
FO





CASE checked.
WHEN rb_aa.
sdyn_conn-c
WHEN rb_lh.
sdyn_conn-ca
WHEN OTHERS.
CLEAR


CALL FUNCTION 'B
EXPORTING

(C) SAP AG BC440 6-227
fromcountrykey = sdyn_conn-countryfr
fromcity = sdyn_conn-cityfrom
tocountrykey = sdyn_conn-countryto

oon = sdyn_conn-mark
urn = my_return
flightlist = itab.
sy-subrc is always 0. However return-type may indicate an error.
_return-type <> 'S'.
my_return-message_v3 my_return-message_v4.
ENDIF.
0
DESCRIBE TABLE itab LINES my_tc-lines. " Last line for TableControl
DFORM. " FILL_ITAB
----------------------------------------------*
----------------*
------------------------------------------------------*
RM read_itab.
DATA: line_sel LIKE sy-stepl.
DATA my_return TYPE bapiret2. "Return structure for BAPI call
L.
tocity = sdyn_conn-cityto
airlinecarrier = sdyn_conn-carrid
aftern
IMPORTING
ret
TABLES


*

IF my_return-type <> ' ' AND my
MESSAGE ID my_return-id
TYPE my_return-type
NUMBER my_return-number
WITH my_return-message_v1 my_return-message_v2




line_first = 1. "First visible line in step loop on 21


EN

*&-----------------------
*& Form READ_ITAB
*&-----------------------------------------------------
* Get the selected line from the internal table
*----------------
FO





IF line_itab IS INITIA

(C) SAP AG BC440 6-228
* Mark column not used
GET CURSOR LINE line_sel.
Use cursor postion for selecting (R/3 only, not ITS)
itab = my_tc-top_line + line_sel - 1.
tab = line_first + line_sel - 1.
ENDIF.
440). " Please mark one line
SCREEN.

ENDIF.
EX line_itab INTO wa.
440). " Please mark one line
SCREEN.
ENDIF.
API_SFLIGHT_GETDETAIL'
flight = wa-fldate
flightdata = my_flightdata.
sy-subrc is always 0. However return-type may indicate an error.
_return-type <> 'S'.

IF line_sel > 0.
*

IF sy-dynnr = 200.
line_
ELSE.
line_i


ELSE.
* No line selected
MESSAGE s319(bc
LEAVE
ENDIF.


READ TABLE itab IND
IF sy-subrc <> 0.
* illegal line number via input field on 210
MESSAGE s319(bc
LEAVE


CALL FUNCTION 'B
EXPORTING
airlinecarrier = wa-carrid
connectionnumber = wa-connid
dateof
IMPORTING
return = my_return


*

IF my_return-type <> ' ' AND my
MESSAGE ID my_return-id

(C) SAP AG BC440 6-229
TYPE my_return-type
NUMBER my_return-number
WITH my_return-message_v1 my_return-message_v2
my_return-message_v3 my_return-message_v4.
ENDIF.
MOVE-CORRESPONDING my_flightdata TO sdyn_conn.
ts to return to here
DFORM. " READ_ITAB
----------------------------------------*
------------------------------------------*
tion
RM special_ok_code.
sitssync,
sync_wa LIKE sitssync.
IF save_ok(4) = 'AWSY' OR save_ok(4) = 'AWSS'.

'ITS_GET_SYNC_INFO'
fo = sync_itab
= 2.
IF sy-subrc <> 0.
sy-msgv4.
ELSE.





list_screen = dynpro_right1. "Remember if user wan
EN

*&-----------------------------
*& Form SPECIAL_OK_CODE
*&---------------------------
* ITS synchroniza
FO

DATA: sync_itab LIKE TABLE OF



CALL FUNCTION
TABLES
sync_in
EXCEPTIONS
its_not_available = 1
OTHERS
MESSAGE ID sy-msgid
TYPE sy-msgty
NUMBER sy-msgno
WITH sy-msgv1
sy-msgv2
sy-msgv3




(C) SAP AG BC440 6-230
*---
* Implement synchronization FOR FRAMES here
--
ENDIF.
ENDIF.
ENDFORM. " SPECIAL_OK_CODE
-----------------------------------------*
------------------------------------*
-------------------------------------------------*
RM logon_and_book.
DATA my_return TYPE bapiret2. "Return structure for BAPI call
E bapisbdtin,
temp LIKE sy-msgv1.
Password check is done at PAI of subscreen 400
MOVE-CORRESPONDING my_flightdata TO my_bookingdata_in.
nomy class
my_bookingdata_in-agencynum = agencynum.
API_SBOOK_CREATEFROMDATA'
gdata_in = my_bookingdata_in
bookingdata = my_bookingdata.
*-






*&----------------------------
*& Form LOGON_AND_BOOK
*&---------------------------------
* Check userno and password
* Book the flight (if possible)
*---------------------
FO



DATA: my_bookingdata LIKE bapisbdeta,
my_bookingdata_in LIK


*


my_bookingdata_in-customid = customernumber.
my_bookingdata_in-class = 'Y'. " eco


CALL FUNCTION 'B
EXPORTING
bookin
IMPORTING
return = my_return



(C) SAP AG BC440 6-231
* sy-subrc is always 0. However return-type may indicate an error.
IF my_return-number = 155. " flight booked out

my_return-type = 'S'.
TYPE my_return-type
NUMBER my_return-number
my_return-message_v4.
en.
dynpro_right2 = '0010'.
ELSE.

my_return-message_v4.
ENDIF.
ELSE.
ta-carrid my_bookingdata-connid
INTO temp.
ng created
ingdata-customid

IF my_return-type <> 'S'.

MESSAGE ID my_return-id
WITH my_return-message_v1
my_return-message_v2
my_return-message_v3


PERFORM fill_itab.
dynpro_right1 = list_scre


MESSAGE ID my_return-id
TYPE my_return-type
NUMBER my_return-number
WITH my_return-message_v1
my_return-message_v2
my_return-message_v3



CONCATENATE my_bookingda



MESSAGE ID 'BC440'
TYPE 'S'
NUMBER 160 " booki
WITH my_book
temp

(C) SAP AG BC440 6-232
my_bookingdata-fldate
my_bookingdata-bookid.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.
dynpro_right2 = '0010'.
ENDIF.
DFORM. " LOGON_AND_BOOK
-------------------------------------*
---------------------------------*
---------------------------------------------*
FORM send_cities_to_its.
DATA city LIKE sgeocity-city.
S_PING'
its_not_available = 1
OTHERS = 2.
CHECK sy-subrc = 0.

ERE country = 'DE'.
'CITY_DE' sy-dbcnt city.
ENDSELECT.
ERE country = 'US'.
'CITY_US' sy-dbcnt city.
ENDSELECT.
field-transport.





dynpro_right1 = '0010'.



EN

*&--------------------------------
*& Form SEND_CITIES_TO_ITS
*&------------------------------------
* Dynamic list of city for ITS
*-------------------------



CALL FUNCTION 'IT
EXCEPTIONS



SELECT city FROM sgeocity INTO city WH
field-set

SELECT city FROM sgeocity INTO city WH
field-set




(C) SAP AG BC440 6-233
ENDFORM. " SEND_CITIES_TO_ITS

ODULE STATUS_0010.
010.
ODULE STATUS_0020.
* MODULE USER_COMMAND_0020.
low logic screen 100 (changes in bold):
MODULE status_0100. !!! Not allowed for SubScreens !!!
* Default values for cities
MODULE preset_cities.
* ------------------------------------------------------------------
PROCESS AFTER INPUT.
user command after all checks completed

yn_conn-cityto,
any,
sdyn_conn-mark.
nd_0100. !!! Not allowed for SubScreens !!!
module fill_itab.
ENDCHAIN.

Flow logic screen 10:
PROCESS BEFORE OUTPUT.
* M
*
PROCESS AFTER INPUT.
* MODULE USER_COMMAND_0
Flow logic screen 20:
PROCESS BEFORE OUTPUT.
* M
*
PROCESS AFTER INPUT.
F

PROCESS BEFORE OUTPUT.
* Set status and title bar
*





* Process
CHAIN.
FIELD: sdyn_conn-countryfr, sdyn_conn-cityfrom,
sdyn_conn-countryto, sd
rb_aa, rb_lh, rb_


* MODULE user_comma




(C) SAP AG BC440 6-234
Flow logic screen 200 (changes in bold):

PROCESS BEFORE OUTPUT.
* Set status and title bar
* MODULE status_0200. !!! Not allowed for SubScreens !!!

LOOP AT itab INTO wa WITH CONTROL my_tc.
* Copy one line from ITAB to TableControl
MODULE itab_to_tablecontrol.
* MODULE user_command_0200. !!! Not allowed for SubScreens !!!
MODULE reset_line_itab.
ENDLOOP.

* Forget last choice
MODULE reset_line_itab.

* ------------------------------------------------------------------

PROCESS AFTER INPUT.

LOOP AT itab.
* Get marked line
FIELD sdyn_conn-mark MODULE get_marked_line ON INPUT.
ENDLOOP.

* Process user command after all checks completed

Flow logic screen 210 (changes in bold):

PROCESS BEFORE OUTPUT.
* Set status and title bar
* MODULE status_0210. !!! Not allowed for SubScreens !!!

LOOP.
* Copy one line from ITAB to TableControl
MODULE itab_to_steploop.
ENDLOOP.

* Forget last choice

(C) SAP AG BC440 6-235

* ------------------------------------------------------------------

PROCESS AFTER INPUT.

LOOP.
ENDLOOP.

* Process user command after all checks completed
* MODULE user_command_0210. !!! Not allowed for SubScreens !!!

Flow logic screen 300 (changes in bold):
PROCESS BEFORE OUTPUT.
* ------------------------------------------------------------------

* Set status and title bar
* MODULE status_0300. !!! Not allowed for SubScreens !!!

* ------------------------------------------------------------------

PROCESS AFTER INPUT.

* Process user command after all checks completed
* MODULE user_command_0300. !!! Not allowed for SubScreens !!!

Flow logic screen 400 (changes in bold):

PROCESS BEFORE OUTPUT.
* Set status and title bar
* MODULE status_0400. !!! Not allowed for SubScreens !!!

* Forget last password
MODULE clear_password.


PROCESS AFTER INPUT.

* Process user command after all checks completed
CHAIN.

(C) SAP AG BC440 6-236
FIELD: customernumber, password.
* MODULE user_command_0400. !!! Not allowed for subscreens !!!
Module: check_password.
ENDCHAIN.
Flow logic screen 2000:
MODULE STATUS_2000.

call subscreen BANNER.

<head>

PROCESS BEFORE OUTPUT.
call subscreen BANNER including sy-cprog '0020'.
call subscreen LEFT including sy-cprog '0100'.
call subscreen RIGHT1 including sy-cprog dynpro_right1.
call subscreen RIGHT2 including sy-cprog dynpro_right2.


* ------------------------------------------------------------------
PROCESS AFTER INPUT.
* Process all at exit commands
MODULE exit_command AT EXIT-COMMAND. " Called by all screens

* Save the ok code value
MODULE copy_ok_code. " Called by all screens

* Screen specific checks
call subscreen LEFT.
call subscreen RIGHT1.
call subscreen RIGHT2.
MODULE USER_COMMAND_2000.
HTML
Business
Template for screen 10:
<html>

<LINK rel="stylesheet" href="/bc440/styles.css">
</head>

<body background="`mimeURL(~service="bc440_global", ~name="online.gif")`">

(C) SAP AG BC440 6-237

<h1> `~messageLine` </h1>

</body>
</html>

HTML
Business
Template for screen 20:


<html>
<head>
<LINK rel="stylesheet" href="/bc440/styles.css">
</head>

<body background="`mimeURL(~service="bc440_global", ~name="online.gif")`">

<table> <tr>

<td> <form method="post" action="`wgateURL(~target="_top")`">
<input type=submit name="~okcode=/NEX" value="`#exit`">
</form>

<td> <center>
<h1>BC440 - Developing Internet Application Components
<img src="/BC440/images/SAP-Logo/small.jpg" ></h1>
</center>
</table>
</body>
</html>
HTML
Business
Template for screen 100 (changes in bold):

<html>
<head>
<LINK rel="stylesheet" href="/bc440/styles.css">
</head>

<body background="`mimeURL(~service="bc440_global", ~name="online.gif")`">

<h1>`~messageLine`</h1>

(C) SAP AG BC440 6-238

<form method="post" action="`wgateURL(~target="RIGHT1")`">

<input type=hidden name="`SDYN_CONN-COUNTRYFR.name`" value="`SDYN_CONN-
COUNTRYFR.value`" >
<input type=hidden name="`SDYN_CONN-COUNTRYTO.name`" value="`SDYN_CONN-
COUNTRYTO.value`" >

<table>

<tr> <td> `SDYN_CONN-CITYFROM.label`

<td> <select name="`SDYN_CONN-CITYFROM.name`">




`repeat with i from 1 to CITY_DE[i].max`

<option `if (CITY_DE[i].value == SDYN_CONN-CITYFROM.value)`
selected `end` >

`CITY_DE[i].value`

`end`
</select>
<tr> <td> `SDYN_CONN-CITYTO.label`

<td> <select name="`SDYN_CONN-CITYTO.name`">

`repeat with i from 1 to CITY_US[i].max`

<option `if (CITY_US[i].value == SDYN_CONN-CITYTO.value)`
selected `end` >

`CITY_US[i].value`

`end`

</select>
</table>

(C) SAP AG BC440 6-239

<p>

<table><!-- radiogroup %A_RB_AA -->
<tr>
<td>
<input type=radio name="`RB_AA.group`" value="`RB_AA.name`"
`if(RB_AA.selected)` checked `end`>`RB_AA.label`
</td>
</tr>
<tr>
<td>
<input type=radio name="`RB_LH.group`" value="`RB_LH.name`"
`if(RB_LH.selected)` checked `end`>`RB_LH.label`
</td>
</tr>
<tr>
<td>
<input type=radio name="`RB_ANY.group`" value="`RB_ANY.name`"
`if(RB_ANY.selected)` checked `end`>`RB_ANY.label`
</td>
</tr>
</table>
<p>
<input type="hidden" name="`SDYN_CONN-MARK.name`" value=" ">

<!--- Template Wizard 4.6B

<input type=checkbox name="`SDYN_CONN-MARK.name`" value="`SDYN_CONN-
MARK.value`" `if(SDYN_CONN-MARK.selected)` checked `end`>

Template Wizard 4.6B -->

<input type=checkbox name="`SDYN_CONN-MARK.name`" value="X" `if(SDYN_CONN-
MARK.selected)` checked `end`>

`SDYN_CONN-MARK.label`
<p>
<input type=submit name="~okcode=TC" value="`BUTTON100.label`">
<input type=submit name="~okcode=SL" value="Step-Loop">
</form>

(C) SAP AG BC440 6-240
</body>
</html>

<head>
<body background="`mimeURL(~service="bc440_global", ~name="online.gif")`">
<td> `SDYN_CONN-CARRID.value`
<tr>
<td> `SDYN_CONN-AIRPTO.value`
<td> `SDYN_CONN-DISTANCE.value` `SDYN_CONN-DISTID.value`
HTML
Business
Template for screen 300 (changes in bold):
<html>
<LINK rel="stylesheet" href="/bc440/styles.css">
</head>

<h1>`~messageLine`</h1>
<table>
<td> <table>
<tr>
<td> `SDYN_CONN-CARRID.label`
<tr>
<td> `SDYN_CONN-CONNID.label`
<td> `SDYN_CONN-CONNID.value`
<tr>
<td> `SDYN_CONN-FLDATE.label`
<td> `SDYN_CONN-FLDATE.value`
<tr>
<td> `SDYN_CONN-COUNTRYFR.label`
<td> `SDYN_CONN-COUNTRYFR.value`
<tr>
<td> `SDYN_CONN-AIRPFROM.label`
<td> `SDYN_CONN-AIRPFROM.value`
<tr>
<td> `SDYN_CONN-COUNTRYTO.label`
<td> `SDYN_CONN-COUNTRYTO.value`
<td> `SDYN_CONN-AIRPTO.label`
<tr>
<td> `SDYN_CONN-DISTANCE.label`
<tr>
<td> `SDYN_CONN-DEPTIME.label`

(C) SAP AG BC440 6-241
<td> `SDYN_CONN-DEPTIME.value`
<tr>
~theme="",
<tr>
<td> `SDYN_CONN-ARRTIME.label`
<td> `SDYN_CONN-ARRTIME.value`
<tr>
<td> `SDYN_CONN-FLTIME.label`
<td> `SDYN_CONN-FLTIME.value`
<tr>
<td> `SDYN_CONN-PRICE.label`
<td> `SDYN_CONN-PRICE.value` `SDYN_CONN-CURRENCY.value`
<td> `SDYN_CONN-PLANETYPE.label`
<td> `SDYN_CONN-PLANETYPE.value`
<tr>
<td> `SDYN_CONN-SEATSMAX.label`
<td> `SDYN_CONN-SEATSMAX.value`
<tr>
<td> `SDYN_CONN-SEATSOCC.label`
<td> `SDYN_CONN-SEATSOCC.value`
</table>
<td> <img src="`mimeURL(~service="bc440_global",
~language="",
~name="plane/" & SDYN_CONN-PLANETYPE.value&
".jpg")`">
</table>

<form method="post" action="`wgateURL(~target="RIGHT2")`">
<input type=submit name="~okcode=BOOK" value="`BUTTON300.label`">
</form>
</body>
</html>
HTML
Business
Template for screen 400 (changes in bold):
<html>
<head>
<LINK rel="stylesheet" href="/bc440/styles.css">
</head>

<body background="`mimeURL(~service="bc440_global", ~name="online.gif")`">

(C) SAP AG BC440 6-242

<td> <input type=password name="`PASSWORD.name`" maxlength="008"
size="008">`assert(PASSWORD.name)`
</html>
<frameset rows="64%,36%">
<h1>`~messageLine`</h1>
<form method="post" action="`wgateURL(~target="_top")`">
<table>
<tr> <td> `SCUSTOM-ID.label`
<td> <input type=text name="`CUSTOMERNUMBER.name`"
value="`CUSTOMERNUMBER.value`" maxlength="008"
size="008">`assert(CUSTOMERNUMBER.name)`
<tr> <td> `BAPIUID-PASSWORD.label`
</table>
<p>
<input type=submit name="~okcode=LOGON" value="`BUTTON400.label`">
</form>
</body>
HTML
Business
template for screen 2000:
<html>
<head>
<title>`~windowtitle`</title>
</head>
<frameset rows="13%,87%">
<frame name="BANNER" src="`wgateurl(~framename="BANNER")`">
<frameset cols="37%,63%">
<frame name="LEFT" src="`wgateurl(~framename="LEFT")`">
<frame name="RIGHT1" src="`wgateurl(~framename="RIGHT1")`">
<frame name="RIGHT2" src="`wgateurl(~framename="RIGHT2")`">
</frameset>
</frameset>
</frameset>
</html>

(C) SAP AG BC440 6-243
Solutions


Unit: Web Transaction
Topic: Synchronization with Frames
Trace the flow of your Web Transaction w
Implementing synchronization of a Web Transaction with frames.



ith the Web debugger to find
where the missing synchronization is. Then implement the
synchronization in your R/3 transaction.
FRAMEF01):

tion
---------------------------------------------------------------------*
FORM special_ok_code.
DATA: sync_itab LIKE TABLE OF sitssync,
= 'AWSS'.

c_itab
vailable = 1
= 2.
Subroutines (BC440_WT_S_B_
*&---------------------------------------------------------------------*
*& Form SPECIAL_OK_CODE
*&---------------------------------------------------------------------*
* ITS synchroniza
*&


sync_wa LIKE sitssync.

IF save_ok(4) = 'AWSY' OR save_ok(4)
CALL FUNCTION 'ITS_GET_SYNC_INFO'
TABLES
sync_info = syn
EXCEPTIONS
its_not_a
OTHERS
IF sy-subrc <> 0.
MESSAGE ID sy-msgid
TYPE sy-msgty

(C) SAP AG BC440 6-244
NUMBER sy-msgno
WITH sy-msgv1
sy-msgv2
sy-msgv3
sy-msgv4.
sync_wa.
.
WHEN 'RIGHT1'.
= sync_wa-dynnr.
WHEN 'RIGHT2'.
_right2 = sync_wa-dynnr.

P.

ENDFORM. " SPECIAL_OK_CODE


ELSE.

LOOP AT sync_itab INTO

CASE sync_wa-subsc


dynpro_right1


dynpro

ENDCASE.

ENDLOO

ENDIF.

ENDIF.


(C) SAP AG BC440 6-245
SAP AG 1999
Input:
Departure city, destination city,
carrier, afternoon only
Input:
Departure city, destination city,
carrier, afternoon only
Output:
List of passenger flights
Output:
List of passenger flights
Output:
Details of one flight
Output:
Details of one flight
Input:
Customer number
and password
Input:
Customer number
and password
1
2
4 3
1 flight booked
2 Flight fully booked,
choose another from list
3 customer number or
Incorrect password
4 Database problems
BAPI_SFLIGHT_GETLIST
BAPI_SFLIGHT_GETDETAIL
BAPI_SCUSTOMER_CHECKPASSWORD
BAPI_SBOOK_CREATEFROMDATA
Solution Task Flow




(C) SAP AG BC440 7-1
SAP AG 1999
WebRFC
Templates for WebRFC Applications
Contents:
WebRFC




(C) SAP AG BC440 7-2
SAP AG 1999
Define the WebRFC
Develop WebRFC-enabled function modules
Use and modify templates for WebRFC
Release function modules for WebRFC
At the conclusion of this unit, you will be able to:
WebRFC: Unit Objectives




(C) SAP AG BC440 7-3
SAP AG 1999
C
o
u
r
s
e
O
v
e
r
v
i
e
w
P
r
e
f
a
c
e
1
2
S
u
m
m
a
r
y

a
n
d

O
u
t
l
o
o
k
9
Overview Diagram WebRFC
Internet, Intranet and WWW
Internet
Transaction
Server
HTML
Web
Transaction
Web RFC
3
6
4
Administration 8
5
7




(C) SAP AG BC440 7-4
SAP AG 1999
WebRFC
WebRFC
Templates for WebRFC Applications
Templates for WebRFC Applications
WebRFC




(C) SAP AG BC440 7-5
SAP AG 1999
R/3
R/3
ITS ITS
(AGate) (AGate)
RFC RFC
RFC RFC
SAP function module
WWW_DISPATCH_REQUEST
Any WebRFC-enabled
function module
WebRFC
Service
WebRFC



WebRFC is based on an RFC connection between the ITS and the R/3 application server
(RFC = remote function call).
The ITS transfers a parameter table to a special RFC-enabled function module in R/3 and in response
receives a table that represents either an HTML page or a MIME object.
WebRFC enables the ITS to call special function modules in R/3.
WebRFC-enabled function modules
An HTML page or a MIME object is created directly by the function module
The contents of database tables can be read or changed
Business objects can be used the same as in transactions
Transactions can be used with several WebRFC calls in succession
Within the R/3 System a simple template concept is provided
SAP has made important functions available as WebRFC-enabled function modules



(C) SAP AG BC440 7-6
SAP AG 1999
URL for Starting a WebRFC Service
Examples:
.../wgate/WebRFC/!?_function=WWW_HTML_ECHO
.../wgate/WebRFC/!?_function=WWW_MIME_OBJECT
&_object_id=SAP_LOGO
.../wgate/WebRFC/!?_function=BC440_FLIGHTS
&_airport_from = FRA
&_airport_to = JFK
&_afternoon = X
Standard syntax:
.../wgate/WebRFC/!?_function=<function module>
[&<name>=<value>]



A service file is required to use WebRFC (and WebReporting)
The WebRFC function module to be executed in R/3 is determined by the parameter _function for each
URL. This parameter is evaluated by WWW_DISPATCH_REQUEST.
Other parameters may contain values for each URL. These parameters are ignored by
WWW_DISPATCH_REQUEST, they are transferred to the function module in the _function parameter.


(C) SAP AG BC440 7-7
SAP AG 1999
Parameters for the Service WebRFC
~XGateway = sapxgwfc
~RFCGatewayHost
Name of router
~RFCGatewayService
R/3 gateway service, e.g. sapgw00
~RFCSystemType
Type of SAP System
~RFCTimeOut
Timeout for RFC to R/3 System (in minutes)
~RFCDebuggingOn
Enable debugging
~RFCDetailedError
More detailed error messages




As with WebTransactions, all the settings are copied from Global.srvc. These settings can be overwritten
or added to by the settings from the WebRFC service file.
The service parameters for the R/3 System, R/3 user and password described in the unit "Internet
Transaction Server" apply to the WebRFC.
The parameters on the above slide apply only to WebRFC and should therefore not be used in the service
file of WebTransactions.
The value of the parameter ~XGateway in a service file determines whether the AGate uses RFC or
DIAG, to connect to the R/3 application server.

(C) SAP AG BC440 7-8
SAP AG 1999
Function module
WWW_DISPATCH_REQUEST
WebRFC-enabled
function module
W
QUE
RFC RFC
RY_STRING
NAME VALUE
_function ...
... ...
RFC
HTML
ITS ITS
<HTML><HEAD>
<TITLE>...</HTML>
CONTENT_TYPE
RETURN_CODE
text/html
0
R/3 R/3
( (AGate AGate) )
RFC
WW_DISPATCH_REQUEST
Service
WebRFC



The AGate enters the name and value of all the parameters in the URL into the table
QUERY_STRING. This table is forwarded to WWW_DISPATCH_REQUEST.
In response the AGate receives:
- A complete HTML page as a table HTML or a binary object as table MIME.
- the MIME type of the result, text/html
- A return code that states whether the AGate should remain connected:
RETURN_CODE = 0: close
RETURN_CODE = 1: keep open
RETURN_CODE = 3: close and also close ITS session


(C) SAP AG BC440 7-9
SAP AG 1999
The Interface of WebRFC-enabled FMs
FUNCTION ... .
* Local interface:
* TABLES
* QUERY_STRING STRUCTURE W3QUERY
* HTML STRUCTURE W3HTML
* MIME STRUCTURE W3MIME
* CHANGING
* VALUE(CONTENT_TYPE) LIKE W3PARAM-CONT_TYPE
* VALUE(CONTENT_LENGTH)LIKE W3PARAM-CONT_LEN
* VALUE(RETURN_CODE) LIKE W3PARAM-RET_CODE



The function group SURL contains all the SAP WebRFC-enabled function modules.
- RET_CODE - INT4 10
Structure W3QUERY:
- NAME - CHAR 30
- VALUE - CHAR 250
Structure W3HTML:
- LINE - CHAR 255
Structure W3MIME:
- LINE - RAW 255
Structure W3PARAM:
- CONT_TYPE - CHAR 128
- CONT_LEN - INT4 10


(C) SAP AG BC440 7-10
SAP AG 1999
In
WWW_DISPATCH_REQUEST
WWW_DISPATCH_REQUEST
QUERY_STRING
NAME VALUE
HTML
_function WWW_HTML_ECHO
<HTML><HEAD>
<TITLE>...</HTML>
CONTENT_TYPE
RETURN_CODE
text/html
0
WWW_HTML_ECHO
WWW_HTML_ECHO
par1 Hello World
par2 Welcome to BC440
terface for WebRFC to Return HTML Page



WWW_HTML_ECHO is a WebRFC-enabled function module that SAP provides as an example. It
generates an HTML page with a table generated from the rows of the QUERY_STRING table.
To generate the HTML page, for performance reasons the AGate simply adds each row of table HTML
below the previous row.
If the individual rows of the HTML table are only partly filled with data, the generated HTML page will
contain many blank characters. These blank characters can be removed beforehand from the table
HTML using the function module WWW_PACK_TABLE.


(C) SAP AG BC440 7-11
SAP AG 1999
ABAP Code for WebRFC to Return HTML Page
FUNCTION www_html_echo.
REFRESH html.
content_type = 'text/html'.
html = '<html><body>'. APPEND html.
html = '<hr><table border=4>'. APPEND html.
html = '<tr><td>Parameter Name<td>Para. Value</tr>'.
APPEND html.
LOOP AT query_string.
CONCATENATE '<tr><td>' query_string-name '<td>
query_string-value INTO html.
APPEND html.
ENDLOOP.
html = '</table></body></html>'. APPEND html.
ENDFUNCTION.



The ABAP code shows that the process of filling the table HTML is very similar to the process of writing
HTML pages.
The advantage of this process is the high level of freedom allowed when filling table HTML. All
HTML commands can be used. For example, URLs of external HTTP objects can be entered directly.


(C) SAP AG BC440 7-12
SAP AG 1999
Releasing WebRFC-enabled Function Modules
All function modules that are to be used by WebRFC must
be explicitly released:
SAP Web Repository
Administration = Internet release
Set/cancel release
Select function module
Save




(C) SAP AG BC440 7-13
SAP AG 1999
WWW_DISPATCH_REQUEST
WWW_DISPATCH_REQUEST
QUERY_STRING
NAME VALUE
_function WWW_GET_MIME_OBJECT
_object_id SAP-LOGO
MIME
6482659975342415768
2566543245778900000
CONTENT_TYPE
CONTENT_LENGTH
RETURN_CODE
image/gif
56901
0
WWW_GET_MIME_OBJECT
WWW_GET_MIME_OBJECT
Interface for WebRFC to Return MIME Object



Instead of filling the table HTML, a function module may fill the MIME table whose rows represent one
MIME object.
If this is the case, AGate receives.
- The MIME object as a table (structure W3MIME)
- The MIME type that the Web browser needs to display the correct format
- The size (length) of the MIME object in bytes
- The Return code that states whether the AGate should remain connected.
WWW_GET_MIME_OBJECT is a WebRFC-enabled function module delivered by SAP as an example.
Using ABAP tools it reads the data in a MIME object from an R/3 database table and enters the
data in the table MIME.



(C) SAP AG BC440 7-14
SAP AG 1999
ABAP Code for WebRFC to Return MIME Object
FUNCTION www_get_mime_object.
REFRESH mime.
READ TABLE query_string WITH KEY name = '_OBJECT_ID'.
key-objid = query_string-value.
IMPORT mime FROM DATABASE wwwdata(MI) ID key.
SELECT * FROM wwwparams INTO TABLE params
WHERE relid = 'MI' AND objid = key-objid.
READ TABLE params WITH KEY name = 'mimetype'.
content_type = params-value.
TRANSLATE content_type TO LOWER CASE.
READ TABLE params WITH KEY name = 'filesize'.
content_length = params-value.
ENDFUNCTION.



For clarity, the queries from SY-SUBRC have been omitted after the read commands.



(C) SAP AG BC440 7-15
SAP AG 2001
WWWDATA
SAP Web Repository - MIME Objects
General functions
Maintain MIME types
Assign MIME editors
Maintaining MIME objects in table WWWDATA
Creating, changing and deleting
Importing and exporting
Maintain descriptions



All MIME objects used for WebRFC are in the database table WWWDATA.
If objects are to be saved in this table, the MIME type must also exist. A MIME type is therefore
assigned to each required file extension. The MIME type is automatically saved when objects are
imported into R/3.

(C) SAP AG BC440 7-16
SAP AG 1999
Other Modules in the SURL Function Group
WWW_MODEL_MODULE
Blank template for customers to use for developing their own modules
WWW_ITAB_TO_HTML
Can convert any internal table into HTML table
WWW_ERROR_MESSAGE
Creates HTML appropriate for ABAP message
WWW_URL_PREFIX
Creates URLs dynamically for making other WebRFC calls
WWW_PACK_TABLE
Removes redundant blank characters from filled HTML tables




(C) SAP AG BC440 7-17
SAP AG 1999
1 1 2 2 3 3
8 8 7 7 6 6
5 5
4 4
R/3 R/3
application application
server server
W
G
a
t
e
H
T
T
P
s
e
r
v
e
r
DIAG
TCP/IP
HTTP
RFC
WebRFC Debugging
W
e
b
B
r
o
w
s
e
r
A
G
a
t
e
S
A
P
G
U
I



WebRFC applications can only be debugged if the Web browser that opens the service is running on the
same computer as the AGate. The SAPGUI with which the debugging is carried out is automatically
started on this computer.
The AGate usually runs as a Window NT service and can therefore not display SAPGUI. The AGate
must be started by the user wanting to debug the WebRFC service:
- Stop the ITS service via the control field or ITS Administration Tools (for more information see
Unit "Administration").
- Start AGate (agate.exe /v <virtueller ITS>).
To set up ITS service for WebRFC debugging:
- Set status of service parameter ~RFCDebuggingOn to 1 in the relevant service file
To debug service
- In the Web browser open the service on the AGate computer. A SAPGUI for debugging is
automatically opened.
- Debug the function module in R/3 with SAPGUI
- The SAPGUI connection closes at the same time as the service



(C) SAP AG BC440 7-18
SAP AG 1999
WebRFC
WebRFC
Templates for WebRFC Applications
Templates for WebRFC Applications
WebRFC




(C) SAP AG BC440 7-19
SAP AG 1999
WebRFC-enabled function module
WWW_HTML_MERGER
Template name and data for place holders
HTML page with place holders
HTML page
R/3 R/3
WWWDATA
Templates for WebRFC Applications
1 1 3 3
2 2
1 1
2 2
3 3



Table HTML can also be filled using templates. Unlike Web Transaction templates, the templates
used in WebRFC are kept in the table WWWDATA in R/3, not in the file system of AGate.
The function module WWW_HTML_MERGER generates a filled HTML table from a template and data for
the placeholders.

(C) SAP AG BC440 7-20
SAP AG 2001
WWWDATA
S
General functions
Maintain MIME types
Assign MIME editors
Maintaining HTML templates in table WWWDATA
Creating, changing and deleting
Importing and exporting
Maintain descriptions
AP Web Repository - HTML Templates



As well as the MIME objects used for WebRFC, the HTML templates for WebRFC applications are also
kept in the database table WWWDATA.
SAP templates should not be directly modified, they should first be copied to the customer name space
(beginning with Z).

(C) SAP AG BC440 7-21
SAP AG 1999
Example of an HTML Template
BC440_FLIGHT_LIST
WWWDATA
<html>
<head> <title><!title!></title> </head>
<body> <table border=1>
<tr> <th> CARRID </th> <th> CONNID </th>
<th> AIRPFROM </th> <th> AIRPTO </th>
<th> DEPTIME </th> <th> FLTIME </th>
</tr>
<tr>
<!line!>
</tr>
</table> </body> </html>



Any character string in the template can be specified as a placeholder and replaced by
HTML_TEMPLATE_MERGER.


(C) SAP AG BC440 7-22
SAP AG 1999
C
WebRFC-enabled function module
WebRFC-enabled function module
HTML_TABLE
<HTML><HEAD>
<TITLE>...</HTML>
TEMPLATE
MERGE_TEXTPOOL
BC440_FLIGHT_LIST
MERGE_T
WWW_HTML_MERGER
WWW_HTML_MERGER
SAPBC440_100.html
ABLE
NAME COMMAND HTML
<!abc!> B
<!xyz!> A
alling WWW_HTML_MERGER



The function module WWW_HTML_MERGER needs the name of an HTML template to access the
database table WWWDATA.
The table MERGE_TABLE defines which character strings are to be searched and how they are to be
replaced. (see next slide). One character string can be replaced by more than one HTML line.
WWW_HTML_MERGER can also search by character strings of the form <text-xxx>. You need
to know the name of the ABAP program whose text symbols are to be used for the replacement.
Text symbols are text literals that are defined outside of the actual ABAP coding. The advantage of text
symbols over text literals is that they can be translated into other languages without needing to edit the
ABAP program.


(C) SAP AG BC440 7-23
SAP AG 1999
Commands for WWW_HTML_MERGER
Allowed values in MERGE_TABLE-COMMAND
' ' - Replaces the whole row (standard)
'B' - Replaces the row before the placeholder
'A' - Replaces the row after the placeholder
'R' - Replaces the placeholder




(C) SAP AG BC440 7-24
SAP AG 1999
Define the WebRFC concept
Develop WebRFC-enabled function modules
Use and modify templates for WebRFC
Release function modules for WebRFC
You are now able to:
WebRFC: Unit Summary




(C) SAP AG BC440 7-25
Web RFC: Exercises



Unit: WebRFC
Topic: Static HTML Pages
At the conclusion of these exercises, you will be able to:
Create a new WebRFC-enabled function module This function module
should cr

Create WebRFC-enabled function modules
Release function modules for WebRFC





eate a new HTML page containing hyperlinks to your travel
agency.
1-1
1-1-1
p SURL
1-1-2 so
ing (<h1>...</h1>) and a
m the HTML unit.
1-1-3 Activate the function module.
1-2
1-2-1
ate/webrfc/!
r message saying that the function module is not
released for the Internet.
1-3 R/3
1-3-1 Release your function module in the Web Repository.
1-4
R/3:
Create a new function group zbc440_##. Copy the function module
WWW_MODEL_MODULE (from function grou ) into your function group.
Name the copy Z_BC440_##_STATIC.
Change the source code in your function module. Insert ABAP commands
that a function module creates an HTML page containing the following:
1. the name of your travel agency as the main head
hyperlink to your frame set fro
Web Browser:
Start the WebRFC call with the URL:
http://<Web-Server>/scripts/wg
?_function=Z_BC440_##_STATIC.
You should receive an erro
:
Web Browser:

(C) SAP AG BC440 7-26
1-4-1 Restart the WebRFC call. Follow the link to your frame set.

(C) SAP AG BC440 7-27
Web RFC: Exercises



Unit: WebRFC
Topic: Evaluating QUERY_STRING


At the conclusion of these exercises, you will be able to:
Evaluate table QUERY_STRING
Test WebRFC-enabled function modules in R/3



Create a new WebRFC-enabled function module This function module
generates a list of flights.
2-1 R/3:
2-1-1 Copy the function module WWW_MODEL_MODULE (from function group SURL)
into your function group again. Name the copy Z_BC440_##_FLIGHTLIST.
2-1-2 Change the source code in your function module. Insert ABAP commands for
the following requirements:
Read out the lines with name=FROM and name=TO from the internal table
QUERY_STRING. Save the values (QUERY_STRING-VALUE) in two help fields.
Select suitable flight connections from the data table SPFLI. Use both the help fields.
Create an HTML page with a table containing the retrieved connections. Enter data in the
header lines of the internal table HTML and use APPEND HTML to transfer the data into the
body of the internal table.
Generate an HTML page with an error message in case no connections are found.
2-1-3 Activate the function module.
2-1-4 Test the function module in the test environment. Fill the table with the lines
(FROM, FRA) and (TO, JFK) before the call.
2-1-5 Release your function module in the Web Repository.
2-2 Web Browser:

(C) SAP AG BC440 7-28
2-2-1 Start the WebRFC call with the URL:
/<Web-Server>/scripts/wgate/webrfc/!
&FROM=FRA&TO=JFK


http:/
?_function=Z_BC440_##_FLIGTHLIST

(C) SAP AG BC440 7-29
WebRFC Solutions


Unit: WebRFC
Topic: Static HTML Pages
Creating WebRFC-enabled function modules
Releasing function modules for WebRFC



Create a WebRFC-enabled function module. This function module is to
create an HTML page containing a hyperlink to the homepage of your
travel agency.
Function module BC440_WR_S_STATIC:
FUNCTION bc440_wr_s_static .
*"----------------------------------------------------------------------
*"*"Local interface:
*" TABLES
*" QUERY_STRING STRUCTURE W3QUERY
*" HTML STRUCTURE W3HTML
*" MIME STRUCTURE W3MIME
*" CHANGING
*" VALUE(RETURN_CODE) LIKE W3PARAM-RET_CODE OPTIONAL
*" VALUE(CONTENT_TYPE) LIKE W3PARAM-CONT_TYPE OPTIONAL
*" VALUE(CONTENT_LENGTH) LIKE W3PARAM-CONT_LEN OPTIONAL
*"----------------------------------------------------------------------

REFRESH html.
content_type = 'text/html'.

CONCATENATE '<html> <head> <title>'
'Solution WebRFC'(001)
'</title> </head> <body> <font face=arial>'
INTO html.
APPEND html.


(C) SAP AG BC440 7-30
CONCATENATE '<H1><font color=blue>Real Weird Vacations</font></H1>'
'can be found'(002)
'<a href='
'"/BC440/unit04/Solutions/Exercise06/frames.html">'
'h
'<a></font> </body> </html>'
INTO html. "#EC NOTEXT
APPEND html.

ENDFUNCTION.
ere'(003)

(C) SAP AG BC440 7-31
WebRFC Solutions

aluating QUERY_STRING

Unit: WebRFC
Topic: Ev
Evaluating table QUERY_STRING
Testing WebRFC-enabled function modules in R/3


Create a WebRFC-enabled function module. This fu

nction module is to
e BC440_WR_S_FLIGHTLIST:
NCTION bc440_wr_s_flightlist .
----------------------
*" TABLES
ERY
HTML STRUCTURE W3HTML
IONAL
PTIONAL
OPTIONAL
----------------------------------------------------
DATA: airpfrom LIKE spfli-airpfrom,
airpto LIKE spfli-airpto.
* Empty HTML page
REFRESH html.
content_type = 'text/html'.
create a list of flights.
Function modul
FU
*"------------------------------------------------
*"*"Local interface:
*" QUERY_STRING STRUCTURE W3QU
*"
*" MIME STRUCTURE W3MIME
*" CHANGING
*" VALUE(RETURN_CODE) LIKE W3PARAM-RET_CODE OPT
*" VALUE(CONTENT_TYPE) LIKE W3PARAM-CONT_TYPE O
*" VALUE(CONTENT_LENGTH) LIKE W3PARAM-CONT_LEN
*"------------------


TABLES: spfli.





(C) SAP AG BC440 7-32

* Scan QUERY_STRING for restrictions
READ TABLE query_string WITH KEY name = 'FROM'.
ing-value TO airpfrom.
ENDIF.
READ TABLE query_string WITH KEY name = 'TO'.

, body and table including headings
CONCATENATE '<html> <head> <title>'
'Solution WebRFC'(001)
'</title> </head> <body> <table border=1>'
'<tr> <th> CARRID </th> <th> CONNID </th>'
'<th> AIRPFROM </th> <th> AIRPTO </th>'
'<th> DEPTIME </th> <th> FLTIME </th>'
INTO html. "#EC NOTEXT
APPEND html.

* Fetch data from database to create table lines
SELECT * FROM spfli
WHERE airpfrom = airpfrom
AND airpto = airpto.

* Text fields may be concatenated into HTML directly
CONCATENATE '<tr> <td>' spfli-carrid '</td>'
'<td>' spfli-connid '</td>'
'<td>' spfli-airpfrom '</td>'
'<td>' spfli-airpto '</td>'
INTO html.
APPEND html.

* "Print" depature time and duration of flight to get external format
html = '<td>'.
WRITE spfli-deptime TO html+4.
APPEND html.

IF sy-subrc EQ 0.
MOVE query_str



IF sy-subrc EQ 0.
MOVE query_string-value TO airpto.
ENDIF.

* Create head



(C) SAP AG BC440 7-33


html = '</td> <td>'.
WRITE spfli-fltime TO html+10.
APPEND html.

html = '</td></tr>'.
APPEND html.

ENDSELECT.

* Close table, body and HTML page
html = '</table> </body> </html>'.
APPEND html.

ENDFUNCTION.



(C) SAP AG BC440 8-1
SAP AG 1999
Scalability
Security Issues
Installation
Administration at runtime
ITS Administration Tool
Contents
Administration




(C) SAP AG BC440 8-2
SAP AG 1999
Install and deinstall the ITS
Start and stop the ITS
Configure the ITS
Use system templates
Evaluate logs
Use the Admin Tool
At the conclusion of this unit, you will be able to:
Administration Unit Objectives




(C) SAP AG BC440 8-3
SAP AG 1999
C
o
u
r
s
e
O
v
e
r
v
i
e
w
P
r
e
f
a
c
e
1
2
S
u
m
m
a
r
y

a
n
d

O
u
t
l
o
o
k
9
Overview Diagram Administration
Internet, Intranet and WWW
Internet
Transaction
Server
HTML
Web
Transaction
Web RFC
3
6 7
4
Administration
5
8




(C) SAP AG BC440 8-4
SAP AG 1999
Scalability
Scalability
Security Issues
Security Issues
Installation
Installation
Administration at Runtime
Administration at Runtime
The ITS Admin Tool
The ITS Admin Tool
Administration




(C) SAP AG BC440 8-5
SAP AG 1999
Scalability - External View
server and one
One AGate can be used by several WGates and one AGate can
use several R/3 application servers
ITS ITS
W
G
Web Web HTTP HTTP
R/3 R/3
applicatio applicatio
CGI CGI
A
G
TCP/IP TCP/IP
RFC RFC
DIAG DIAG
a
t
e
HTTP HTTP
t
e
n n m m 1 1 n n n n m m
n
n
1 1 1
browser browser server server
Many Web browsers using many HTTP servers
Each WGate is assigned to precisely one HTTP
AGate
n n
server server
a




(C) SAP AG BC440 8-6
SAP AG 1999
AGate AGate
Session memory Session memory
Dispatcher thread Worker thread Occupied
Structure of the AGate



The ITS works with internal parallelism, so several worker threads can run at the same time. A special
dispatcher thread assigns a request to a worker thread.
The session memory contains the internal status of an IAC. The ITS can assign the required amount of
session memory to a request by evaluating an HTTP cookie which was sent by the ITS with the first
response to the Web browser for a new session, or which uses the session ID that is hidden in the most
recent page generated by the ITS.
In each session the following data is stored: Connection data (TCP/IP address of client, R/3 connection
data and current R/3 screen); settings in the service files (such as language, topic);
time the timeout mechanism was last set; synchronization information (such as screen numbers,
sub-screen numbers)
Data flow in a request-response cycle:
- Request from the WGate reaches the dispatcher thread. An available worker thread is assigned to it.
The worker thread reads the relevant session memory.
- Request made to R/3 (DIAG or RFC ), response received from R/3 (screen or internal table).
- The worker thread converts the R/3 response into HTML
- The worker thread writes the data to the relevant session memory
- The worker thread sends the response to the WGate.
- The worker thread becomes available for use again.

(C) SAP AG BC440 8-7
SAP AG 1999
Scalability
Scalability
Security Issues
Security Issues
Installation
Installation
Administration at runtime
Administration at runtime
ITS Administration Tool
ITS Administration Tool
dministration A




(C) SAP AG BC440 8-8
SAP AG 1999
The Internet is open to all
Data in R/3 is confidential
The ITS connects the Internet with
an R/3 System
What Is the Problem?



As the "global network of all networks", the Internet is an open, insecure system. Data packets are
tra
Ther t
"I
Data d by the R/3 authorization concept.
e security measures required to protect R/3 data so that access to it from the
In


nsmitted using TCP/IP from server to server. In principle, data can be copied or corrupted in transit.
e are safety protocols that should be used to transfer data securely across the Internet (see Uni
nternet, Intranet and WWW").
in R/3 Systems is protecte
This section outlines th
ternet is also secure.

(C) SAP AG BC440 8-9
SAP AG 1999
1 1
2 2
3 3
R/3 R/3
application application
server server ITS ITS
W
G
HTTP HTTP CGI CGI
A
G
TCP/IP TCP/IP
RFC RFC
1 1 3 3
a
t
e
t
e DIAG DIAG
Web Web
Browser Browser
HTTP HTTP
server server
a
Access to the HTTP server
Access to data in R/3
Access to service files
and HTML
Business
templates
laces Where Security is Critical P
Service
files
HTML
Business
templates
2 2



Access to the HTTP server
- The computer on which the HTTP server runs, should only be able to receive TCP/IP requests for
HTTP and should not be able to receive requests for any other service (for example, Telnet).
- The connection between the Web browser and the HTTP server must be secure. Data cannot be
bugged and/or corrupted.
Access to the AGate:
- Service files contain information about the R/3 System (such as name, user, passwords, transaction
codes). This file must be protected from being read and modified by non-authorized persons.
- The HTMLBusiness Templates must also be protected from being modified because the HTML
pages generated from the templates are sent in the name of the operator.
- The connection between the Web browser and the HTTP server must be secure. Data cannot be
bugged and/or corrupted.
Access to data in the R/3 System:
- The data in R/3 is very secure, provided that authorization settings in an IAC are correct
- You can restrict access to the application server/s for security purposes.



(C) SAP AG BC440 8-10
SAP AG 1999
HTTP HTTP
server server
R/3 R/3
application application
server server
ITS ITS
W
G
a
t
e
A
G
a
t
e
CGI CGI TCP/IP TCP/IP HTTPS HTTPS
HTTP or
HTTP-S
GUI or RFC ports, SNC,
(SAProuter also possible)
Security - Protecting the Server
RFC RFC
DIAG DIAG



HTTPS should be used to ensure secure communication between the Web browser and the HTTP
server.
The HTTP server can be protected with a standard firewall.
Only HTTPS requests (TCP port 443) are allowed to pass thro

ugh, all other services are blocked.
/3 System is allowed only via



To ensure a higher level of security, SAP recommends that access to the R
a SAProuter.
For further information about firewalls and HTTPS see Unit "Internet, Intranet and WWW".

(C) SAP AG BC440 8-11
SAP AG 2001
HTTP HTTP
server server
R/3 R/3
application application
server server
W
G
a
t
e
A
G
a
t
e
CGI CGI
Only possible with dual host installation!
Special ports, SNC
HTTPS HTTPS
HTTP or
HTTP-S
GUI or RFC ports, SNC,
(SAProuter also possible)
Security Additional Protection for the AGate
RFC RFC
DIAG DIAG
TCP/IP TCP/IP



A further firewall placed between AGate and WGate increases the level of protection of the AGate. A
standard firewall or SAProuter can be used for this.
TCP port numbers allowed according to the entry sapavw00_<virtual ITS> in the file
c:\parwinnt\system32\drivers\etc\services.
Data transmitted between AGate and WGate can be encrypted with SNC.
The files in the file system of the AGate computer are protected by the access authorization for NTFS
(NT File System). When an AGate is installed, setup offers three different authorization levels:
- Everyone allows access to all ITS files without restrictions.
- ITS Administrator and ITS User allows an administrator to access all files and a user group to
access service files and templates.
Any NT user with administrative rights for the AGate computer can be nominated as the
administrator. All users who use the ITS for development purposes to create/modify service files
and templates, are included in the user group.
- ITS Administrator Only allows only administrator access to the ITS files (including service files
and templates).



(C) SAP AG BC440 8-12
SAP AG 1999
Access Rights to ITS Files
(NT Security)
NT User Groups ITS Setting
Admin Only
Admin + User
No security
A
A U
Security




(C) SAP AG BC440 8-13
SAP AG 1999
Scalability
Scalability
Security Issues
Security Issues
Installation
Installation
Administration at runtime
Administration at runtime
ITS Administration Tool
ITS Administration Tool
dministration A




(C) SAP AG BC440 8-14
SAP AG 1999
File Path of Physical Installation
C:Program Files\SAP\ITS\2.0\
Install\
Packages\ - all selected in setup
Packages (*.car)
Programs\ - all programs (AGate and
WGate) to install
Programs\ - MManager.exe, AGate.exe
and DLLs
Admin\ - Administration programs
ITSInstall.exe - physical installation
ITSDeinstall.exe - physical deinstallation
ITSvInstall.exe - installs virtual ITS
ITSvDeinstall.exe - deinstalls virtual ITS
ITSvControl.exe - starts/stops virtual ITS
ITSvProtect.exe - changes file access authorizations



You usually won't call the administration programs directly using the NT command prompt, as there a
easier alternatives:
re
e Programs" in NT Control Panel
dmin Tool
Installation (physical and/or virtual) using ITSsetup.exe
Deinstallation (physical and/or virtual) using "Add/Remov
Start/stop using the service manager in the control panel using the Admin Tool
Changing the file access authorization with the A

(C) SAP AG BC440 8-15
SAP AG 1999
File Path of Virtual Installation AGate
C:Program Files\SAP\ITS\2.0\
<vITS> = Share <vITS>_ITS
Services\ - Service files
Templates\ - Templates
Logs\ - "normal log
access.log - all accesses to the ITS
loadstat.log - load on the AGate instances
performance.log - status of AGate instances
Traces\ - Error logs
WGate.trc - Error in WGate
MManager.trc - Mapping Manager
AGate.trc - the AGate itself
SAPjulep.trc - HTMLBusiness Interpreter
SAPirf.trc - access to the file system
SAPxgdk.trc - XGateway (e.g. WebRFC call)



You can determine what is logged for each virtual ITS. The next section deals covers the settings for
"normal logs in more detail.
There are two parameters for the error logs that are saved in the NT registry. You can change the
parameters with the Admin Tool. (see later in this section).
TraceAppend determines whether the ITS opens a new file when an AGate instance is started ("0"), or
whether the existing log is to be updated (1).
TraceLevel determines how detailed the log is:
1 = no log
2 = errors only
3 = errors and warnings
4 = errors and information messages

(C) SAP AG BC440 8-16
SAP AG 1999
File Path of Virtual Installation - WGate
C:\InetPub\ (example IIS 4.0)
wwwroot\ - Root of HTTP server
SAP\
ITS = Share <vITS>_WWW
MIMES\ - MIMEs
scripts\ - Directory for CGI and ISAPI
WGate.dll - the WGate program as DLL
virtualITS.conf - contains name of virtual ITS




(C) SAP AG BC440 8-17
SAP AG 1999
Physical deinstallation
ITS ITS
ABC
ITS ITS
FGH
ITS ITS
ADM
Virtual
deinstallation
Mapping Manager
AGate instance 1
AGate instance 2
AGate instance 3
Mapping Manager
AGate instance 1
Mapping Manager
AGate instance 1
AGate instance 2
ITS Deinstallation




(C) SAP AG BC440 8-18
SAP AG 1999
Scalability
Scalability
Security Issues
Security Issues
Installation
Installation
Administration at Runtime
Administration at Runtime
The ITS Admin Tool
The ITS Admin Tool
Administration




(C) SAP AG BC440 8-19
SAP AG 1999
<html>
<head>
No service file
<title>Information</title>
</head>
<body>
noservice.html
error situation
Header head.html
Footer tail.html
Global m
</body>
</html>
<H2>No Service Name
Specified</H2>
<p>
Your request did not
contain a service name.
tail.html
ystem Templates Principle
A template for each possible
Special themes dm and pm
odification
Change head.html bzw.
tail.html in theme dm
Copy and change templates
from dm to pm
Special modifications
Copy and change templates
from System into the
appropriate service
S
head.html
Service System contains




(C) SAP AG BC440 8-20
SAP AG 1999
System Templates Selected by the ITS
Templates
BC440 - current service
99 - current theme (~theme = 99)
EN - current language
(~templateLanguage = EN)
head.html - system template (example)
System - pseudo service
PM - production mode
(~runTimeMode = pm)
head.html - system template
DM - Development mode
(~runTimeMode <> pm)
head.html - System template
1 1 1
2 2 2
3 3 3



The templates in System generate detailed error messages intended for developers. These should be
copied and changed to System for the productive operation.
The copied templates can be transported as "normal" templates, whereby PM is treated as an additional
theme.
If you are using the SAP@Web Studio to change the service "system", note: To import the service from
AGate ("Import Service from Site"), the file system.srvc must be in the ITS service directory. If
this file is not available, the service "system" does not appear in the import selection list. In this case,
you should create the file youself on the AGate. The file content is of no importance as it is never read at
runtime.
Default path: C:Files.0vITS>\Services\system.srvc).

(C) SAP AG BC440 8-21
SAP AG 1999
Logs Contents
ns an entry for each request that the ITS has processed
f
rmance of the individual
access.log
Contai
Date, time, IP address of the Web browser and service name are
included in the log
loadstat.log
Contains information about the load on the AGate instances o
an ITS
The mapping manager collects the data once every minute
performance.log
Contains data about the current perfo
AGate instances



The log file diagnostics.log is no longer needed since the Admin Tool has been provided. However, it is
still provided for compatability reasons.

(C) SAP AG BC440 8-22
SAP AG 1999
AGate AGate
access.log
Buffer Buffer
CacheSize
exceeded
Caching = 1
access_xxx
.log
FileSize
exceeded
TimeToLive
exceeded
(Example: Access.log)
Logs Life Cycle



The parameters belwo can be defined for each log file (access.log, loadstat.log and performance.log):
Caching determines whether a log is buffered in the main memory ("1") or updated directly on the
hard drive ("0").
CacheSize determines the size of the buffer for a log in the main memory of the ITS. The log file is
only updated on the hard drive ("flush"), once the maximum size is exceeded.
The FileSize determines the maximum size of a log file, before it is "archived".
("-1 = infinite)
TimeToLive determines the number of days after which an archived log is "buried".
("-1 = infinite)
BurialCmd describes what is to happen to an archived log that has reached its expiry date. A log is
deleted after it has exceeded its expiry date, if you do not specify a special BurialCmd. With the
parameter BurialCmd you can also rename files or move files around in the filesystem. For more
information refer to the application help documentation.
These parameters are stored in the NT registry of the AGate and can be changed with the Admin Tool.
You can also determine the path under which the logs are to be stored.

(C) SAP AG BC440 8-23
SAP AG 1999
Scalability
Scalability
Security Issues
Security Issues
Installation
Installation
Administration at Runtime
Administration at Runtime
The ITS Admin Tool
The ITS Admin Tool
dministration A




(C) SAP AG BC440 8-24
SAP AG 1999
ITS ITS
ABC
DEV DEV HTTP HTTP
QAS QAS HTTP HTTP
ITS ITS HTTP HTTP
ITS ITS
FGH
ADM
Browser Browser
URL to start the
Admin Tool:
http://.../scripts/wgate/admin/!
ITS Admin Tool - A Special Virtual ITS



Functions in the ITS Admin Tool
Overview - Overview of all the virtual Internet Transaction Servers on one page
- Hits, hits/sec, turn-around-time, sessions, workthreads
<vITS> - Details of each virtual ITS
- Control - Start and stop the ITS and Web servers
- Performance - Detailed display
- Configuration - Performance settings, service files, log functions, debugging, registry
- Security - NT security (files), communication (WGate to AGate, AGate to R/3)
- Utilities - Flush logs, clear templates cache
- View Templates
- View Logs
System View - Overview of NT server
Administration - Admin tool user management

(C) SAP AG BC440 8-25
SAP AG 1999
ITS Admin Tool - Functions
one page
Hits, hits/sec, turn-around-time, sessions, worker threads
<vITS> - Details of each virtual ITS
Control -start and stop the ITS and Web servers
Performance - detailed display
Configuration - performance settings, service files, log functions,
debugging, registry
Security - NT security (files), communication (WGate to AGate, AGate to
R/3)
Utilities - flush logs, clear templates cache
View templates
View logs
System view - overview of NT server
Administration - Admin Tool users
Overview - Overview of all the virtual Internet Transaction servers on




(C) SAP AG BC440 8-26
SAP AG 1999
The ITS Administration Tool - Users
The Admin Tool can manage several users
User administration with itsadmin
Symbolic names
(without reference to NT User Management)
Initial password
Access can be determined for each virtual ITS
No access (ITS "invisible")
Read access
Full access
Read and change all settings
Start/stop



After you have installed the ITS Admin Tool, only the user itsadmin with password init exists.

(C) SAP AG BC440 8-27
SA
Administration: Unit Sum
Install and deinstall the ITS
Start and stop the ITS
plates
Evaluate logs
Use the Admin Tool
Configure the ITS
You are now able to:
Use system tem
P AG 1999
mary




(C) SAP AG BC440 8-28
Administration: Exercises




nit: Administration
tes
U
Topic: System Templa
Use system templates
Copy and change system templates


At the conclusion of these exercises, you will be able to:



1-1
1-1-1 oject.
he copyright in
rvice parameter ~language in the service file to empty, so that the
service is started.
ked for the logon language in
Web Studio:
Import the service System into your pr
1-1-2 Copy the templates head.html and tail.html into your first service
(theme 99). Change the background color in head.html and t
tail.html.
1-1-3 Set the se
ITS asks for the logon language when the
1-1-4 Select "Go" to start your service. You should be as
your new template.

(C) SAP AG BC440 8-29
Exercises




Unit: Administration
Topic: ITS Administration Tool
At the conclusion of these exercises, you will be able to:
Use the ITS Administration Tool




Use the ITS Administration Tool to display the ITS settings and protocols


user name and password for the logon.
ng questions:
Ho formance log data saved for?
what time is the first entry in yesterday's performance log?

used in your training course.
2-1 Web Browser:
2-1-1 Start the ITS Administration Tool Your instructor will tell you the TCP port,
2-1-2 Use the ITS Administration Tool to find the answers to the followi
How many worker threads and sessions has the ITS used in the exercises got?
Ho w many AGate instances has the ITS currently got? What is the minimum number? What is
the maximum number?
w many days is the per
From
When was the biggest workload in the last five days? What percentage of the worker thread
ns was in use at this time? and sessio
How much space is free on the hard drive?


(C) SAP AG BC440 8-30
Administration: Solutions



Unit: Administration
Topic: System Templates
Use system templates





Copy and change system templates
File head.html (Changes are in bold)
<html> <head> <title>BC440 Information</title>
<LINK rel="stylesheet" href="/bc440/styles.css">
<base target="_top"> </head>

<BODY bgcolor=yellow><!-- Navigation Bar Starts -->
<table height="61" width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td background="`mimeURL("system", "", "", "IAC_Menu_Tile.gif" )`"
height="30">
<table> <tr> <td width=5></td>
<td width=473 nowrap><font face=arial size="-1" color=white>ITS System
Information</font></td>
</tr> </table>
</td>
<td rowspan=2 width=122 height=61 valign=top><img src="`mimeURL("system", "",
"", "Theme+SAPLogo.jpg")`" width=122 height=61 border=0 alt=""></td>
</tr> <tr>
<td background="`mimeURL("system", "", "", "IAC_graybar_Tile.jpg")`"
height="31">
</td> </tr> </table>

(C) SAP AG BC440 8-31
<!-- Navigation Bar Ends -->
<br><br> <table width=600> <tr> <td width=50 nowrap></td> <td>

File tail.html (changes are in bold)
</td> </tr> </ta


table>
< width=50 now
td nowrap>
<FONT SIZE=-1>
Return to <a hre
</FONT>
</td> </tr> </table>
</html>

ble>
<
<tr>
td rap></td>
<
f="/BC440/">BC440</a>.

</body>

(C) SAP AG BC440 8-32
Exercises



Unit: Administration
Topic: ITS Administration Tool


Use the ITS Administration Tool



Use the ITS Administration Tool to display the ITS settings and protocols
used in your training course.
2-1-1 Start the ITS Administration Tool Your instructor will tell you the TCP port,
user name and password for the logon.
2-1-2 Use the ITS Administration Tool to find the answers to the following questions:
(dependent on training system)



(C) SAP AG BC440 9-1
SAP AG 1999
Comparison of the programming models
Comparison of the tools
ITS and mySAP.com
Adjusting existing scenarios
Contents:
Summary and Outlook




(C) SAP AG BC440 9-2
SAP AG 1999
C
o
u
r
s
e

O
v
e
r
v
i
e
w
1
S
u
m
m
a
r
y

a
n
d

O
u
t
l
o
o
k
9
Summary and Outlook
P
r
e
f
a
c
e
2
Internet, Intranet and WWW
Internet Transaction Server
HTML
Web
Transaction
WebRFC
3
6 7
4
Administration 8
5




(C) SAP AG BC440 9-3
SAP AG 1999
Comparison of the Programming Models
Comparison of the Programming Models
Comparison of the Tools
Comparison of the Tools
Overview: ITS and mySAP.com
ITS and mySAP.com
ITS and mySAP.com
Adjusting Existing Scenarios
Adjusting Existing Scenarios




(C) SAP AG BC440 9-4
SAP AG 1999
R/3 Client/Server Architecture with ITS
.
.
.
Presentation Application Database
.
.
.
DIAG
HTTP
(HTML)
ITS ITS
Web browser Web browser
SAP GUI SAP GUI
Web Web
server server



The Internet Transaction Server extends the three-tier client/server structure of the R/3 System to the
Internet.
With a SAP GUI the R/3 System can be used simultaneously with the Internet Transaction Server.


(C) SAP AG BC440 9-5
SAP AG 1999
Internet Internet
Transaction Transaction
server server
HTTP HTTP R/3 R/3
Internet Transaction Server
Communication with
the HTTP server
the R/3 application
server
User administration for R/3
logon
Conversion of data on R/3
screens into HTML pages
Status management
Synchronization of R/3



The Internet Transaction Server (ITS) links one or more HTTP servers with one or more R/3 Systems.
modules, or any
A

Internet and Intranet users can run Web-enabled transactions, Web-enabled function
BAP reports in R/3 using the ITS.

(C) SAP AG BC440 9-6
SAP AG 1999
ITS ITS
ABC
DEV DEV HT HTTP TP
QAS QAS HTTP HTTP
ITS ITS HTTP HTTP
ITS ITS
FGH
ADM
Browser Browser
URL to start the
Admin Tool:
http://.../scripts/wgate/admin/!
ITS Admin Tool - A Special Virtual ITS



Functions in the ITS Admin Tool
Overview - Overview of all the virtual Internet Transaction Servers on one page
- Hits, hits/sec, turn-around-time, sessions, workthreads
<vITS> - Details of each virtual ITS
- Control - Start and stop the ITS and Web servers
- Performance - Detailed display
- Configuration - Performance settings, service files, log functions, debugging, registry
- Security - NT security (files), communication (WGate to AGate, AGate to R/3)
- Utilities - Flush logs, clear templates cache
- View Templates
- View Logs
System View - Overview of NT server
Administration - Admin tool user management

(C) SAP AG BC440 9-7
SAP AG 2001
R/3 R/3
application application
server server ITS ITS
W
G
a
t
e
Web Web
browser browser
HTTP HTTP
server server
HTTP HTTP CGI CGI
A
G
a
t
e
TCP/IP TCP/IP
RFC RFC
DIAG DIAG
HTML
Business
templates
MIME
objects
Service
files
http://pc12/scripts/wgate/abcd/!
Components of an ITS Service



A service the Internet Transaction Server provides for Internet users consists of:
- Administering logon information to the R/3 System (name of system, user details)
- Running a transaction in R/3 or calling a function module or report
- Converting R/3 data (screens or lists) to HTML pages
When a service is started, a SAP GUI or RFC session is internally start ed:
- The ITS assigns the HTTP requests for a service to the correct session
- A user context corresponds to each session in the R/3 System
- A session ends when the service ends (by logoff or timeout in ITS)


(C) SAP AG BC440 9-8
SAP AG 1999
Global.srvc
~systemName XYP
~login Meier
~password ***
~client 400
~language DE
...
test.srvc
~initialTemplate start
~theme 99
abcd.srvc
~transaction ABCD
its050.srvc
~transaction ABCD
zits050_00.srvc
~transaction Z234
~login
~language
Service Files



Service files are text files that are stored in the AGate file system. They contain the settings that the ITS
requires to connect to the R/3 System to start a transaction or a WebRFC-enabled function module.
The structure of service files is as follows: Each line contains a parameter name with a value separated
by at least one space or TAB. These files can be edited with any text editor. The SAP@Web Studio and
the Web Application Builder provide table-type maintenance for this.
The file Global.srvc is a special service file. It contains global settings - all those common to all
individual services. When a <service> is started, the file Global.srvc is always imported first and
then the file <service>.srvc. The values from <service>.srvc are added to or override the
values from Global.srvc.

(C) SAP AG BC440 9-9
SAP AG 1999
WebTransactions
Simple!
Intended for use by everyone
(large number of users)
Users do not need to be
trained
Uses multimedia
and hyperlinks
to other systems
Standard R/3 Transaction
Processing is efficient in all
possible situations
Intended for professional
users
Users must be trained
Transaction Attributes



A WebTransaction makes a small part of the entire R/3 functions available to Internet users. This mea
that unt
ns
rained Internet users can also use this functionality.


(C) SAP AG BC440 9-10
SAP AG 1999
SAP GUI
for HTML
SAP GUI SAP GUI
for HTML for HTML
IAC
IAC IAC
WebTransactions
s s
Internet
Application Application
Application
Components
Components Components
Internet Internet
WebTransaction WebTransaction
WebRFC
WebRFC WebRFC
Cs and SAP GUI for HTML IA
R/3
R/3 R/3
Transactions
for
WebTransactions
Function
modules
for WebRFC
Entire R/3
functionality



With the Internet Transaction Server, R/3 functions can be mapped into the Internet in three different
ways:
If an R/3 program is created especially for Internet users, it is called an Internet Application
Component (IAC). These include WebTransactions and WebRFC. IACs are not complex and they are
easy to use.
- WebTransaction - special internet-enabled transactions that make a part of the whole R/3
functionality available to Internet users.
- WebRFC - special function modules that can read and present data directly to the Internet user
The SAP GUI for HTML enables you to use almost all the R/3 functions in the Web browser. The
high level of complexity of R/3 transactions is also supported.

(C) SAP AG BC440 9-11
SAP AG 1999
System Help
SAP R/3

q
q

q
+
+

+
System Hilfe
SAP R/3

q
q

q
+
+

+
R/3 R/3
Web Web
browser browser
ITS ITS
HTTP HTTP
server server
HTTP HTTP
HTTP HTTP
CGI CGI
CGI CGI
Carrier ID: LH
Carrier name:
Lufthansa
200
100
DIAG DIAG
DIAG DIAG
1 Screen =
1 Template =
1 HTML page
EasyWebTransaction (EWT) Components
Service
file
HTML
Business
templates


ee components: R/3 transaction, service file and HTML
Business
s have more components. For simplicity these are not shown
T nsaction is created especially for use by the ITS:
processed
T y the ITS to log on to the R/3 System and to start the


EasyWebTransactions consist of thr
templates. Complex EasyWebTransaction
on the above slide.
he R/3 tra
- Only use "simple" screens that can be easily converted into HTML
- The transaction must allow synchronization through the ITS
- Use a special technique to provide users with input help in HTML forms
- Users must be able to log on to the Internet while the transaction is being
- The business logic can be created quickly using BAPIs
he service file contains information required b
transaction.

(C) SAP AG BC440 9-12
SAP AG 1999
Details
R/3 R/3
SAP R/3
LH 400
01.06.00
300
SAP R/3
200
SAP R/3
300
LH 400 01.06.00
LH 400 02.06.00
LH 400 05.06.00
AWSY... AWSY...
PICK PICK
03
02
04
LH 400 01.06.00
LH 400 02.06.00
LH 400 05.06.00
01.06.00
LH 400
05.06.00
LH 400
05.06.00
ynchronization - Comfortable Solution S
ITS ITS
AGate AGate
ID
03
04
Scrn.
300
300
LH 400
01 100
02 200
+
1 1 2 2
3 3
5 5
7 7 8 8
6 6
4 4
+



Synchronization in detail (example):
- The ITS receives screen 300 by DIAG.
- The ITS generates the associated HTML page and sends this page with the status number 03 to the
browser.
- The user chooses the BACK button in the browser. The ITS is not aware of this action. The Web
browser sends a completed HTML form to the ITS via the HTTP server.
- The ITS checks the status number 02 and determines that synchronization is necessary. The ITS then
sends the function code AWSY<prog><screen_no> to the R/3 System.
- The ABAP program uses SET SCREEN to display the correct screen 200. The ITS receives the
correct screen 200 by DIAG.
- The ITS fills the input fields and sends the associated function code.
- The input is processed in R/3 and the result screen 300 is sent by DIAG to the ITS. The ITS receives
screen 300 by DIAG.
- The ITS generates the associated HTML page and sends this page with the status number 04 to the
browser.
Note: The ITS sends AWSY... only once - R/3 has only one chance to send the correct screen.

(C) SAP AG BC440 9-13
SAP AG 2001
SAP@Web SAP@Web
Studio Studio
SAP@Web Studio
Working methods are project-
oriented
Used for creating, managing,
maintaining and publishing:
Projects
Service files
HTML
Business
templates
Language dependencies
(text files)
MIME objects
(administration and display
functions only )
ITS flow files



In the SAP@Web Studio, all the components of EasyWebTransactions and scenarios required outside
the R/3 System can be maintained using ITS flow logic. They include:
- Service files
- HTML
Business
templates
- MIME objects (such as images, sound, video)
- Files with language-dependent placeholders
- ITS flow files
The SAP@Web Studio is a component of the ITS installation.

(C) SAP AG BC440 9-14
SAP AG 2001
Publish with the SAP@Web Studio
Start service
ITS ITS
A
G
a
W
G
a
t
e
t
e
R/3 R/3
Web Web
browser browser
HTTP HTTP
SAP@Web SAP@Web
Studio Studio
MIMEs Services Templates Texts Flow files
<b>`i`</b>
`itab[i]`
abcd.srvc
test.srvc
start
list
Seats
seats
Project ITSxxx_Demo
Web Studio publish



MIME objects are copied by "Publish" into the file system of the WGate (the HTTP server).


(C) SAP AG BC440 9-15
SAP AG 1999
Syntax in HTML
Business
HTML
Business
syntax is very similar to C programming
language
HTML
Business
commands appear in "normal" HTML and are
enclosed between ` (backticks)
`SDYN_BOOK-NAME.LABEL` <p>
<em> `SDYN_BOOK-NAME` </em>
The SAP@Web Studio displays HTML
Business
commands in
blue.







HTML
Business
expressions are case-insensitive.
The character ` (backtick) was chosen because it has no special usage in "normal" HTML.
Another way of embedding HTML
Business
in HTML is described later.

(C) SAP AG BC440 9-16
SAP AG 1999
R/3 System ABC
XYZ
<body>
<form action="`wgateURL()`"...>
GHJ
TZU
Program sapbc440d
...
</form>
SAP@Web
Studio
SAP@Web SAP@Web
Studio Studio
Screen Number 100; 200
`~messageLine`
</body>
<none> Language
Service
Theme
BC440Demo
99
R/3 Logon R/3 Logon
R/3 R/3
Template Wizard
HTML
Business
templates



The Template Wizard automatically creates an HTML
Business
template for each R/3 screen.
HTML
Business
expressions are automatically created for all the input fields, output fields and field labels.
The Wizard also embeds these fields into an HTML form using <input type=text ...>
Depending on the application, some HTML commands may have to be deleted.
The HTMLBusiness command ~messageLine is described later in this Unit.
The ITS manages templates according to theme and language. (discussed later in Unit). Basically, the
theme is determined by the service parameter ~theme and the language by the service parameter
~language. The parameter values should be passed to the Template Wizard.
The tempaltes are generated in R/3. The SAP@Web Studio must establish an RFC connection to an R/3
System to run a program from here. You can chose the R/3 System. All user data required for logon
must be specified.
The automatically generated templates can be modified at any time.



(C) SAP AG BC440 9-17
SAP AG 1999
Airline carrier: LH
Airline carrier LH
`SCARR-CARRID.label`<p>
<form ...> ... </form>
<img src="...">
...
ITS ITS
A
G
a
t
e
50 50
99 99
R/3 R/3
...
<img src="...">
`SCARR-CARRID.label`<p>
<form ...> ... </form>
...
50 50
99 99
System Help
SAP R/3

q
q

q
+
+

+
Airline carrier:
LH
100
Theme Different Layouts for a Screen
For each
screen:
1 theme =
1 template
HTML
Business
templates



The whole business logic of an EasyWebTransaction is in R/3. However, the actual appearance (layout)
is determined by the HTML
Business
templates used.
If the same EasyWebTransaction is to be used by different user groups, it may be necessary to provide
different screen layouts. The ITS uses themes for this.
A theme is a logical name for the screen layout of EasyWebTransactions. The name consists of two lines
(letters or digits). Any number of themes can be used for one EasyWebTransaction.
A theme is specified at the start of a service and it cannot be modified while the service is running.


(C) SAP AG BC440 9-18
SAP AG 1999
...
<img src="...">
`SCARR-CARRID.label`<p>
<form ...> ... </form>
<font ...>`#slogan`</font>
...
L
ITS ITS
EN EN EN EN

q
+
+
LH
A
G
a
t
e
Fluggesellschaft: LH
DE DE
1 Language =
1 Text file
System Hilfe
Flge anzeigen

q
q

q
+
+

+
Fluggesellschaft:
LH
Carrier: LH
Testen Sie uns!
Test us!
DE DE
System Help
q q +
Display flights
Carrier:
anguage Independency Through Text Files
HTML
Business
templates
Language-
dependent
texts



If not all language-dependent texts can be fetched from the R/3 System, HTML
Business
enables
placeholders for language-dependent text to be used in templates. At runtime these placeholders
are replaced by the relevant text from language-dependent text files


(C) SAP AG BC440 9-19
SAP AG 2001
MIME Objects for a WebTransaction
Book id:
561966
Book id:
561966
50 50
99 99
Use any MIME objects
(images, sounds, videos, ...)
MIME objects are stored
on the HTTP server
HTML
Business
function
mimeURL() creates the
correct URL at runtime
Dependent on language
and theme
<img src="`mimeUrl(...)`">



MIME objects can be linked to WebTransactions in several ways:
- Static URL to access objects in the file system of the HTTP server
- Dynamic URL using HTML
Business
to access objects in the file system of the HTTP server
- Send MIME objects from R/3 to the ITS
The second option has the following advantages:
- The business logic of a WebTransaction can be developed in R/3 separately from the visual
appearance of the resulting HTML pages.
- MIME objects can be included dependent on the selected theme and logon language at runtime.
- In combination with language support customer-specific information can be presented on the Web.
The first option ideally should not be used. This topic focuses on the second option. The third option is
described in the topic "Macros".


(C) SAP AG BC440 9-20
SAP AG 2001
Include Example
Template for screen 100
... `Include(~name="button_functions.html")`
... `button("Cancel", "/NEX")`
File button_functions.html:
`function button(text, fcode)
write("<input type=submit name=~OkCode=", fcode,
" value=", text, " >")
end`
Template for screen 300
... `Include(~name="button_functions.html")`
... `button("Cancel", "/NEX")`




(C) SAP AG BC440 9-21
SAP AG 1999
R
R
ITS ITS
A
G
a
t
e
HTTP HTTP
ITS ITS
A
G
a
t
e
HTTP HTTP
ITS ITS
A
G
a
t
e
HTTP HTTP
R/3 SystemLandscape with ITS Integration (IACOR)
PRD PRD
QAS QAS
DEV DEV




(C) SAP AG BC440 9-22
SAP AG 1999
Function module
WWW_DISPATCH_REQUEST
WebRFC-enabled
function module
QUERY_STRING
NAME VALUE
_function ...
... ...
HTML
<HTML><HEAD>
<TITLE>...</HTML>
CONTENT_TYPE
RETURN_CODE
text/html
0
ITS ITS
( (AGate AGate) )
RFC RFC
RFC RFC
WW_DISPATCH_REQUEST W
R/3 R/3
Service
WebRFC



The AGate enters the name and value of all the parameters in the URL into the table
QUERY_STRING. This table is forwarded to WWW_DISPATCH_REQUEST.
In response the AGate receives:
- A complete HTML page as a table HTML or a binary object as table MIME.
- the MIME type of the result, text/html
- A return code that states whether the AGate should remain connected:
RETURN_CODE = 0: close
RETURN_CODE = 1: keep open
RETURN_CODE = 3: close and also close ITS session


(C) SAP AG BC440 9-23
SAP AG 1999
WebRFC-enabled function module
WWW_HTML_MERGER
Template name and data for place holders
HTML page with place holders
HTML page
R/3 R/3
WWWDATA
Templates for WebRFC Applications
1 1 3 3
2 2
1 1
2 2
3 3



Table HTML can also be filled using templates. Unlike Web Transaction templates, the templates
used in WebRFC are kept in the table WWWDATA in R/3, not in the file system of AGate.
The function module WWW_HTML_MERGER generates a filled HTML table from a template and data for
the placeholders.

(C) SAP AG BC440 9-24
SAP AG 2001
WWWDATA
S
General functions
Maintain MIME types
Assign MIME editors
Maintaining HTML templates in table WWWDATA
Creating, changing and deleting
Importing and exporting
Maintain descriptions
AP Web Repository - HTML Templates



As well as the MIME objects used for WebRFC, the HTML templates for WebRFC applications are also
kept in the database table WWWDATA.
SAP templates should not be directly modified, they should first be copied to the customer name space
(beginning with Z).

(C) SAP AG BC440 9-25
SAP AG 2001
WWWDATA
SAP Web Repository - MIME Objects
General functions
Maintain MIME types
Assign MIME editors
Maintaining MIME objects in table WWWDATA
Creating, changing and deleting
Importing and exporting
Maintain descriptions



All MIME objects used for WebRFC are in the database table WWWDATA.
If objects are to be saved in this table, the MIME type must also exist. A MIME type is therefore
assigned to each required file extension. The MIME type is automatically saved when objects are
imported into R/3.

(C) SAP AG BC440 9-26
SAP AG 1999
Summary
Summary
What's Next?
What's Next?
Summary and Outlook




(C) SAP AG BC440 9-27
SAP AG 1999
ITS and mySAP.com Workplace
U
s
e
r
s

m
a
c
h
i
n
e
S
e
r
v
e
r

s
i
t
e
Users frontend(s) WebServer process(es)
Frontend server
Other backend
Systems
Browser
(WebGUI)
HTTP-
server
A-Gate
R
HTML
Files
Work
Place
User
R
W Gate
R
WebGUI
TopTier
Internet Transaction Server
I
S
A
P
I
R
R
Templates
Top tier database
(ODS)
T
e
c
h
n
i
c
a
l

i
n
f
r
a
s
t
r
u
c
t
u
r
e

o
f

E
W
P
E
m
p
lo
y
e
e

W
o
r
k

P
la
c
e

(
A
P
)
B
lo
c
k

d
i
a
g
r
a
m
1

S
e
p
,

1
9
9
9
H
T
T
P
(
S
)

/

H
T
M
L
Users immediate environment Backend systems Portal Middleware
SAPGUI Prot./
RFC
R/3 Core
BW
APO
Work place
server
(based on
BW/KW?)
Windows
GUI
Windows
Terminal
server
R R
Proprietary
Protocol
R
R
Cookies
Portal configurator
WebRFC
SAPGUI Prot./
RFC
SAP GUI
for Windows
SAP GUI
for Java
Windows
Terminal
Client
R
R
R
... if SAP GUI
runs 'wi thin'
Browser
la
u
n
c
h

v
i
a

t
e
m
p
.

s
t
a
r
t
e
r
HTTP-
server
R
Java
VM Citrix
Plug ins
MTS
(Microsoft
Transaction
Server)
+
DCOM CC
R
D
C
O
M
KW
SAPGUI Prot./
SAPGUI
Advantages of RFC
RFC




(C) SAP AG BC440 10-1
SAP AG 1999
Additional slides
Contents
Appendix




(C) SAP AG BC440 10-2
SAP AG 2003
Appendix
This section contains additional material
to be used for reference purposes.
This material is not part of the
standard course.
Therefore, it may not be covered
during the course presentation.




(C) SAP AG BC440 10-3
SAP AG 1999
Appendix
Internet, Intranet and WWW
Internet, Intranet and WWW
Using the SAP@Web Studio Without IACOR
Using the SAP@Web Studio Without IACOR
WebRFC
WebRFC
Installation and Administration
Installation and Administration
System Environment for Training
System Environment for Training




(C) SAP AG BC440 10-4
SAP AG 2001
DNS server
Domain wdf.sap.com
pc12.wdf.sap.com
LAN
Router
5
6
7
4
DNS servers
Domain com
DNS servers
Domain sap.com
a42.xyz.com
LAN
?
Router
DNS server
Domain xyz.com
3
2
9
8
1
Internet Internet
PC12
A42
From The Domain Name to The IP Address
What is the IP address of the computer pc12.wdf.sap.com?

tributed database. Each Domain Name Server
only knows the IP addresses of the computers with domain names directly below it in the domain
hi e Server directly above it in the hierarchy.
At e ize failure safety and to ensure shorter response times.
ss has to be
s is done as follows:
- A42 makes a request (1) to the DNS server (2) in its network. If this server already knows the
answer (target is local or in the cache), it passes it to A42. If not, it forwards the request from A42
(3), then passes the result to A42 and also copies it to a local cache. Other requests for the same
name can be responded to immediately with the cache.
- With (4) the ascent from .de to the DNS server for wdf.sap.com begins. Each DNS server in the
hierarchy only knows the IP addresses of the DNS servers in the domain in the next level down.
From .de (5) the request is passed via sap.de (6+7) down to wdf.sap.com (8).
- Eventually the DNS server for wdf.sap.com knows the IP address of PC12 and passes this
address back. On the return route via the DNS servers sap.com, .de etc. it can be loaded into a
cache at any time.
- Finally the response arrives at A42.


Domain names are assigned to an IP address using a dis
erarchy. It also knows the IP address of the Domain Nam
ach level, servers are duplicated to maxim
To connect to a computer for which only the domain name is known, the computer's IP addre
identified. IP Address In the example above thi

(C) SAP AG BC440 10-5
SAP AG 1999
Principle: present
GET from client
HEAD to server Cache current?
GET to server
Select current cache Response in cache
Response to client
Response in cache?
No
Yes
No
Cache valid?
Yes
Yes
No
HTTP Cache Process



When are the contents of a cache no longer up to date?
- The stated expiration date has passed GET request to server necessary
- The contents have been in the cache for a 'long time'
= HEAD request to server can be sent
The HTTP specification (RFC 2068) states how long a data object can be stored in a cache.
POST requests cannot be stored in any cache.


(C) SAP AG BC440 10-6
SAP AG 1999
PC12
C C
Logo
GET logo.gif (referer: A)
4711 4711
4711 A 11.12.97
http://c/logo.gif
A A
B B
Movement profile
Cookies - Improper Use (1)



The servers A, B and C are working in cooperation. There are documents on servers A and B containing
em
Th
-
-
e
is produced.

bedded images that are on server C.
e above process is as follows:
The Web browser first sends a request to server A and receives the requested page in response.
The browser recognizes that an image is required from server C and sends a request to server C.
The name in the request header (here: A) is sent to the server from which the page containing the
image originates.
- Server C creates a cookie and stores the cookie number, name of the server (in this case A) and th
current date. A) A movement profile
- In response, the browser receives the image from server C and a persistent cookie.

(C) SAP AG BC440 10-7
SAP AG 1999
PC12
A A
B B
C C
http://c/logo.gif
Logo
4711 4711
4711 A 10.12.97
4711 4711
4711 B 11.12.97
GET logo.gif (referer: B)
Movement profile
ookies - Improper Use (2) C



Continuation of previous process (not necessarily during the same browser session):
- The Web browser sends a request to server B and, in response, receives the page requested.
- The browser recognizes that an image is required from server C and sends a request to server C. It
must not necessarily be the same image. What is important is that the image is located on server C.
Not only the name of the server (B) from which the page with the embedded image comes is sent
with the request, the cookie sent with the first response from server C and saved on the local hard
drive, is also sent.
- Server C recognizes the cookie number and stores the server name (now B) and current data. A)
The movement profile is extended.
- The browser receives the image from server C as the response. Although the cookie sent earlier
does not have to be sent at the same time, it usually is.
If users enter their name or address on one of the three servers (for example, because they want to order
something), this information can be assigned to the anonymous (until this point) movement profile.



(C) SAP AG BC440 10-8
SAP AG 2001
Client Server
Internet Internet
Confidentiality - Symmetrical Encryption
Client and server define one shared key
Used for encryption and decryption
Exchanged outside the Internet or via a secure connection



Advantage of symmetrical encryption:
- Fast algorithms
Disadvantages:
- The shared key must first be exchanged via a secure connection.
as read it. The message
receiver will not be aware of this.
Ex
-
- Anyone who intercepts the key can corrupt the message data as well
ample of an implementation:
DES (Data Encryption Standard) uses a 56 bit key, that is, there are 2
56
different keys.

(C) SAP AG BC440 10-9
SAP AG 2001
Public key (server) Private key (server)
Client Server
Internet Internet
Confidentiality, Authenticity - Asymmetrical
Encryption
The server generates one pair of keys
(public key and private key)
Encryption with one key requires decryption with the other
The client is only notified of the public key



Advantage of asymmetrical encryption:
- Messages can neither be read nor corrupted
Disadvantages:
- Complex algorithms
- Public keys of all communication partners need to be administered
Example of an implementation:
- RSA (named after the inventors Rivest, Shamir and Adleman) uses prime number arithmetic to
create the pair of keys. One key cannot be calculated from the knowledge of the other. See also
(http://www.rsa.com).

(C) SAP AG BC440 10-10
SAP AG 2001
Certification Server
The server generates one pair of keys
(public key and private key)
A certification server (C server)
generates one pair of keys
(public key and private key)
The server sends its public key to the
C server and receives a certificate
encrypted with the private key of the C server
containing the public key of the server
Certification server in the Internet:
www.verisign.com




(C) SAP AG BC440 10-11
SAP AG 2001
Public key (C server) Private key (C server)
M
e
s
s
a
g
e
I
D
Client Server
Hash code Hash code
Internet Internet
=?
C
e
r
t
i
f
i
c
a
t
e
Private key (server) Public key (server)
SSL - Setting Up the Connection (1)
The client calls the server (not shown)
The server responds with the certificate, test message and ID




(C) SAP AG BC440 10-12
SAP AG 2001
Public key (server) Private key (server)
Client Server
Internet Internet
SSL Setting Up the Connection (2)
The client sends a shared key via the secure connection to
the server
Symmetrical encryption is then used




(C) SAP AG BC440 10-13
SAP AG 2001
SRGB - Standard RGB Palette for the WWW
Requirement:
Display images with identical quality in all browsers
Assumptions:
A color palette with 256 different colors is available
Each color can be chosen from 16 million colors
Red: 0...255, Green: 0...255, Blue: 0...255 (24 bit)
The browser (and other programs) requires some colors for
windows and dialog boxes
Color palette:
6 grades per color channel
Dec. 000, 051, 102, 153, 204, 255 and hex. 00, 33, 66, 99, CC, FF
6 * 6 * 6 = 216 colors for images, 40 for windows and dialog boxes
http://www.w3.org/Graphics/Color/SRGB.html




(C) SAP AG BC440 10-14
SAP AG 1999
Appendix
Internet, Intranet and WWW
Internet, Intranet and WWW
Using the SAP@Web Studio Without IACOR
Using the SAP@Web Studio Without IACOR
WebRFC
WebRFC
Installation and Administration
Installation and Administration
System Environment for Training
System Environment for Training




(C) SAP AG BC440 10-15
SAP AG 1999
Appendix
Internet, Intranet and WWW
Internet, Intranet and WWW
Using the SAP@Web Studio Without IACOR
Using the SAP@Web Studio Without IACOR
WebRFC
WebRFC
Installation and Administration
Installation and Administration
System Environment for Training
System Environment for Training




(C) SAP AG BC440 10-16
SAP AG 1999
ITS ITS
ITSxxx ITSxxx
AGate
ITSxxx_ITS
Web server Web server
ITSxxx ITSxxx
ITSxxx_WWW
HTML
WGate
TCP port 1081
Web server Web server
ADM ADM
ADM_WWW
WGate
TCP port 1080
R/3 R/3
application application
server server
Participants' Participants' PCs PCs
Instructor's Instructor's PC PC
SAP GUI
Web browser
HTTP demo
Notepad
Web Studio
Project
DIAG
RFC
Network
HTTP
ITS ITS
ADM ADM
AGate
ADM_ITS
Adminstration
Training Training server server
System Environment for Training

Das könnte Ihnen auch gefallen