‎2019 Nov 13 6:16 PM
Hello, i would like to ask, if its possible to hide dynpro elements (label, IO field etc.) dynamically and not just once in PBO of dynpro. For example i have a 2 buttons (BTN1 and BTN2) and one IO field (IO1) in my dynpro and i want to set logic like this: if i press button 1, IO field will hide, when i press button 2, IO field will appear again. I tried using this code in PAI where i have module user command:
if sy-ucomm =´BTN1´.
LOOP AT SCREEN.
IF screen-name = ´IO1´.
screen-active=0.
modify screen.
endif.
endloop.
endif.
There is same code for BTN2 except i use screen-active=1. Problem is its not working. When i use same code in PBO its working.
I have tried to google it but all examples are for dynpro PBO module - i dont want to use is in PBO or AT SELECTION SCREEN OUTPUT for selection screen - i have dynpro not selection screen.
‎2019 Nov 18 5:01 PM
Hi,
What you need to understand is that each action on a modul pool screen triggers the PAI and then PBO. you need to use both events to fulfill your requirement.
PAI --> all processing just after you click on screen
PBO--> update of display on screen
in your screen, assign a value in screen-group1(choice between 1 - 4).. lets say for example screen-group1 = ´IO1´.
in PAI, if sy-ucomm =´BTN1´... GV_STATUS = 'btn1'
in PBO, if GV_STATUS = 'btn1'
LOOPATSCREEN.IFscreen-name=´IO1´.screen-active=0.modifyscreen.endif.endloop.
‎2019 Nov 13 6:41 PM
Hi,
Did you search in forum
How to Hide UI Elements & Adjust View Layout Dynamically in Web Dynpro ABAP
‎2019 Nov 13 6:56 PM
That guide is for Web dynpro, i was talking about standard (ABAP) dynpro.
‎2019 Nov 13 10:00 PM
Do you mean "radio button" or "push button"?
Screen elements can be customized only if the screen is refreshed by pressing something which is assigned a function code (GUI status menu or keyboard key or a dynpro element), so that the PAI and then the PBO are executed.
By default, radio buttons are not assigned a function code. Just assign them a function code.
A push button is always assigned a function code.
‎2019 Nov 13 11:35 PM
AFAIK You can only change the screen-Data at PBO time and You have to do it every time PBO is run. Otherwise the static definition (i.e. the properties set in Layout Editor) will be used. But I'll be glad to get to know a different way, if there is one.
‎2019 Nov 14 12:28 AM
You should understand that the screen preparing is in PBO event, what you need to do is trigger PBO event. Look at demo: DEMO_DYNPRO_MODIFY_SIMPLE to understand it.
‎2019 Nov 14 7:11 AM
Dear Peter Petro,
The events are well categories. All the user interaction is handled in PAI and screen initialization and modification is done in PBO. This the way how module pool program are developed. You have to stick with the architecture. It's not good to expect the functionality of PBO in PAI. This is not logical.
Hope this clarifies your doubt.
Thank,
Gourab
‎2019 Nov 18 5:01 PM
Hi,
What you need to understand is that each action on a modul pool screen triggers the PAI and then PBO. you need to use both events to fulfill your requirement.
PAI --> all processing just after you click on screen
PBO--> update of display on screen
in your screen, assign a value in screen-group1(choice between 1 - 4).. lets say for example screen-group1 = ´IO1´.
in PAI, if sy-ucomm =´BTN1´... GV_STATUS = 'btn1'
in PBO, if GV_STATUS = 'btn1'
LOOPATSCREEN.IFscreen-name=´IO1´.screen-active=0.modifyscreen.endif.endloop.