/
2.1.11.1.1.3. BADI Search for Batch number

2.1.11.1.1.3. BADI Search for Batch number

At this point the creation of a screen BAdI enlargement for the Cockpit tab "Search by Batch Number" will be treated.

This extension will consist of adding select-option fields in the selection dynode of the tab "Search by Batch Number" 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. Within it we access the BAdI /EDGE/BADI_SII_COCKPIT_SEL 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 made for this example you enter the select-options fields to be considered in the dynpro and the subsequent data selection. In the example the field considered is /EDGE/SII_ERRCOD-ERROR_CODE (Error code for AEAT responses).

Then, within the function group mentioned, a new function is created in order to retrieve the values entered in the select-option declared in the subscreen of the function group itself (in the example, the value of S_CODE).

 


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 (only used in the tab 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_NUM_LOTE). Code is shown for the proposed example:


 
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:

 

Avvale 2024