19
Interface in the Form Builder To include data in our form This can include the following data: Data selected from the database tables of your application. You use the form interface to specify this data. Data provided by the SAP system or by the PDF- based print forms solution, such as dates. Data that you have calculated or implemented in a form yourself, such as totals for tables. For all three of these data types, the data is not specified or inserted in the form until runtime.

Form Builder - Interface

Embed Size (px)

DESCRIPTION

sap adobe form builder - interface

Citation preview

Page 1: Form Builder - Interface

Interface in the Form Builder

• To include data in our form• This can include the following data:

Data selected from the database tables of your application. You use the form interface to specify this data.Data provided by the SAP system or by the PDF-based print forms solution, such as dates.Data that you have calculated or implemented in a form yourself, such as totals for tables.

• For all three of these data types, the data is not specified or inserted in the form until runtime.

Page 2: Form Builder - Interface

Interface in the Form Builder

• Insert fields as placeholders in the form to specify the appearance and location of the data in the form. These fields are replaced by the current data at runtime via Interface.

• The form interface is a part of the Interface form object and is defined in the Form Builder.

• The form interface of a form is structured in the same way as the interface of a function module in the system.

• But form interfaces do not support Changing parameters.

Page 3: Form Builder - Interface

Interface in the Form Builder

• Form Interface can be the following –– ABAP Dictionary-Based Interface

– XML Schema-Based Interface

– Smart Forms-Compatible Interface

Page 4: Form Builder - Interface

ABAP Dictionary - Based Interface

We have the following options for including data in PDF-based print forms

• In the form interface, we specify the data that is exchanged with the application program (such as tables).

• Under Global Definitions, we define your own fields. • The System Fields contain data with a predefined meaning (such

as the date).• We cannot enter system fields directly. When we call the context

in the Form Builder, the system shows the available system fields automatically in the interface. You can then drag and drop the required fields to the context.

• Under Code Initialization, you can create program code to modify global definition data before the form is processed. You can use form routines that are defined in the ABAP Editor.

• We can assign currency and quantity fields reference.

Page 5: Form Builder - Interface

Creating a Form Object

Two ways of calling the Form Builder for the interface From the ABAP Workbench (Transaction SE80)

Choose Form Objects Interfaces and select an interface. From Transaction SFP

Page 6: Form Builder - Interface

Creating Interface

Page 7: Form Builder - Interface

Creating Interface

Page 8: Form Builder - Interface

Creating Interface When we double-click Export, we can see the standard

parameter /1BCDWB/FORMOUTPUT of the generated function

We cannot change this parameter.

We use this parameter in out application program, to make the generated form available as a PDF for further processing.

-- screenshot on next slide --

Page 9: Form Builder - Interface

Creating Interface

Page 10: Form Builder - Interface

Exceptions

Page 11: Form Builder - Interface

Global definitions - interface of form builder

We have an option of defining own fields to be used anywhere in the form.

We can initialize global data before start to process the form, for example, to convert selected application data.Global Data

We define any data needed by the form, but which has not been provided by the form interface (for example, to display totals).

TypesWe create data types as free ABAP code, if the ABAP Dictionary does

not provide a type.Field Symbols

We can use field symbols as pointers when you extract data from internal tables.

Page 12: Form Builder - Interface

Types

Page 13: Form Builder - Interface

Global data

Declaration of Global Variable of Global Type

Page 14: Form Builder - Interface

Initialization in the interface of form builder

SAP customers can use this function to execute ABAP program code before a form is processed.

We can initialize the global data, for example, to convert selected application data.

We can also select additional data without having to make changes in the application program.

We use the ABAP Editor to write the program code (Code Initialization) that is executed before the form is processed.

We can include subroutines (Form Routines) when we do this.

Page 15: Form Builder - Interface

Initialization

Page 16: Form Builder - Interface

Specifying a Currency or Quantity Reference

In the ABAP Dictionary, we can assign a currency or quantity field to a table field.

In the output of these fields, the system can then insert the

relevant currency or unit:

If the value field is in the same table as the corresponding currency or quantity field, the system recognizes the reference automatically, and formats the value field according to the currency or unit in the assigned field.

If the value field is in a different table from the currency or quantity field, the system cannot recognize this reference automatically.

In the second case, we must indicate this reference to the system in the form, to ensure that the value field is formatted correctly.

Page 17: Form Builder - Interface

Specifying a Currency or Quantity Reference

• If we want to assign a currency or quantity field in one table (for example, CURTAB) to a value field in another table (for example, VALTAB).

• ...• Create the reference to the currency field by entering

the following values:– Field Name: VALTAB-VALUE, if this is the value field of

VALTAB that you want to display.– Reference Field: CURTAB-CURRENCY, which is the

currency field of CURTAB.– Under Data Type, specify whether the data type is a

currency or quantity.

Page 18: Form Builder - Interface

Specifying a Currency or Quantity Reference

Page 19: Form Builder - Interface

Possibilities of Errors

At runtime, the application program must provide all the mandatory parameters that are declared in the Interface.

If a parameter has been defined in the form, but is not defined when the application program is called, then the output of the form ends with the program crashing (hex dump).

It is also possible that the application program provides parameters that the form does not need.

We do not need to mention these parameters in the form; they can also be specified in a different order from the code of the application program. This has the advantage that an application program can work with several different forms.