Application Development and Automation 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: 
Read only

Dynpro hide elements dynamically

Former Member
0 Likes
6,063

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.

1 ACCEPTED SOLUTION
Read only

dev_parbutteea
Active Contributor
0 Likes
4,590

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.
7 REPLIES 7
Read only

Nawanandana
Active Contributor
Read only

0 Likes
4,590

That guide is for Web dynpro, i was talking about standard (ABAP) dynpro.

Read only

Sandra_Rossi
Active Contributor
4,590

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.

Read only

michaB_badura
Participant
0 Likes
4,590

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.

Read only

DoanManhQuynh
Active Contributor
0 Likes
4,590

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.

Read only

Gourab_Dey
Product and Topic Expert
Product and Topic Expert
0 Likes
4,590

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

Read only

dev_parbutteea
Active Contributor
0 Likes
4,591

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.