How To add Custom Fields as Selection Inputs to IW38/39
This document details out the steps to be followed to add custom fields as selection screen inputs to IW38 / IW39 t-codes.
In this example, the custom fields added to CI_AUFK include structure is being added as selection screen input as well as outputted in the IW38 ALV output.
For adding custom fields as output, the structure RIHAUFK_LIST has to be enhanced. An append structure has to be created with the custom fields.
In this example, the custom fields added to CI_AUFK structure are added as fields to the append structure so that they could be added to the IW38 output.
Custom Fields as Selection Screen Input
For adding custom field as a selection screen input to IW38
Create an enhancement implementation to enhancement spot ES_RIAUFK20, as highlighted in GREEN in the below screenshot.
In the created implementation, add the below code to create the selection screen inputs.
For adding labels to the custom selection screen inputs
Create an enhancement implementation at the start of the include MIOLXF19. In this implementation, set the labels for the custom selection screen inputs.
Add custom fields to the fields for selection
Add the custom fields (added to the selection) to the list of fields for selection so that they are always fetched as they are not filtered by standard program. This would be required as the OBJECT_TAB internal table gets populated only for the fields selected in the ALV display layout. For this purpose, the enhancement implementation would need to be created at the end of the routine CHECK_FIELDCAT_VARIANT_L in the program RIAUFK20.
Filter records based on custom field input
In this step, we filter the OBJECT_TAB based on the input on the custom fields. For this purpose, an enhancement implementation would need to be created at the end of the routine SELECTION_L in the program RIAUFK20.
Input Selection Screen