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.

• 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. These fields are replaced by the current data at runtime via Interface. • But form interfaces do not support Changing parameters. .Interface in the Form Builder • Insert fields as placeholders in the form to specify the appearance and location of the data in the form.

Interface in the Form Builder • Form Interface can be the following – – ABAP Dictionary-Based Interface – XML Schema-Based Interface – Smart Forms-Compatible Interface .

the system shows the available system fields automatically in the interface. • We can assign currency and quantity fields reference. You can use form routines that are defined in the ABAP Editor. You can then drag and drop the required fields to the context.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 Code Initialization.ABAP Dictionary . When we call the context in the Form Builder. you can create program code to modify global definition data before the form is processed. we define your own fields. . • The System Fields contain data with a predefined meaning (such as the date). • Under Global Definitions. • We cannot enter system fields directly.

 From Transaction SFP .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.

Creating Interface .

Creating Interface .

Creating Interface  When we double-click Export. to make the generated form available as a PDF for further processing. we can see the standard parameter /1BCDWB/FORMOUTPUT of the generated function  We cannot change this parameter.  -.screenshot on next slide -- .  We use this parameter in out application program.

Creating Interface .

Exceptions .

but which has not been provided by the form interface (for example. .  Global Data  We define any data needed by the form.  We can initialize global data before start to process the form.  Types  We create data types as free ABAP code. to convert selected application data.Global definitions .  Field Symbols  We can use field symbols as pointers when you extract data from internal tables. for example. if the ABAP Dictionary does not provide a type. to display totals).interface of form builder  We have an option of defining own fields to be used anywhere in the form.

Types .

Global data Declaration of Global Variable of Global Type .

for example.  We use the ABAP Editor to write the program code (Code Initialization) that is executed before the form is processed. .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.  We can include subroutines (Form Routines) when we do this.  We can also select additional data without having to make changes in the application program. to convert selected application data.

Initialization .

the system cannot recognize this reference automatically.  In the second case. 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.  If the value field is in a different table from the currency or quantity field. . to ensure that the value field is formatted correctly.  In the output of these fields. and formats the value field according to the currency or unit in the assigned field. we can assign a currency or quantity field to a table field.Specifying a Currency or Quantity Reference  In the ABAP Dictionary. we must indicate this reference to the system in the form.

– Reference Field: CURTAB-CURRENCY. . which is the currency field of CURTAB. VALTAB).. specify whether the data type is a currency or quantity. • Create the reference to the currency field by entering the following values: – Field Name: VALTAB-VALUE.Specifying a Currency or Quantity Reference • If we want to assign a currency or quantity field in one table (for example. – Under Data Type.. • . if this is the value field of VALTAB that you want to display. CURTAB) to a value field in another table (for example.

Specifying a Currency or Quantity Reference .

.  If a parameter has been defined in the form. but is not defined when the application program is called. This has the advantage that an application program can work with several different forms.  It is also possible that the application program provides parameters that the form does not need. the application program must provide all the mandatory parameters that are declared in the Interface.Possibilities of Errors  At runtime. they can also be specified in a different order from the code of the application program.  We do not need to mention these parameters in the form. then the output of the form ends with the program crashing (hex dump).