cancel
Showing results for 
Search instead for 
Did you mean: 

Edit single row in list UIBB

former_member439290
Discoverer
0 Kudos

Hi Team,

I was working on a list UIBB. I have a requirement here. On selection of single row the row should become editable. My list will be read only initially. But once the user selects one row from the list it should be editable ? Any idea how to achieve this ? I searched field catalogue but we cannot control the field catalogue for each row. it is applicable to the whole column. Please help.

Thanks,

Vinod

Accepted Solutions (1)

Accepted Solutions (1)

0 Kudos

To modify the lines that are selected, the values of the changing parameter

CT_SELECTED_LINES of  IF_FPM_GUIBB_LIST~GET_DATA(  )  has to be adapted. In addition, the exporting parameter EV_SELECTED_LINES_CHANGED has to be set to ABAP_TRUE.

To modify the line related to the lead selection index, the values of the changing

parameter CV_LEAD_INDEX of IF_FPM_GUIBB_LIST~GET_DATA(  )   has to be adapted.

former_member439290
Discoverer
0 Kudos

Hi,

Thanks for the response. But my question is that the row in the list should become editable once the user selects the row. User will only enter the values in the row. Do you have any idea how to achieve this functionality ?

jitin_kharbanda
Participant
0 Kudos

Hi Vinod,

To achieve this functionality, you need to define read_only_ref field for each column in the field catalog at get_definition method.

e.g. you structure for list as:-

matnr

matnr_ro_ref (char1)

maktx

maktx_ro_ref (char1)

...

Then when building field catalog for MATNR, set ls_field-read_only_ref = 'MATNR_RO_REF'.

This means, whatever be the value in MATNR_RO_REF, will set the read only property for MATNR.

To set the list read_only by default, set MATNR_RO_REF as blank.

In CT_DATA if MATNR_RO_REF is 'X', then MATNR will be read only for that row, else it will be editable.

You need to maintain MATNR_RO_REF in CT_DATA for this for each row and column.

When a row is selected, LEAD_SELECTION event is triggered.

1) in get_data method of list, for this event, get the index of rows selected.

2) for each row selected, you need to set the MATNR_RO_REF as blank.

3) set ev_data_changed as 'X'.

Regards

Jitin Kharbanda

0 Kudos

hi jitin ,

I HAVE GET_COMPONENTS METHOD IN CL_ABAP_STRUCTDESCR WHICH WILL GIVE PROPERTIES OF FIELDS IN INTERNAL TABLE BUT I DON'T HAVE ANY THING LIKE THAT IN CL_ABAP_TABLEDESCR. WHEN I USE

   eo_field_catalog ?=  cl_abap_tabledescr=>DESCRIBE_BY_DATA( lt_mara ) .


NOW HOW TO GET THE FIELD PROPERTIES OF EACH FIELD THERE IS NO METHOD LIKE

GET_COMPONENTS IN  CL_ABAP_TABLEDESCR.  THEN I TRIED BELOW BUT IT IS THROWING SOME ERROR.

class ZCL_FPM_LIST_GUIBB_EXE1 definition

   public

   final

   create public .

public section.

   interfaces IF_FPM_GUIBB .

   interfaces IF_FPM_GUIBB_LIST .

   types :begin of ty_mara,

          matrn type matnr,

          matrn_ro_ref type char1,

          maktx type maktx,

          maktx_ro_ref type char1,

         end of ty_mara.

   data:lt_mara type TABLE OF ty_mara.


CODE IN GET_DEFINITION:


data:

         lo_structdescr type REF TO cl_abap_structdescr,

        ls_field_description type fpmgb_s_listfield_descr,

        ls_action_definition type fpmgb_s_actiondef,

        lt_comp type abap_component_tab,

        ls_comp type abap_componentdescr.

  lo_structdescr ?= cl_abap_typedescr=>DESCRIBE_BY_DATA( lt_mara ).

CALL METHOD CL_ABAP_TABLEDESCR=>CREATE

   EXPORTING

     P_LINE_TYPE  = lo_structdescr.

lo_structdescr ?= cl_abap_typedescr=>DESCRIBE_BY_DATA( lt_mara ). WHILE EXICUTING THIS LINE I AM GETTING ERROR

ERROR: Dynamic type conflict when assigning references (termination: RABAX_STATE)

BUT IF I USE DESCRIBE_BY_NAME INSTEAD OF DESCRIBE_BY_DATA EVERYTHING WORKS FINE BUT I CANNOT USE DESCRIBE_BY_NAME FOR LOCALLY DECLARED TYPES.

                

  

jitin_kharbanda
Participant
0 Kudos

Hello Vamshikrishna,

Get_definition is used to define the field catalog.

If you need to view/change the field properties of a structure defined using cl_abap_structdescr or cl_abap_tabledescr, then you can do so in get_data method also.

In get_data, the very first event that is triggered is FPM_START.

On this event you will get CT_FIELD_USAGE table.

Read the field for which you want to edit the properties.

You can view/change the data of this table. Also, mark ev_field_usage_changed as 'X'.

Hope this helps you.

Regards

Jitin Kharbanda

0 Kudos

Sir will you please see this blog and tell me any other modifications if nesissary and also one more question i am doing R&D from 2 years while i am working but i don't know this functionality not in standard documents,no ware i found how can you know about this sir is there any source for FPM (Strong) will you please help me.

jitin_kharbanda
Participant
0 Kudos

Hello Vamshikrishna,


I appreciate that you have blogged this. It seems to be fine.


Regarding FPM source, I have refereed to FPM developers guide. Go through this, try to understand each method and their parameters of feeder class for UIBBs.


Once you are aware of the methods and their parameters, significance, how they are used, what they do then it will be easy for you to develop logic for FPM developments.


Regards

Jitin Kharbanda

Answers (0)