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/unhide screen elements

Advay
Advisor
Advisor
0 Kudos
572

Hi,

I am using classical screen programming method.

I have a single screen which has following elements

  1. A F4 help
  2. input text field 1
  3. input text field 2
  4. A Sub Area [ which has 2 labels, Couple of custom controls (2 table controls) and couple of buttons ]

When the screen renders for the first time, only F4 help and input text fields are seen. I am able to hide sub area. Requirement is to see first 3 elements.

The hiding of sub area is done in PBO (depending upon certain input).

Once user selects F4 and chooses a value, i want to render (or unhide) the sub area.

But that doesn't happen, because control does not go back to PBO.

I have to explicitly hit a ENTER key (on the keyboard) to get the sub area.

How can I achieve this without hitting ENTER key.

  • Can I forcefully invoke PBO from PAI ?
  • Can I force a refresh or hitting-enter-key like scenario from PAI.
  • Is there any other way of achieving this ?

Appreciate your help.

Thanks,

Advay

1 ACCEPTED SOLUTION

Former Member
0 Kudos
171

Hi Advay,

In your PAI, upon F4 select, use the event AT SELECTION-SCREEN ON VALUE-REQUEST, you can use the below code to unhide.

LOOP AT SCREEN.

"Here, make you subarea visible.

MODIFY SCREEN.

ENDLOOP.

Hope this helps you.

Regards,

Sindhu Pulluru.

5 REPLIES 5

venkateswaran_k
Active Contributor
0 Kudos
171

Try with the Program Events

AT-SELECTION

AT SELECTION-SCREEN ON VALUE-REQUEST

REgards,

Venkat

Former Member
0 Kudos
172

Hi Advay,

In your PAI, upon F4 select, use the event AT SELECTION-SCREEN ON VALUE-REQUEST, you can use the below code to unhide.

LOOP AT SCREEN.

"Here, make you subarea visible.

MODIFY SCREEN.

ENDLOOP.

Hope this helps you.

Regards,

Sindhu Pulluru.

0 Kudos
171

Hi Sindhu,

I tried the above approach but it did not work for me.

I am not using the report program for UI display, its a screen program with PBO and PAI modules.

In the PAI I am using, PROCESS ON VALUE-REQUEST event (which internally will trigger the event that you mentioned above.)

From inside POV module, I try to unhide the screen elements, by LOOP AT SCREEN and MODIFY SCREEN code, but the elements are still hidden even the code executes.

I have to explicitly hit ENTER key to unhide the screen elements.

Note that, I want to unhide the elements only F4 selection itself and not with ENTER key.

Thanks,

Advay

0 Kudos
171

Hi,

Try to simulate an ENTER within the PROCESS ON VALUE-REQUEST event with the following code:

CALL FUNCTION 'SAPGUI_SET_FUNCTIONCODE'

EXPORTING

functioncode = '=00'

EXCEPTIONS

function_not_supported = 1

OTHERS = 2.

IF sy-subrc <> 0.

MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno

WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

ENDIF

.

You should put the LOOP AT SCREEN in the PBO. 

Regards,

0 Kudos
171

Hey Recardo,

Many thanks. It worked.

Cheers,

Advay