✒️ABAP La construcción del formulario: textos, variables y campos
ABAP La construcción del formulario: textos, variables y campos
SmartForm Creation: Texts, Variables, and Fields
TEXTS
To create a text in a form, right-click on the window where you want to place the text and select the option create/text. Additionally, we'll change the generic name and description assigned by ABAP. There are four possible types of texts:
TEXT TYPES:
- Text Element: Create a text element within the TITLE window with the text "SYSTEM USERS". Here, we can modify the layout or arrangement of the text.
- Text Module: Used to store frequently used texts in the system for forms. To create one, access transaction SMARTFORMS, select the Text Module radio button, enter the name, and press create. Then complete the module description in the MANAGEMENT tab. Finally, in the TEXT tab, enter the desired text to be displayed at the end of the form. To use the text module, go to the form, create a text within the FOOTER window, change the value in the TEXT TYPE option to TEXT MODULE, and enter the text name.
Text modules are ABAP objects completely independent of the SMARTFORM. This means that when transporting the SMARTFORM to the TESTING environment, we must also transport the text modules we have created for use in that form. Text modules can be downloaded from or uploaded to the SAP system in XML format. To do this, go to the UTILITIES menu and choose the UPLOAD or DOWNLOAD option as desired.
- Include Text: This option is used for texts created with SAPSCRIPTS. To create, modify, and view standard texts, we use transaction SO10, where we write the standard text. To include a standard text in a Smartform, we must specify TEXT NAME, TEXT OBJECT, TEXT ID, and LANGUAGE.
- Dynamic Text: Used when we want to print a variable text that will be defined at runtime.
PRINTING VARIABLES IN TEXTS
To distinguish between a literal text we have written in a text element and a variable whose content we want to print, we must use the button to insert fields in the editor. Upon pressing the button, a dialog box will appear where we can enter fields between &. This way, when executing the form, the content of the variable will be displayed. The variables we use in this way must have been declared previously in the system.
FIELDS LIST
In the menu button FIELDS LIST ON/OFF, a menu composed of the following folders will appear in the lower-left corner of the screen:
- INTERFACE IMPORT: Here, we see all the input variables of the form.
- INTERFACE EXPORT: Here, we see all the output variables of the form.
- INTERFACE TABLES: Here, we see all data declarations made in the form.
- SYSTEM FIELDS: Here, we see the system variables that we can use within our forms.
To print the text "page X of XXX" within the nro_page window, we'll use the system variables SFSY-PAGE and SFSY-FORMPAGES.
Useful Variables
&SFSY-DATE&: Displays the date.
&SFSY-TIME&: Displays the current time in the format HH:MM:SS.
&SFSY-PAGE&: Inserts the number of the current printing page into the text.
&SFSY-FORMPAGES&: Displays the total number of pages for the form being processed. This allows for the inclusion of texts like "page x of y" in the output.
&SFSY-JOBPAGES&: Contains the total number of pages for all forms in the print request being processed.
&SFSY-WINDOWNAME&: Contains the name of the current window.
&SFSY-PAGENAME&: Contains the name of the current page.
&SFSY-PAGEBREAK&: Is set to 'X' after a page break.
&SFSY-MAINEND&: Is set as soon as the main window at the end of the current page is processed.
&SFSY-EXCEPTION&: Contains the name of the returned exception.
 
 
 
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: 102 Publicaciones Académicas
🎓Cursando Actualmente: Consultor ABAP Nivel Avanzado
🎓Egresado del módulo:
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