GRC
HR
SCM
CRM
BI


Article

 

SAP Smart Forms: Form Printing in the Internet Age

by Christoph Wachter | SAPinsider

June 1, 2000

by Christoph Wachter, SAP SAPinsider - 2000 (Volume 1), June (Issue 1)
 

With Release 4.6, SAP Smart Forms, SAP's new solution for creating and maintaining forms in SAP systems, replace SAPscript forms. The three most important benefits SAP Smart Forms provide are:

With Release 4.6C, SAP Smart Forms, SAP's new solution for creating and maintaining forms in SAP systems, replace SAPscript forms (see Figure 1). The three most important benefits SAP Smart Forms provide are:

  • Web publishing based on generated XML output

  • The ability to create and maintain forms in minimum time

  • A completely graphical user interface for adjusting forms, without the need for programming skills
Figure 1 SAP Smart Forms - SAP's New Solution for Creating and Maintaining Forms in SAP Systems

     In addition to SAP Smart Forms, mySAP.com applications and R/3 Release 4.6C contain a set of forms for central business processes. You will find forms for Customer Relationship Management (CRM) and Business-to-Business Procurement (BBP), as well as for the R/3 application components Sales and Distribution (SD), Financial Accounting (FI), and Human Resources (HR). While the system contains essential forms for each of these applications, covering them is beyond the scope of this discussion.¹

     In this article, I will explain how the Internet affects form printing (i.e., mass printing) and provide you with an overview of the solutions offered by SAP within the scope of mySAP.com. I will go into detail about the three important benefits mentioned above, and also outline some of the important parts of the technical structure of SAP Smart Forms. But what does "form printing" mean, and what tasks are required of form printing in the Internet Age? Form printing includes:

  • The design and layout of a form (e.g., an invoice, a salary payroll, an account statement, or a tax form)

  • The adaptation of the form logic (e.g., "If the sum of the invoice is less than a certain value, then Text A shall be output" or "If the sum is greater than this value, then Text B shall be output")

  • The preparation for an output medium (e.g., printer or fax); due to space constraints, physical output via out- put management will be left aside here

     You might say, "In the Internet Age, it does not make sense to talk about printing." This is true. We will no longer print forms in the traditional sense, and Web browsers will become the standard output medium. Nevertheless, we still want to display the same content.

     We meet this new challenge by offering a generated XML output of forms for Web publishing. Of course we have to design the form first, which will only take minimal effort. This requires a completely graphical user interface, without the need for script language or programming skills.      In short, in this article I will give you an overview of the mySAP.com solution for all these needs - SAP Smart Forms.

Web Publishing Based on Generated XML Output

Consider the following typical scenario:

In the automobile industry, producers and vendors exchange forms, or 8D reports (see Figure 2). These reports document quality tasks, describe solutions for error corrections, etc. These days, different communication techniques and media are used during such complex processes - e.g., the producer sends a printed report to the vendor, the vendor fills out the report manually and sends it back via fax, and the producer has to type it again and often sends it back once more because of new questions. And this process might happen several times. But is this a cost-efficient and modern solution?

Figure 2 An Automotive 8D Report

     In the near future, with SAP Smart Forms and the Internet Age, the scenario will look like this:

The producer creates an SAP Smart Form for the 8D report, using the generated XML output and the SAP Business Connector for Web publishing; the vendor fills out the report in a Web browser and sends it back. So, communication is practiced via the Internet, any Web browser can be chosen as an output and input medium, the exchange format is standardized (XML), and the vendor is absolutely independent of the producer's system. The whole communication process is faster and much more cost-efficient.

     Already in Release 4.6C, SAP Smart Forms deliver this generated XML output. In the next release, Cascading Style Sheets (CSS) support displaying the processed form in the Web browser (see Figure 3), and input fields for text and data will be implemented by eXtensible Stylesheet Language, or XSL (see Figure 4). In Figure 4, the price field can accept input, which means you could make changes to it directly in the Web browser. (An input check via tables or other checks, however, are not planned for the next release.) Designing the form, you will be able to define input fields simply by choosing attributes. For example, in the Smart Form you could mark the price field as accepting input. The system would then generate the relevant XML data stream, and the field would be ready for input in the Web browser.

