![](/cvo_files/imgs_sap_abap/logos/logo_cvo_academy_it.png)
✒️ABAP La construcción del formulario: configuración general, páginas y ventanas
ABAP La construcción del formulario: configuración general, páginas y ventanas
![ABAP La construcción del formulario: configuración general, páginas y ventanas ABAP La construcción del formulario: configuración general, páginas y ventanas](https://www.cvosoft.com/cvo_files/imgs_sap_abap/og-images/407.jpg)
FORM DESIGN: GENERAL SETTINGS, PAGES, AND WINDOWS
GENERAL CONFIGURATION OF A SMARTFORM
In the SMARTFORMS transaction, we encounter the first item in the GLOBAL SETTINGS folder with its attributes, where we assign a description to our form.
GLOBAL SETTINGS => FORM ATTRIBUTES
The language of form creation can be found here. We can effortlessly translate to various languages.
In the OUTPUT OPTIONS tab, we configure the following:
- For page format, we leave the default option, which is A4, corresponding to a standard A4 sheet.
- For characters per inch, we stick with the default option, 10.00.
- For lines per inch, we also keep the default option, 6.00.
- For style, we enter the name of the style we created in the first lesson of the unit.
- The output format will be the default one.
GLOBAL SETTINGS => FORM INTERFACE
Here, we specify the variables, structures, and tables received as input by the form.
In the Tables tab, we complement with TI_USERS. To specify the table type:
-
We create a TYPE TABLE in transaction SE11, selecting the Type Table option.
-
We enter a description and the structure excluding the client and activate it.
-
Finally, we use the table type in the table declaration.
GLOBAL SETTINGS => GLOBAL DEFINITIONS
- Global Data: We specify variables, constants, internal tables, etc., for the form.
- Types: We declare the types used in the form.
- Field Symbols: We declare Field Symbols for the form.
- Initialization: We declare the code needed to execute the form, including subroutine calls.
- Initialization: Here, we declare the code needed to execute the form, including subroutine calls, for example, to fetch specific data from SAP tables. Remember to concentrate data selection in the printed program where possible.
- Form Routines: We declare the code of all subroutines specified in the Initialization tab.
- Currency/Quantity Fields: We specify the amount fields used in the form.
Smartforms, like ABAP programs, need activation.
ELEMENTS COMPOSING A SMARTFORM
- Pages: Pages in ABAP Smartforms are the canvas on which various elements of the form are placed. A form may consist of one or more pages, with each page representing a segment of the output document. Pages help organize and structure the content of the form, facilitating the presentation of data.
- Windows: Windows in ABAP Smartforms are designated areas within a page where data and other elements are displayed. They serve as containers for text, graphics, tables, and other visual components. Windows enable the arrangement and layout of content on the page, allowing for precise control over the appearance of the form.
- Graphics: Graphics refer to visual elements such as images, logos, or diagrams that can be included in ABAP Smartforms. They enhance the visual appeal of the form and can convey additional information to the end-user. Graphics are often used to brand documents or provide illustrative content.
- Text Elements: Text elements in ABAP Smartforms are used to display textual content within the form. They allow for the insertion of static text, dynamic text generated from variables or data fields, and formatted text with different fonts, sizes, and styles. Text elements are fundamental for conveying information and instructions in the form.
- Text Modules: Text modules in ABAP Smartforms are reusable blocks of text that can be inserted into the form. They are particularly useful for standardizing text segments that appear frequently across multiple forms or pages. Text modules simplify form maintenance and ensure consistency in language and terminology.
- Addresses: Addresses in ABAP Smartforms represent fields or placeholders for displaying contact information such as names, addresses, phone numbers, and email addresses. They are commonly used in forms such as invoices, delivery notes, or letters to communicate recipient details effectively.
- Tables: Tables in ABAP Smartforms are used to organize and present structured data in a tabular format. They consist of rows and columns where data fields are populated dynamically from internal tables or database queries. Tables allow for the efficient display of data in a structured manner, making it easier for users to interpret and analyze information.
- Conditions: Conditions in ABAP Smartforms are rules or criteria that determine whether certain elements or sections of the form should be displayed or hidden based on specific conditions. They enable dynamic content visibility and customization, allowing forms to adapt to varying data or user inputs.
- Loops: Loops in ABAP Smartforms are used to iterate over collections of data, such as internal tables or database result sets, and repeat certain elements or sections of the form for each iteration. Loops facilitate the dynamic generation of content based on the size or characteristics of the data set, improving form flexibility and scalability.
- Code Lines: Code lines in ABAP Smartforms refer to segments of ABAP code embedded within the form for implementing custom logic or functionality. They can be used to perform calculations, manipulate data, or control the flow of the form based on specific requirements. Code lines extend the capabilities of Smartforms beyond basic layout and presentation.
- Commands: Commands in ABAP Smartforms are predefined actions or operations that can be applied to form elements or executed within the form processing logic. They include functions such as navigating between pages, submitting data, or triggering events based on user interactions. Commands enhance the interactivity and usability of Smartforms.
- Folders: Folders in ABAP Smartforms are organizational containers used to group related elements or sections within the form. They help maintain a structured hierarchy and simplify form navigation and management. Folders can be used to organize form components such as pages, windows, graphics, or text elements, making it easier to locate and maintain specific parts of the form.
PAGES
A form consists of one or more pages. The main page is the starting page that already exists when the form is created. We must rename it and provide a description since ABAP assigns a generic name by default, which in this case is %PAGE1. We'll change it to FIRST with the description "First page".
In the General Properties tab, we can specify the next page, if any, after the FIRST; if no other page exists, we leave the main page as the next one.
The pages of a form differ in their structure. For example, the first page of an invoice contains addresses not to be shown on the next page but business general terms to be shown on the last page. For each page, a following page must be specified to establish a page sequence. We can also call the same page repeatedly for recursive output, e.g., if the item list of the invoice is too long for a single page document. Any page break is automatically triggered by the main window or can be manually coded in the form logic.
Many forms contain only one page with different structures: the first one calling the next, and the next calling itself. If the text doesn't fully fit on the second page, another page is automatically displayed.
OUTPUT OPTIONS tab: we specify the page format, whether Portrait or Landscape, and print mode characteristics in the printing mode option.
BACKGROUND PICTURE tab: we add a background image, ensuring to complete the OUTPUT MODE option with the output type to respect the graphic. We must upload the image to SAP.
WINDOWS
Windows are output areas for the data shown within the pages of the form. When creating a new form, the MAIN window is automatically generated within the %PAGE1 page.
There are various window types, but generally, two are used: the main MAIN WINDOW, which can be one per page, and secondary or Auxiliary Windows, which can exist as many as needed.
The main features of windows include:
- Windows can be positioned anywhere on a page, even overlapping each other.
- The same window can be used on multiple pages of a form so that the same contents are displayed on all pages.
- Different sizes can be chosen for each window on each page except for the main window.
- The main window displays information that can span several pages. When the main window on the first page is filled, the system continues to show the main window's contents on subsequent pages, automatically triggering a page break. This does not happen with secondary windows.
- The main window can have the same width on each page but its height may vary.
- If secondary windows with the same name are created on several pages, the system displays the contents of that secondary window on each page.
Steps for creating a new window:
Right-click on the page name and select CREATE/WINDOWS.
Change the name and description, and in the GENERAL PROPERTIES tab, configure the window type.
In the OUTPUT OPTIONS tab, specify window dimensions.
Mark the Lines with option. This generates the box in the windows even if no content is printed.
To configure window dimensions and position on the page, we can also use Form Painter, a tool allowing us to configure the layout or arrangement of windows in a form.
In the CONDITIONS tab, we configure conditions for window display.
FORM PAINTER is the tool belonging to the smartforms transaction that allows us to configure the layout or arrangement of windows in a smartform.
FORM PAINTER CONFIGURATION
MENU => UTILITIES => OPTIONS => FORM PAINTER
 
 
 
Sobre el autor
Publicación académica de Jaime Eduardo Gomez Arango, en su ámbito de estudios para la Carrera Consultor ABAP.
Jaime Eduardo Gomez Arango
Profesión: Ingeniero de Sistemas y Computación - España - Legajo: SW34C
✒️Autor de: 149 Publicaciones Académicas
🎓Egresado de los módulos:
- Carrera Consultor en SAP Fiori
- Carrera Consultor ABAP Nivel Avanzado
- Carrera Consultor ABAP Nivel Inicial
Disponibilidad Laboral: FullTime
Presentación:
Ingeniero de sistemas y computación con 8 años de experiencia el desarrollo frontend & backend (react/node) y en cloud (aws), actualmente desarrollando habilidades en sap btp, ui5, abap y fiori.
Certificación Académica de Jaime Gomez