Demo on FPM LIST GUIBB with Edit/Save/Delete/Sort/Filter Functionality

By B.Manoj Kumar

In this tutorial we will learn on how to use List GUIBB with Edit, Update, Delete, Sort, Filter functionality.

The application, used in this tutorial is a demo without any real business logic, due to the fact that we want to concentrate on necessary setting and logic for achieving the required functionality.

The process consists of two parts:

  • Creating the Feeder Class

  • Configuration.

1 . Go to SE24 and create a class say ‘YCL_LIST_GUIBB’.

             

2 . In the class go to “Interfaces” tab and enter “IF_FPM_GUIBB_LIST”.

3 . Now, press Enter.

4 .  Very Important:  Go to Methods tab and go inside each and every method and activate them individually because they will be in Inactive state.

 

5 . In menu goto->sections->public.

              

6 . In the public section enter the following code :

     types t_itab type STANDARD TABLE OF zstudent.
  
data FLAG type BOOLEAN .
  
data C_FLAG type BOOLEAN .
  
data ITAB type T_ITAB .

Here the table I have used is “zstudent” which contains id,name,marks,dept fields.

           

7 . Now, go to method “GET_DEFINITION” enter the following code.

  data itab type STANDARD TABLE OF zstudent.
  
data wa_field type fpmgb_s_listfield_descr.

  data wa_action type fpmgb_s_actiondef.
  
data it_action type fpmgb_t_actiondef.


  eo_field_catalog ?= cl_abap_tabledescr
=>describe_by_dataitab ).

  wa_field
-name 'ID'.
  wa_field
-allow_sort 'X'.
  wa_field
-allow_filter 'X'.
  
insert wa_field into table et_field_description.

  wa_field
-name 'NAME'.
  wa_field
-allow_sort ' '.
  wa_field
-allow_filter 'X'.
  
insert wa_field into table et_field_description.


  wa_field
-name 'DEPT'.
  wa_field
-allow_sort ' '.
  wa_field
-allow_filter 'X'.
  
insert wa_field into table et_field_description.

  wa_field
-name 'MARKS'.
  wa_field
-allow_sort ' '.
  wa_field
-allow_filter 'X'.
  
insert wa_field into table et_field_description.


  wa_action
-id 'DEL'.
  wa_action
-enabled 'X'.
  wa_action
-visible 02.
  wa_action
-text 'Delete'.
  wa_action
-tooltip 'delete current selected record'.
  wa_action
-action_type 0.

  
append wa_action to it_action.


  wa_action
-id 'SAVE'.
  wa_action
-enabled 'X'.
  wa_action
-visible 02.
  wa_action
-text 'Save'.
  wa_action
-tooltip 'Save records'.
  wa_action
-action_type 0.

  
append wa_action to it_action.
  et_action_definition 
it_action.

9 . Goto method “FLUSH” and enter the following code.

data f_usage type fpmgb_s_fieldusage.

if flag 'X'.
  
return.
endif.
flag 
'X'.

  
select from zstudent into table itab.

    ct_data 
itab.
    ev_data_changed 
'X'.


   
if ct_field_usage is initial.
     f_usage
-name 'ID'.
     f_usage
-read_only 'X'.
     f_usage
-mandatory 'X'.
     f_usage
-enabled 'X'.
    
append f_usage to ct_field_usage.
     f_usage
-name 'NAME'.
     f_usage
-read_only ' '.
     f_usage
-mandatory 'X'.
     f_usage
-enabled 'X'.
     
append f_usage to ct_field_usage.
     f_usage
-name 'DEPT'.
     f_usage
-read_only ' '.
     f_usage
-mandatory 'X'.
     f_usage
-enabled 'X'.
     
append f_usage to ct_field_usage.
     f_usage
-name 'MARKS'.
     f_usage
-read_only ' '.
     f_usage
-mandatory 'X'.
     f_usage
-enabled 'X'.
     
append f_usage to ct_field_usage.

     ev_field_usage_changed 
'X'.
 
endif.

9 . Goto method “FLUSH” and enter the following code.

data wa_change_log type fpmgb_s_changelog.
 
data count type i.
 
FIELD-SYMBOLS <ROW> TYPE ANY.


 
describe table it_change_log lines count.

  
if it_change_log is not initial.

    
loop at it_change_log into wa_change_log.

        
if sy-tabix <= count.

              
ASSIGN WA_CHANGE_LOG-TABLE_ROW->TO <ROW>.
              
UPDATE ZSTUDENT FROM <ROW>.

        
endif.
   
   FLAG 
' '.
   C_FLAG 
'X'.
          
    
endloop.

    
endif.

Click here to continue...

 

Please send us your feedback/suggestions at webmaster@SAPTechnical.COM 

HomeContribute About Us Privacy Terms Of Use • Disclaimer • SafeCompanies: Advertise on SAPTechnical.COM | Post JobContact Us  

Graphic Design by Round the Bend Wizards

footer image footer image