2013 Jan 29 4:32 PM
Hi,
Is there a way from the mainscreen PBO, to hide a subscreen field ?
The subscreen is defined in a different Function group.
Thank you
2013 Jan 29 4:35 PM
Never had to do this, but did you try a LOOP AT SCREEN after the Call Subscreen in the PBO? Then if you find the name of the field, modify it?
Not sure if that would work, but may?
2013 Jan 29 4:42 PM
I tried that but it does not work: LOOP AT SCREEN will only loop by the controls in the main screen not in the subscreen.
2013 Jan 29 4:48 PM
Kind of figured that would be the behavior, but sometimes I get surprised by seemingly simple solutions.
Good luck with this; if necessary and possible (may not be possible if all code is in a MODULE in the function group with the subscreen) an implicit enhancement could maybe be done to the Function Group to hide the screen; you could use a memory id to indicate the call to the screen came from your code, then disable the field.
Implicit enhancements are inherently dangerous; at my company, we use these as a near last resort. If you do decide to go this route, please make sure you put in some way to prevent your enhancement from occurring if not called from your program; also ensure you understand the called program fully to be sure your enhancement will not have any adverse side effects.
2013 Jan 29 5:02 PM
Hi Filipe,
You can modify the subscreen fields at runtime using LOOP AT SCREEN. It is a wrong conception that subscreen fields cannot be modified.
Coming back to your issue, you can pass a qualifier/identifier to determine if the screen field has to be hidden or not.
In the PBO of your subscreen, write the logic to hide the field using LOOP AT SCREEN.
If you want to modify the screen based on any condition, pass the condition using EXPORT TO MEMORY and read the memory value in the PBO of your subscreen.
Hope this helps
Do revert back in case of any issues.
2013 Jan 29 5:08 PM
I can't use the PBO of the subscreen, the main problem is exactly that 😕
2013 Jan 29 5:16 PM