Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Hide subscreen field from mainscreen

0 Kudos
418

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

6 REPLIES 6

former_member16322
Participant
0 Kudos
235

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?

0 Kudos
235

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.

0 Kudos
235

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.

former_member491621
Contributor
0 Kudos
235

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.

0 Kudos
235

I can't use the PBO of the subscreen, the main problem is exactly that 😕

0 Kudos
235

Is it a standard screen you are talking about??