Skip to Content
Author's profile photo Balaji Ganapathiraman

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.

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.


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


ALV Output


Assigned Tags

      You must be Logged on to comment or reply to a post.
      Author's profile photo Kumud Singh
      Kumud Singh

      Very neat explanation!


      Author's profile photo Stefan De Vriendt
      Stefan De Vriendt

      Thank you Baliji. This blog really helped me.

      I would not filter the output records depending on the display of the extra fields. (g_fieldcat_tab)

      This allows me to restrict the list on e.g. next planned date = today while not showing that field in the output.

      Author's profile photo AYUSHI D
      AYUSHI D

      I have a requirement of adding 4 custom fields in the ipm2 selection screen in the permit area. please help me how to do if you could please do a log like this

      Author's profile photo Niharika Singh
      Niharika Singh



      which business function should I activate for enhancement in selection_l to e activated. Please help!!