Online Tutorials & Training Materials | STechies.com
Register Login

Clearing the displayed value for a SELECT-OPTION

|| || 3

Clearing the displayed value for a SELECT-OPTION
Stechies

How do I clear the displayed value of an SELECT-OPTION?

I have 2 SELECT-OPTIONs on my screen (standard basic report program screen). I use code like this to populate the drop-down boxes for each one.

AT SELECTION-SCREEN ON VALUE-REQUEST FOR s_prgrp-low.
PERFORM fill_prgrp_values.

AT SELECTION-SCREEN ON VALUE-REQUEST FOR s_prctr-low.
PERFORM fill_prctr_values.

I am using F4IF_INT_TABLE_VALUE_REQUEST to build the drop-down lists, and it works fine, but I do not see any function module to clear the displayed value off the screen.
  The value the user picks for the first SELECT-OPTION will affect what values I put in the drop-down list for the second SELECT-OPTION.
If a user enters a value for the second SELECT-OPTION, and then goes back and changes the value of the first SELECT-OPTION, then I want to do two things:

1. Create a new set of values for the drop-down list for the second SELECT-OPTION (no problem; working fine);
2. Clear the displayed value from the second SELECT-OPTION that the user entered previously. That value became invalid when the user picked a new     value for the first SELECT-OPTION.

How do I clear that second displayed value?

I have tried CLEAR and REFRESH for the second variable using the formats s_prctr, s_prctr[], and s_prctr-low. They will erase the values of the internal table or part(s) of it, but the displayed value stays on the screen.

I need to clear out the displayed value so the user will either leave it blank or enter or select a new value.

Thanks for your help.


Comments

  • Shalesh Singh Visen
    14 Feb 2012 7:41 am
    AT SELECTION-SCREEN OUTPUT. with the command REFRESH s_prctr.
  • 14 Feb 2012 3:29 pm
    I have tried using CLEAR and REFRESH, both in AT SELECTION-SCREEN OUTPUT and in the AT SELECTION-SCREEN ON VALUE-REQUEST FOR s_prgrp-low.
    If I enter multiple values, ranges, etc., all will be cleared except for the one value displayed on the main screen. It is not removed and remains in the list if you push the button to go to the pop-up to enter multiple values, ranges, etc.
    I have also tried DYNP_VALUES_UPDATE, but it does not work either.
    The key is to do an immediate "write" to the main screen somehow, to write a blank or somehow wipe the value of that SCREEN-OPTION entry.
  • 16 Feb 2012 3:35 pm
    Debugging showed that when you select from a drop-down box, AT SELECTION-SCREEN OUTPUT is _not_ executed.

    This code worked.
    ====================
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR s_prgrp-low.

    DATA: dynfield_tbl TYPE STANDARD TABLE OF dynpread,
    dynfield_rcd TYPE dynpread.

    CLEAR dynfield_rcd.
    * Populate the value to be updated
    dynfield_rcd-fieldname = 'S_PRCTR-LOW'.
    CLEAR dynfield_rcd-fieldvalue. " Clear the screen value
    APPEND dynfield_rcd TO dynfield_tbl.

    * Update the screen field
    CALL FUNCTION 'DYNP_VALUES_UPDATE'
    EXPORTING
    dyname = sy-repid " ZFI_GL_BALANCE_NGL
    dynumb = sy-dynnr " 1000
    TABLES
    dynpfields = dynfield_tbl
    EXCEPTIONS
    invalid_abapworkarea = 1
    invalid_dynprofield = 2
    invalid_dynproname = 3
    invalid_dynpronummer = 4
    invalid_request = 5
    no_fielddescription = 6
    undefind_error = 7
    OTHERS = 8.
    IF sy-subrc <> 0.
    RAISE exc_error.
    ENDIF.

    REFRESH s_prctr.
    CLEAR s_prctr.

Related Articles

0.0159 seconds.