title: Listbox error "Entry is too long for the field"
body: <p>After selecting a value in a dropdown listbox field, there is this error message:</p>
  
  <blockquote>
    <p>Entry is too long for the field</p>
  </blockquote>
  
  <p>(it's the message number <code>00092</code>)</p>
  
  <p><a href="https://i.stack.imgur.com/Q2REh.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Q2REh.png" alt="enter image description here"></a> </p>
  
  <p>I created one text field <code>TXTOPENV</code> as Listbox with key value, set value using <code>VRM_SET_VALUES</code> in PBO section.</p>
  
  <p>Here is the screenshot of screen painter:</p>
  
  <p><a href="https://i.stack.imgur.com/BrXoo.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/BrXoo.png" alt="screen painter listbox attributes"></a></p>
  
  <p>Screen flow logic:</p>
  
  <pre><code>PROCESS BEFORE OUTPUT.
    MODULE status_0210.
  </code></pre>
  
  <p>ABAP code:</p>
  
  <pre><code>DATA txtopenv TYPE c LENGTH 1.
  
  MODULE status_0210 OUTPUT.
    SET PF-STATUS 'ST210'.
    SET TITLEBAR 'T210'.
    PERFORM GetVacancy.
  ENDMODULE.
  
  FORM GetVacancy.
    TYPES: BEGIN OF ty_vacancy,
             plans TYPE t528t-plans,
             plstx TYPE t528t-plstx,
           END OF ty_vacancy.
    DATA: wa_vacancy TYPE ty_vacancy.
    LOOP AT it_vacancyid INTO wa_vacancyid.
      SELECT plans plstx
        FROM t528t
        INTO wa_vacancy
        WHERE plans = wa_vacancyid-ty_objid.
      ENDSELECT.
      field_id = wa_vacancy-ty_plans.
      value = wa_vacancy-ty_plstx.
      APPEND value TO values.
      CLEAR wa_vacancy.
    ENDLOOP.
  
    CALL FUNCTION 'VRM_SET_VALUES'
      EXPORTING
        id              = 'TXTOPENV'
        values          = values
      EXCEPTIONS
        id_illegal_name = 1
        OTHERS          = 2.
  ENDFORM.
  </code></pre>