One-Click Actions in List UIBB

single clickOne-Click action provides a better way of editing/deleting/changing the status  of particular record(s) in list or tree uibb.

 

 

 

The below post shows how to implement One-Click Action with Edit/delete particular row(s) in a list uibb of an OVP applciation.

For list uibb we have the table type.

1

Add all fields of SPFLI table and to edit  particular cell in a row, extra field REF_READ_ONLY field is added.

2

Create a list feeder class.

34

5

In the GET_DEFINITION method build the field catalog. Build the one click actions like here we have ROW_EDIT & ROW_DELETE.

6

Select data in GET_DATA METHOD.Activate all other methods.

7

Create an OVP application using tx- FPM_WB.

8

Add a list uibb and create the configuration by providing the above list feeder class.

9

Don’t select the Display mode as TRUE in general settings as we have to edit certain row cells depending upon user action

10

Add fields as per needed to display on the list. Here we have a field named as ‘FPM_ROW_ACTIONS_COLUMN’ this field is passed from the feeder class but not from the field catalog but as we have defined the row action. This always will be type as LINK  TO ACTION. Make two field cityfrom & cityto as INPUT field.

12

For the field “FPM_ROW_ACTIONS_COLUMN’ provide the actions and the image. Save the configuration and test the application.

13

Here the OUTPUT List. As we set CITYFORM & CITYTO field as input field, it appears as input enabled.

14

Go to the feeder class, get_data method and put the highlighted code to make the input field as rad only. test the application again.

15

This time the input fields appear as rad only. Perfect. Now the idea is when we click the EDIT button in any row, that row specific CITYFORM & CITYTO fields should be enabled as input field.

16

Put the below highlighted code in the GET_DATA method of the list feeder class.

17

Test the application and edit a row. 

18.jpg

You can put action on multiple rows.

 

Now we want to delete the record form the UI, when row specific DELETE button is pressed bu user. Put high lighted code in the get_Data method.

20

Test the application and try to delete a record.

21

The roe delete from UI.

22

CODE


  METHOD if_fpm_guibb_list~get_data.
    DATA lv_index TYPE i.
    CASE iv_eventid->mv_event_id .
      WHEN ‘FPM_START’.
        SELECT FROM spfli INTO CORRESPONDING FIELDS OF TABLE gt_spfli.
        LOOP AT gt_spfli  ASSIGNING FIELDSYMBOL(<fs_spfli>).
          <fs_spfli>ref_read_only ‘X’.
        ENDLOOP.
        ct_data gt_spfli.
        ev_data_changed abap_true.
      WHEN ‘ROW_DELETE’.
        CALL METHOD iv_eventid->mo_event_data->get_value
          EXPORTING
            iv_key   ‘FPM_GUIBB_LIST_INDEX’
          IMPORTING
            ev_value lv_index.
        DELETE gt_spfli INDEX lv_index.
        ct_data gt_spfli.
        ev_data_changed abap_true.
      WHEN ‘ROW_EDIT’.
        CALL METHOD iv_eventid->mo_event_data->get_value
          EXPORTING
            iv_key   ‘FPM_GUIBB_LIST_INDEX’
          IMPORTING
            ev_value lv_index.
        READ TABLE gt_spfli ASSIGNING <fs_spfli> INDEX lv_index.
        IF sysubrc IS INITIAL.
          <fs_spfli>ref_read_only ‘ ‘.
        ENDIF.
        ct_data gt_spfli.
        ev_data_changed abap_true.

      WHEN OTHERS.
    ENDCASE.

  ENDMETHOD.


One comment

Leave a Reply