title: Dynamically fill selection-screen parameter on change
body: <p>Suppose I have a selection-screen block with two parameters. I want to dynamically fill the second parameter based on what the user inputs in the first, for instance by querying a table to find the expected value for the key field in parameter 1.</p>
  
  <p>As an example, say I have a program that does something for a combination of order number (<code>p_aufnr</code>) and WBS element (<code>p_wbs</code>). Instead of asking the user to provide both, I can determine one of them from the PSPEL field on the AUFK table. However, I still want to show this field to the user after he inputs his order number so he can verify that the WBS element is correct.</p>
  
  <p>I've managed to do this by using the <code>AT SELECTION SCREEN ON p_aufnr</code> event to assign a value to <code>p_wbs</code>. This event is processed when the user presses enter. However, I can only ever get it to work once. So if the user enters an order number, realises from the retrieved WBS element that he made a mistake and changes it, the second parameter never changes. Even though the <code>AT SELECTION SCREEN</code> event is processed in the debugger, the parameter is not updated.</p>
  
  <p>Am I not supposed to use this event for my scenario? If so, how would I then implement this sort of dynamic selection screen?</p>
  
  <p>Forgot to add a code sample. The following report illustrates my issue: after entering a value in <code>p_netw</code> and pressing enter, p_wbs is filled with the value 1. However, if you press enter again the <code>AT SELECTION-SCREEN ON</code> routine is processed but the value for p_wbs is not updated, while <code>lv_count</code> is.</p>
  
  <pre><code>DATA: lv_count    TYPE i.
  
  SELECTION-SCREEN BEGIN OF BLOCK main.
  PARAMETERS: p_netw    TYPE aufnr OBLIGATORY MODIF ID auf.
  PARAMETERS: p_wbs     TYPE i MODIF ID psp.
  SELECTION-SCREEN END OF BLOCK   main.
  
  AT SELECTION-SCREEN ON p_netw.
    ADD 1 TO lv_count.
    p_wbs = lv_count.
  
  START-OF-SELECTION.
    PERFORM main.
  
  
  FORM main.
    WRITE: 'The value reached ', lv_count.
  ENDFORM.
  </code></pre>