cancel
Showing results for 
Search instead for 
Did you mean: 

How to make a table column block editable for a row and remain non editable for other row based on some condition

Former Member
0 Kudos

hi ,

i need help on the below scenario ,

we have a web dynpro table with different columns, now based on new business requirement  one of the column need to     

dynamically editable or non editable for different row.

for ex :

Field 1
Field 2 ( Dynamic field )
Field 3
Field 4
Data 11 Data 12 ( Editable with Drop down   )data 13data 14
Data 21 Data 22 ( Non editable )Data 23data 24
Data 31 data  32 ( Editable with drop down )data 33data 34

how to achieve this ? please help on this.

Thanks in advance

Thanks

Manish

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

Refer the following link for  step by step process to  making one editable column in alv table.and its also explain regarding your requirement

http://www.saptechnical.com/Tutorials/WebDynproABAP/Column/page1.htm

Hope its useful to u,

Regards

Navith

Former Member
0 Kudos

Thanks Navith,

But my Scenario is little different, the column need to be editable base on Data,

Suppose if i need to show a list of material then all the material which are  batch maintained, For such material batch field in table need to be editable( with a drop down) & for rest of the material where batch is not maintained the batch field need to be non editable.

Thanks     

Manish    

Former Member
0 Kudos

Since in your case you need drop down you can also use the concept of Variants.

Use Variants in your column and select the variant based on your conditions.

See this example for reference. This will definitely solve your issue.

http://wiki.sdn.sap.com/wiki/display/WDABAP/WebDynpro+for+ABAP+Cell+Variants

Former Member
0 Kudos

Thanks a lot 🙂 it woking

Answers (3)

Answers (3)

Former Member
0 Kudos

Thanks All for your help.  🙂

Regard's

Manish

chengalarayulu
Active Contributor
0 Kudos

Manish,

there is no proper way to insert two Cell Editors in a column(except variants), have a look on below scenario, it may help.

add one more attribute to your table context node for read-only.

create dropDown as celleditor for table and bind with newly created attribute to read-only property of dropdown.

before binding data to table, check the condition then mention readonly value abap_true / false.

@ we can achieve by the use of Variants.

for ex :

Data 11Data 12 ( Editable with Drop down)data 13read-only - abap_false
Data 21 Data 22 ( Non editable, dropdown )Data 23read-only - abap_true
Data 31data  32 ( Editable with drop down )data 33read-only - abap_false
Former Member
0 Kudos

Hi ,

If you are using alv table try to use the following  code ...

   data: l_ref_cmp_usage type ref to if_wd_component_usage.

   l_ref_cmp_usage = wd_this->wd_cpuse_TSM_ENTRY( ).  " TSM_ENTRY is alv component

   if l_ref_cmp_usage->has_active_component( ) is initial.

     l_ref_cmp_usage->create_component( ).

   endif.

   data l_salv_wd_table type ref to iwci_salv_wd_table.

   l_salv_wd_table = wd_this->wd_cpifc_TSM_ENTRY( ).

   data l_table type ref to cl_salv_wd_config_table.

   l_table = l_salv_wd_table->get_model( ).

   l_table->if_salv_wd_table_settings~set_read_only( abap_false ).

you have to use this code in WDDOMODIFYVIEW or appropriate custom method based on ur codition...

Regards,

Venkat.