![](/cvo_files/imgs_sap_abap/logos/logo_cvo_academy_it.png)
✒️ABAP La lógica de procesamiento en el PBO
ABAP La lógica de procesamiento en el PBO
![ABAP La lógica de procesamiento en el PBO ABAP La lógica de procesamiento en el PBO](https://www.cvosoft.com/cvo_files/imgs_sap_abap/og-images/34.jpg)
Processing Logic in the PBO
Module Creation
In the flow of logic within a Dynpro, we use modules to perform processing tasks. This is why dialogue programs are referred to as MODULE POOL programs. To call a module, we use the "MODULE" statement followed by the module name.
MODULE STATUS_0100.
If you double-click on a module, the system creates the "MODULE ENDMODULE" statements where indicated. When creating a module in the PBO, its code will start with the statement "MODULE OUT".
MODULE STATUS_0100 OUTPUT.
* Logic
ENDMODULE.
ABAP Code in the PBO of a Dynpro
We utilize the PBO event to select all data and configure what should take effect when the screen is displayed. This includes actions like setting GUI status, modifying field attributes, and initializing screen fields with specific values.
Setting GUI Status and Titles: In the PBO, we define the GUI status and titles for the Dynpro. This is done by creating a module within the PBO event.
PROCESS BEFORE OUTPUT.
MODULE STATUS_0100.
When creating a Dynpro, the module to configure the status and title is already generated but commented out. We typically create an include to store the PBO processing logic. We will use the SET PF-STATUS statement to set the GUI status and SET TITLEBAR to set the title of Dynpro 0100.
*&---------------------------------------------------------------------*
*& Include ZPRUEBA_DIALOGO_PBO
*&---------------------------------------------------------------------*
*&---------------------------------------------------------------------*
*& Module STATUS_0100 OUTPUT
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
MODULE STATUS_0100 OUTPUT.
SET PF-STATUS '0100'.
SET TITLEBAR '0100'.
ENDMODULE. " STATUS_0100 OUTPUT
It's advisable to create an include to store all the modules and subroutines used in PBO processing logic.
Sometimes, when setting a GUI status, we may not want to display all the buttons within it.
For instance, in the following GUI status, we have buttons named BUTTON1, BUTTON2, and BUTTON3. If we only want to display BUTTON1, we need to add the codes of the buttons we don't want to display to an internal table of type SLIS_T_EXTAB. Then, when executing the SET PF-STATUS statement, we include this internal table as follows:
CLEAR ti_buttons.
REFRESH ti_buttons.
APPEND 'Button2' TO ti_buttons.
APPEND 'Button3' TO ti_buttons.
SET PF-STATUS '0100' EXCLUDING ti_buttons.
Modifying Field Attributes of the Screen
The elements of a Dynpro are stored in a structure called SCREEN, a reserved word in ABAP. SCREEN structure holds various attributes of Dynpro fields.
- SCREEN-NAME: Field name.
- SCREEN-GROUP1: Modification group 1 name.
- SCREEN-GROUP2: Modification group 2 name.
- SCREEN-GROUP3: Modification group 3 name.
- SCREEN-GROUP4: Modification group 4 name.
- SCREEN-REQUIRED: Mandatory field.
- SCREEN-INPUT: Input field.
- SCREEN-OUTPUT: Output field.
- SCREEN-INTENSIFIED: Intensified field.
- SCREEN-INVISIBLE: Visible or invisible field.
- SCREEN-LENGHT: Field length.
- SCREEN-ACTIVE: Active field.
- SCREEN-DISPLAY_3D: 3D field.
- SCREEN-VALUE_HELP: Field with search help.
- SCREEN-REQUEST: Field reserved for internal system use.
We can activate or deactivate field attributes using values 0 or 1 and store the changes using the MODIFY SCREEN statement.
MODULE define_attributes_0100 OUTPUT.
LOOP AT SCREEN.
IF screen-name EQ 'wa_screen_0100-DNI'.
screen-invisible = 1.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
ENDMODULE.
Loading Dynpro Fields
To load data into fields, structures, or internal tables and display them on a Dynpro, we assign data to the fields in the PBO.
MODULE load_values_0100 OUTPUT.
wa_screen_0100-dni = 5800056.
ENDMODULE.
 
 
 
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