![](/cvo_files/imgs_sap_abap/logos/logo_cvo_academy_it.png)
✒️ABAP La construcción del formulario: tablas, líneas de código y gráficos
ABAP La construcción del formulario: tablas, líneas de código y gráficos
![ABAP La construcción del formulario: tablas, líneas de código y gráficos ABAP La construcción del formulario: tablas, líneas de código y gráficos](https://www.cvosoft.com/cvo_files/imgs_sap_abap/og-images/409.jpg)
SmartForms Construction: Tables, Code Lines, and Graphics
Tables
Inserting a table into a Smartform allows us to visualize its content. To create a table, follow these steps:
- Hover the mouse over one of the windows. Right-click and go to Create => Table.
- The table will be created with a default name %TABLE1 and subfolders Header, Main Area, and Footer. Replace the default table name with one that clarifies its function and provide a suitable description.
- The tab set forms the Table Painter. The Table Painter allows us to:
-
Set the number of rows and columns.
-
Set the height of each row.
-
Set the width of each column.
-
Specify the alignment of the table in the window.
-
Specify how and where separator lines or frames will be displayed.
-
Set colors for rows and columns.
-
Using the Details button, you can manually perform everything done with the table painter and more.
- Given the interest in displaying the data from a dictionary table passed as a parameter in this table, we need to create a line type that contains a column for each field of the table to be displayed in the form, along with its width. Ensure that the sum of the column widths matches the total width of the row and does not exceed it, as this would generate an error.
- In the Data tab, specify both the internal table that will collect the data from the dictionary table and its structure, which will be the same as the internal table but without the client field. The internal table and its structure must have been declared in the global parameters of the form. For this internal table, you can specify conditions in the WHERE clause as well as sorting criteria in the Sorting Criteria window.
- In the Calculations tab, calculations can be performed with the fields of the internal table.
- In the Output Options tab, specify the style that will affect the table overall; this will be applied to the entire form but could vary.
- In the Conditions tab, set the display conditions of the table similar to those of the windows.
- Once the table is created and configured, assign the Line Types created to the subfolders of the Main Area. To do this, hover the mouse over each of the specified subfolders and right-click to choose Create => Table Entry. Assign the Line Type created in the previous steps. This will generate the specified number of columns in the line.
- Modify the generic descriptions of each column and assign them the same style as the form.
- In each column, insert a text element to place the column header text there.
- Repeat the same steps in the Main Area subfolder. In this case, the content of each table field will be displayed in the Text Element.
Code Lines
It is possible to insert ABAP code into a Smartform. To do this, position the cursor over the window or folder where you want to create the code and right-click to select Create => Processing Logic => Code Lines.
In the General Properties tab, we have:
- Input Parameters: Declare all input variables that will be used in the code. These variables must be declared in the Global Parameters.
- Output Parameters: Declare the output variables that will appear in the code.
In the editor of the same General Properties tab, write the necessary code. To validate its syntax, and this applies to the entire form, go to the Form menu => Verify.
Graphics
It is possible to add graphics such as logos to a Smartform. If we want to import graphics in .BMP or .TIF formats, we can do so using transaction SE78 and the menu option Graphics => Import. Other graphic formats can be imported using transaction OAER. The imported graphic can be viewed from the transaction itself. If we want to Transport the graphic, we must include it in a transport order using the menu option Graphics => Transport.
Now we can place the graphic in our form. To do this, hover the mouse over the corresponding window and right-click to select Create => Graphic Function.
In the General Properties tab, complete the following fields:
- Name: Name of the file to be inserted.
- Object: Graphics corresponding to the BMAP type.
- ID: BMAP
You can choose a color for the image and a resolution.
 
 
 
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