11.1.1.1 BAdI en búsqueda por documento FI/eDocument
En este punto se tratará la creación de una ampliación BAdI de pantalla para la pestaña del Cockpit "Búsqueda por documento At this point the creation of a screen BAdI enlargement for the Cockpit tab "Search by document FI / eDocument" .
Dicha ampliación consistirá en añadir campos de select-option en el dynpro de selección de la pestaña "Búsqueda por documento FI/eDocument" y que además los valores introducidos en los mismos sean considerados como filtro durante la ejecución.
Paso 1. Creación de la ampliación
A través de la transacción SE18 accedemos al punto de ampliación will be treated.
This extension will consist of adding select-option fields in the selection dynode of the tab "Search by document FI / eDocument" and in addition the values entered in them are considered as a filter during execution.
Step 1. Creating the Enhancement
Through transaction SE18 we access the enhancement point /EDGE/SII_COCKPIT. Dentro del mismo accedemos a la Within it we access the BAdI /EDGE/BADI_SII_COCKPIT_SEL y creamos una implementación de la misma.
Una vez creada, accedemos a la opción "Ampliaciones de imagen" para ver el detalle de la imagen y el área de subscreen generadas. La imagen correspondiente a esta ampliación es la número 16. Junto a estos campos, podemos ver otros dos que se pueden completar llamados "Programa" y "Subscreen" que indicaremos como completar en un paso posterior.
Paso 2. Creación del grupo de funciones
A través de la transacción SE80 creamos un nuevo grupo de funciones y declaramos un subscreen de selección en el correspondiente include.
En el subscreen mencionado se introducen los campos select-options que se van a considerar en el dynpro y en la selección de datos posterior. En el ejemplo el campo considerado es BKPF-BKTXT (texto de cabecera de documento financiero).
A continuación, dentro del grupo de funciones mencionado, se crea una nueva función con el objetivo de recuperar los valores introducidos en los select-options declarados en el subscreen del propio grupo de funciones (en el ejemplo, los valores de S_BKTXT).
Paso 3. Referenciación del grupo de funciones y creación de métodos en la ampliación
Una vez realizados los pasos anteriores hay que referenciar en la implementación de la BAdI el grupo de funciones y la subscreen creadas. El grupo de funciones siempre tiene que tener la nomenclatura SAPL* a la hora de indicarlo como programa.
En los métodos de la implementación deberemos programar la recuperación de los valores de los select-options que hayamos declarado y también el filtrado usando los valores recuperados. Los métodos a utilizar son los siguientes (solo se utilizan para la pestaña que estamos tratando):
En el primer método recuperamos los valores de los select-options a través de la función previamente desarrollada en el punto and create an implementation of it.
Once created, access the option "Screen Implementing" to see the detail of the screen and the subscreen area generated. The picture corresponding to this extension is the number 16. Next to these fields, we can see another two that can be completed called "Program" and "Subscreen" that will indicate how to complete in a later step.
Step 2. Function Group Creation
Through transaction SE80 we create a new group of functions and declare a selection subscreen in the corresponding include.
In the subscreen mentioned, you enter the select-options fields to be considered in the dynpro and in the subsequent data selection. In the example the field considered is BKPF-BKTXT (Financial document header text).
Then, within the aforementioned function group, a new function is created in order to retrieve the values entered in the select-options declared in the subscreen of the function group itself (in the example, the values of S_BKTXT).
Step 3. Referencing the function group and creating methods in the extension
Once the previous steps have been performed, you must reference in the BAdI implementation the function group and subscreen created. The function group always has to have the SAPL * nomenclature when it is indicated as a program.
In the methods of the implementation we will have to program the recovery of the values of the select-options that we have declared and also the filtering using the recovered values. The methods to use are the following (they are only used for the tab that we are dealing with):
In the first method we retrieve the values of the select-options through the function previously developed in point 2 (Z_GET_DATA). Se muestra código para el ejemplo propuestoCode is shown for the proposed example:
En el segundo se efectúa el filtrado de la información a mostrar a partir de los valores completados en los select-options. Se muestra código para el ejemplo propuesto:
In the second the filtering of the information to be displayed is performed from the values completed in the select-options. Code is shown for the proposed example: