My last blog (https://scn.sap.com/community/erp/hcm/blog/2013/02/12/fpm-forms-scripting) walks through the basic scripting (i.e. dynamically controlling the UI attributes like Visibility and Editable nature) in FPM Forms. Though you can do many things using the backend services, but there is definitely a restriction to this functionality provided in the backend services i.e. if you want to change the label text dynamically or dynamically control the tool tip text, you would never be able to achieve this using the back end service. This might be a common scenario where you would have a Global form, but you would have the labels for the form fields controlled as per country. Well, I did quiet a bit of research on how to achieve this functionality. After understanding the new framework fully, I did find a new place where I can achieve this functionality, though this approach is not a direct route to the solution, but at least it’s an attempt to reach the solution under best practices.
Every HCM Process and forms based FPM Form is linked to a Feeder Class like –
This feeder class has a method – GET_DEFINITION with exporting parameter – ET_FIELD_DESCRIPTION that controls the various attributes of UI elements –
The ET_FIELD_DESCRIPTION for Form layout has the following fields –
Using this parameter, you can now control various attributes of every UI element defined in the form layout i.e. Label, Tool tip, etc. In order to achieve the required functionality create a Post exit using Enhancement framework to the method – GET_DEFINITION.
- Ideally I wish to have the UI Attributes controlled from the back end services. The INITIALIZATION and DO_OPERATIONS methods should have the CHANGING Parameter i.e. ET_FIELD_DESCRIPTION which should have the above structure.
- If my first wish is not feasible, I would at least expect some kind of BADI to control the UI Attributes alone rather than building these custom enhancements (Pre/Post/Overwrite exits).
Let me know if you have a similar wish list 🙂