List Box in FPM

lightDesigning List Box in FPM Form UIBB

 

 


The post shows how to display drop down list box in fpm form uibb in fpm ovp application.

We have the feeder class.

1


Activate all the methods and go to the GET_DEFINITION method.

2


Provide the below code. The post shows the CARRID field as a list box.

3


Use Tx- FPM_WB and create an FPM application (OVP) and add a form configuration and provide a configuration name and select Configure UIBB.

4


Here add one element – CARRID and choose display type as Drop-Down List Box and Save the configuration. Test the application.

5


So here CARRID field appears as Drop-Down list box. The next step is to get some value and map to the field CARRID.

6


In the feeder class GET_DEFINITION method, fill the table LT_VALUE which refer to the table type  ‘WDR_CONTEXT_ATTR_VALUE_LIST’ .

7


  METHOD if_fpm_guibb_form~get_definition.
    eo_field_catalog ?= cl_abap_structdescr=>describe_by_name‘SCARR’ ).
* Do the step for the drop down list box for – CARRID field
    DATAlt_value TYPE WDR_CONTEXT_ATTR_VALUE_LIST.
    SELECT FROM scarr INTO TABLE @DATA(lt_scarr).
    LOOP AT lt_scarr ASSIGNING FIELDSYMBOL(<fs_scarr>).
      APPEND INITIAL LINE TO lt_value
             ASSIGNING FIELDSYMBOL(<fs_value>).
      <fs_value>value <fs_scarr>carrid.
      <fs_value>text <fs_scarr>carrname.
    ENDLOOP.
    APPEND INITIAL LINE TO et_field_description
           ASSIGNING FIELDSYMBOL(<fs_field>).
    <fs_field>name ‘CARRID’.
    <fs_field>fixed_values lt_value.
  ENDMETHOD.


Now test the application. Here we have the drop down values.

8


 

9


If needed to display the KEY of the drop down list along with the text then in the field attribute the DISPLAY the Key checkbox can be selected.

10


Save the changes and test the application.

11


So here we have the dropdown field- displaying text and key as well.

12


 

13


 

Leave a Reply