Group key is not widely used but it has nice feature. Once you group the field catalog fields and you pass the group name into parameter IT_SPECIAL_GROUPS of method SET_TABLE_FOR_FIRST_DISPLAY, then in selection of fields to display in layout change window, you’ll be able to choose to see all hidden fields or the hidden fields from the group you’ve created. If you don’t pass the group name into IT_SPECIAL_GROUPS, then this setting of field catalog has no impact on display.
For my demo program ZDEMO_AIN_CL43, I’ve created a field catalog with REF_TABLE filled for all fields, so it is easier to understand the functionality. Additionally, I’ve hidden all fields that have SP_GROUP filled, so you can check the behaviour directly after running the program.
Figure 109 Field catalog with Group Keys
In the call of SET_TABLE_FOR_FIRST_DISPLAY I’ve added the texts for the groups.
Figure 110 Call of SET_TABLE_FOR_FIRST_DISPLAY with special groups
Now, after launching the function to change of the layout, on the right side of column selection tab, you’ll notice group (or column set) filter. When you expand it, you’ll see all group names from the program.
Figure 111 Layout change screen with Groups (columns sets)
After choosing one of them, you’ll notice that the fields visibility change accordingly to groups assigned in field catalog.
Figure 112 Group From columns set
Figure 113 Group To columns set
This functionality can be very helpful in reports which has many columns to display, as usually you can group the fields with any desired characteristic, for example, in report to list materials with all master data from client, plant and sales organization level, you could use the origin of the columns as a group factor. Or any other split you can imagine.