Using Feature to Default values in Infotype (Programmatically)
In this document, we will see how to use feature to default values in Infotype field. We will be using feature ‘TARIF’ to default pay scale type/ pay scale area fields in IT0008.
1. Following structure [PME01 structure in SE11 tcode] is available for which the we can filter the values upon certain conditions before defaulting the values using feature.
All the component in the above structure can be used to filter the values before defaulting values in the Infotype.
2. For all the features normally documentation will be available in PE03 tcode, Documentation radio button and can be accessed by pressing ‘Display’ button. Documentation of TARIF feature is as below.
The return value of this feature will be in the form XX/YY, and will default the value value ‘XX’ to pay scale type and ‘YY’ to pay scale area of basic pay infotype IT0008.
In feature tree select MOLGA and click on create button, window will pop-up having different country options, select country for which feature needs to be run (this will act as a filter value).
Now again go the country that we selected in the previous step and press create button, pop-up having different options emerges, give a program name which will be used for defaulting values in infotype’s field (here we have used ZDEF_PSCALE) and click OK button.
4. Now, open ABAP editor using SE38 and write the code to default values in infotype. Here, nested CASE statements are used to replicate PME01 conditions tree and write the filter conditions in our code accordingly. BACK return field determines the field values to be defaulted.
5. In our case, for country grouping Croatia, this code is triggered from a standard function module ‘HR_FEATURE_BACKFIELD’ and defaults the value in IT0008 as below.
Routine ‘CALL_549B’ above is called from feature ‘HR_FEATURE_BACKFIELD’, which in turn calls our custom program.
6. This defaults the values of pay scale type and area as per our requirement.