Figure 3 The Web Browser As Output Media on Forms

 

Figure 4 Offline Data Entry in a Web Browser

     From a technical point of view, a Document Type Definition (DTD) that describes the structure of the forms is defined for the generated XML output (see Figure 5). This DTD complies with the general XML specification of SAP. The XML data flow is generated and output is based on the form logic in the tree structure (I'll discuss this in more detail later) and the DTD.

Figure 5 Example of Generated XML Output of a Processed Form

A Marketplace Vision

In the near future, it will be possible to procure goods and services using forms in a marketplace. This will simplify and speed up your work. The marketplace will contain the following capabilities and services:

  • A large number of business templates for form printing, for use in different countries and industries, including the SAP Form Catalogue, which is currently under construction
  • Form printing solutions, including SAP Smart Forms
  • Partners that will provide form printing services (e.g., templates, form maintenance, consulting, application hosting)
  • Customers who will be able to choose a form from a portal (such as the mySAP.com Marketplace), fill it out, and send it directly to the desired destination via the Internet
  • Users who will be able to use drag- and-relate functionality to adjust data (XML format) in a preconfigured form
  • Power users (no programming skills required) who will be able to change electronic forms in a Web browser

     Let's now take a closer look at the benefits of the SAP Smart Forms tool.

The Ability to Manage Forms in Minimum Time

The SAP Simplification Group - in Palo Alto, California - conducted a market analysis, and here are the convincing results: during the implementation process, 60 percent of the time is spent on data retrieval, form logic maintenance, and testing, and 40 percent is spent on layout design, training, and going live. With these factors in mind, it becomes clear that a graphical user interface, and especially a graphical display of the form logic, can contribute significantly to reducing implementation costs - by perhaps 50 percent or more. Using SAP Smart Forms, you can adjust forms in minimum time. This allows you to considerably reduce the implementation costs of SAP systems.

The Graphical User Interface

The SAP Smart Forms tool includes an easy-to-use, intuitive, graphical Form Painter and a graphical Table Painter. (see Figure 6)

Figure 6 The Design Area of the Graphical Form Painter

     The graphical Form Painter provides a graphical display for creating and adjusting the form layout. Here are some of the highlighted features:

  • Cursor position is shown in the ruler, which can be hidden and customized

  • Position and size of an output area (window) is shown in the ruler

  • Two-level customizable grid with alignment function

  • Individual zoom factors and automatic zooming of the design window, depending on the window size

  • Automatic scrolling of the design area

  • Output areas (windows) can be sent to the background

  • Toolbar with access to the essential functions can be detached from the design area

  • Scanned forms can be used as the background in the design area and can also be printed Using the graphical Table Painter, (see Figure 7), you can draw tables and edit individual cells. The tables contain line breaks in single table cells, event control for table headers and subtotals, and data sorting before output.
Figure 7 The Graphical Table Painter

Inside the Structure of SAP Smart Forms

In addition to form design, Smart Forms provide a graphical environment for changing the form logic. According to the architecture of Smart Forms, in which the data retrieval in the application program and the form logic in the Smart Form itself are strictly separated, you only have to change the logic within the Smart Form. Once you have done this, there is a range of test tools and services that you can use to check the Smart Form.

Changing the Form Logic

The form logic is represented in a hierarchical structure (tree structure) that consists of nodes, including nodes for global settings, text, output tables, and graphics. You can make changes to the nodes by using drag-and-drop and copy-and-paste techniques, as well as by selecting attributes and parameters on the relevant maintenance screen. In addition, you can use a context menu whose options differ depending on the node. There is no need for you to write a single line of code or to use a scripting language. Therefore, power users who have no programming knowledge, but are familiar with their application, can easily configure forms with data from SAP systems for their relevant business processes. This means that Smart Forms address a new and larger user community, not only saving you valuable time but also reducing the implementation costs of forms.

The Architecture of SAP Smart Forms

The form logic is entirely represented in an SAP Smart Form, and you can adjust this logic with graphical tools. The data of a Smart Form is provided by an application program, and it is passed via a function module interface (see Figure 8). When you activate a Smart Form, the system automatically generates a function module, which is processed at runtime. As a result, data retrieval and form logic are totally separated. If changes are made to the logic, only the Smart Form needs to be adjusted accordingly.

Figure 8 SAP Smart Forms Architecture

     As I said earlier, the form logic is represented in the Smart Form in a hierarchical structure (tree structure). This structure consists of nodes - for example, nodes for global settings, text, output tables, or graphics. In this hierarchy, the flow logic is shown from top to bottom, and nodes that appear on higher levels are known to the nodes further down (see Figure 9). This ensures that flow control is strict and unambiguous. This flow logic is used to process the form and determines, for example, which window will be output on a specific page at a particular time.

Figure 9 The Tree Structure and Output Control of a Smart Form

     To meet special requirements, programmable exits are available - for example, to call a function module created by the customer. Program SF_EXAMPLE_02, shown in Listing 1 on page 84, is an example of an application program. Aside from the data declaration (data...) and the data retrieval (select * ...), only two function module calls are necessary. Function module SSF_FUNCTION_ MODULE_NAME carries out the first- generation step and passes the corresponding Smart Form. The fm_name generated defines the relevant data transfer - in our example, the three tables customers,bookings, and connections. As you can easily see, no form logic is included!

 

*	Report SF_EXAMPLE_02
*---------------------------------------------*
*	Printing of documents using SAP Smart Forms:*
*	in this example the carrids are also sorted *
*	when printing the customers bookings        *
*---------------------------------------------*
report sf_example_02.


data:	carr_id type sbook-carrid,
     fm_name type rs38l_fnam, 
     l_errtab type tsferror.


parameter: s_custid type scustom-id default 1.
select-options: s_carrid for carr_id default 
                         'LH' to 'LH'.
data:	customers type ty_customers,
			bookings type ty_bookings,
			connections type ty_connections.


*	get data
	select * from scustom into table customers
     where id = s_custid
     order by primary key.
	select * from sbook  into table bookings
     where customid = s_custid and 
     carrid in s_carrid 
     order by primary key.
	select * from spfli into table connections 
     for all entries in bookings 
     where carrid = bookings-carrid 
     and connid = bookings-connid 
     order by primary key.


*	print data
	call function 'SSF_FUNCTION_MODULE_NAME'
		exporting		formname = 'SF_EXAMPLE_02'
*							variant = ' '
*							direct_call = ' '
		importing 	fm_name = fm_name
		exceptions	no_form = 1
                  no_function_module = 2
                  others = 3.
	if sy-subrc <> 0.
*		error handling
		message id sy-msgid type sy-msgty number 
			sy-msgno
			with sy-msgv1 sy-msgv2 sy-msgv3 
			sy-msgv4.
		exit.
	endif.

	call function fm_name
			exporting
*				archive_index =
*				archive_parameters =
*				control_parameters =
*				mail_appl_obj =
*				mail_recipient =
*				mail_sender =
*				output_options =
*				user_settings = 'X'
				customers = customers
				bookings = bookings
				connections = connections
*			importing 
*				document_output_info =
*				job_output_info =
*				job_output_options =
			exceptions 
				formatting_error = 1
				internal_error = 2
				send_error = 3
				user_canceled = 4
				others = 5.
	if sy-subrc <> 0.
*		error handling
		message id sy-msgid type sy-msgty number 
               sy-msgno
               with sy-msgv1 sy-msgv2 sy-msgv3 
               sy-msgv4.
     endif.

*	analyse internal error table of Smart Forms
	call function 'SSF_READ_ERRORS'
		importing
			errortab = l_errtab.
	if not l_errtab is initial.
*		add your handling
	endif.
Listing 1 Example of an Application Program

     To define the output of windows (output areas) and text, you can choose events and points of time as attributes. You can determine, for example, that a certain text will be printed only on the first page.

Convenient Services

Form testing is also considerably accelerated with SAP Smart Forms, since the entire form is checked automatically, and any errors in the hierarchical structure (tree structure) are detected (see Figure 10 on page 85). In addition, during data flow analysis, the system verifies whether all symbols have a defined value at the time of output. This allows you to test a Smart Form quickly and easily, also speeding up the analysis and correction of process errors.

     You can also show a field list (see the lower left of Figure 10), which provides a structured view of all of the fields passed through the interface. This makes it easier to select fields and insert them with drag and drop in the Smart Form.

Figure 10 Convenient Services Provided by SAP Smart Forms

Replacing SAPscript Forms

SAP Smart Forms take the place of SAPscript forms, but SAP provides continued support for SAPscript forms, which can be used for several years without modification. This ensures that you can continue to use the "old" forms, even though new forms are delivered only as Smart Forms. Also, SAPscript text can be used in Smart Forms. To convert "old" SAPscript forms into Smart Forms, a migration tool is included with SAP Smart Forms that provides optimum conversion. This tool copies, for example, the complete form layout (pages and windows); the paragraph and character formats; and the command lines in the form of comment lines (in order to give a template of the logic of the old forms) into Smart Forms.

Conclusion

The Internet does not make forms obsolete, but the output medium is now the Web browser rather than the printed page, and this new medium is the foundation for new requirements and solutions. SAP Smart Forms are a state- of-the-art tool for creating traditional forms for the Internet Age and adjusting them in minimum time. Additionally, they supply a generated XML output that enables you to publish your forms in a standardized format, and to successfully use the Internet as the future medium.

SAP Web Resources

SAP
www.sap.com

mySAP.com Marketplaces
www.mysap.com/marketplace/

mySAP.com Workplaces
www.sap.com/solutions/workplace/

mySAP.com Business Applications
www.sap.com/solutions/ business_applications/

SAP TechEd 2000
www.sapteched.saplabs.com

SAP Labs
www.saplabs.com

SAP Open BAPI Network
www.sap.com/bapi

SAP Publications

SAP Insider
www.sapinsider.com

SAP Professional Journal
www.SAPpro.com

SAP User Group ASUG
www.asug.com

SAP-Related Web Sites

SAP Fan Club
www.sapfans.com

SAP Club
www.sapclub.com

Web and XML Standardization Organizations

World Wide Web Consortium (W3C)
www.w3.org

XML.ORG
http://xml.org

RosettaNet
www.rosettanet.org

Microsoft BizTalk
www.biztalk.org

Open Applications Group (OAG)
www.openapplications.org

 


¹ For more detailed information on the topic of SAP Smart Forms, see Christoph Wachter's article "From New Graphical Tools to SAP Smart Forms - The Next Generation of SAPscript" in the November/December 1999 issue of the SAP Professional Journal. For information on the SAP Professional Journal, visit www.SAPpro.com.

Christoph Wachter received his honors degree in physics in 1995 from the University of Karlsruhe, Germany. After working as a technical writer and quality manager for a medium-sized enterprise, he joined SAP in 1997. Currently, Christoph is working in the Application Engineering Workbench department, where he is responsible for Product Management of SAP Smart Forms. Other special areas he works in include the ABAP Workbench and Controls Technology. You can reach him at christoph.wachter@sap.com.

An email has been sent to:






More from SAPinsider



COMMENTS

Please log in to post a comment.

No comments have been submitted on this article. Be the first to comment!


SAPinsider
FAQ