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: 

Make parameter visible again dynamically?

Former Member
0 Kudos

Users are asked to choose value from a custom pop-up list in AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_xxxx event.

And based on the value returned, some parameters will be set invisible or visible instantly by loop screen It work well for making parameters invisible instantly. However, I can not make those invisible parameters become visible again at once until ENTER is pressed.

Did I miss anything important? Thanks.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi George,

Please try using the Event AT Selection-Screen Output and manipulate accordingly......

And in SAP until a User-Command is entered nothing Works ,so i think according to Your Logic Enter is must so try the above.......

Regards

Arbind

5 REPLIES 5

Former Member
0 Kudos

Hi George,

Please try using the Event AT Selection-Screen Output and manipulate accordingly......

And in SAP until a User-Command is entered nothing Works ,so i think according to Your Logic Enter is must so try the above.......

Regards

Arbind

0 Kudos

Thanks for your reply Arbind.

In fact I tried AT Selection-Screen Output before but neither visible nor invisible change were instant.

0 Kudos

Hi,

I know that w/o user interaction nothing can be done.

So Enter is required ....

just try to set a flag and according to flag u call At Selection-Screen Output Event.

Try it.

Regards

Arbind

0 Kudos

Here's a way you could make it work... the "hit_enter" form is the trick.

Jonathan


report zsdn_jc_f4_with_refresh.

data:
  g_hide_onoff          type sap_bool.

parameters:
  p_date1               type sy-datum,
  p_date2               type sy-datum,
  p_onoff               type sy-ucomm modif id hid.

at selection-screen output.
  p_onoff = 'This field disappears and reappears'.
  loop at screen.
    if screen-group1 = 'HID'.
      screen-input = '0'.
      if g_hide_onoff = 'X'.
        screen-invisible = '1'.
      endif.
      modify screen.
    endif.
  endloop.

at selection-screen on value-request for p_date1.
* Select a date to un-hide "p_onoff"
  call function 'F4_DATE'
    exporting
      date_for_first_month = sy-datum
    importing
      select_date          = p_date1
    exceptions
      others               = 0.
  g_hide_onoff = ' '.
  perform hit_enter.

at selection-screen on value-request for p_date2.
* Select a date to hide "p_onoff"
  call function 'F4_DATE'
    exporting
      date_for_first_month = sy-datum
    importing
      select_date          = p_date2
    exceptions
      others               = 0.
  g_hide_onoff = 'X'.
  perform hit_enter.

*&---------------------------------------------------------------------*
*&      Form  hit_enter
*&---------------------------------------------------------------------*
form hit_enter.
* Mimic user hitting Enter
  call function 'SAPGUI_SET_FUNCTIONCODE'
    exporting
      functioncode = '=00'
    exceptions
      others       = 0.
endform.                    "hit_enter

0 Kudos

Johnathan thx for your answer, SAPGUI_SET_FUNCTIONCODE just solved my problem.

I noted the hit_enter also trigger AT SELECTION-SCREEN event which includes some customized selection validating functions. To skip these functions after changing visibility of parameters, I hv to use a flag for that.