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.


Note: The field names in the append structure and CI_AUFK structure are retained the same so that the standard code automatically populates the values for the custom fields.
Append Structure.jpg

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.

ES_RIAUFK20 - Enh Impl.jpg

In the created implementation, add the below code to create the selection screen inputs.

EnhImp01.jpg


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.


EnhImp02.jpg

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.


EnhImp03.jpg

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.

EnhImp04.jpg


Result


Input Selection Screen

Input_Result.jpg


ALV Output

Output_Result.jpg

To report this post you need to login first.

Be the first to leave a comment

You must be Logged on to comment or reply to a post.

Leave a Reply