cancel
Showing results for 
Search instead for 
Did you mean: 

Conditionally enable/disable a field in ALV display on Webdynpro

Former Member
0 Kudos

Hi users,

I have a requirement where in a webdynpro ALV display, in which I have to enable/disable the particular cell and not the column or row completely based on business conditions. Please suggest me if there are any method to set the AVL cell settings.

Regards,

Zabeen

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Zabeen,

Everything is available on SDN .

For now , plz refer this link. this will do ur requirement.

http://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/3133474a-0801-0010-d692-81827814a...

cheers,

Ashish.

Former Member
0 Kudos

Hi Ashish,

I have a set of rows and columns. As per the document in the link if I follow then I can enable/disable a particular column/row. According to my requirements based on some conditions I have to enable/disable a particular cell dynamically. For an instance please follow the bellow example,

Description          Obj_type              CSN_Value         CSN_Date 
-----------------------------------------------------------------------------------
Test data1              F                  <no value>        <no value>       
Test Data2              E                   10               01.02.2012

In the above example I have to disable the cell where there are no values and wherever value present have to enable it.

Please let me know if this could be achieved in webdynpro alv.

Former Member
0 Kudos

Hi Zabeen,

Kindly look at the below link

http://wiki.sdn.sap.com/wiki/display/WDABAP/HowtoeditconditionallyrowofaALVtableinWebDynprofor+ABAP

Code Snippet:

To declare a column as editable -a corresponding field has to be determined in the context which will hold the flag( 'X' or ' ')

So that the required column can be set as editable.

Now loop the columns table and change the cell editor of a column

LOOP AT lt_columns INTO ls_columns.

lr_column = ls_columns-r_column.

lv_tabix = sy-tabix.

READ TABLE lt_name INTO ls_name INDEX lv_tabix.

CREATE OBJECT lr_input

EXPORTING

value_fieldname = ls_name-name.

CALL METHOD lr_column->set_cell_editor

EXPORTING

value = lr_input.

*To make the required row is editable

lr_input->set_read_only_fieldname( value = 'READ_ONLY' ). ->>>>>>>READ_ONLY is the field for flag

ENDLOOP.

Regards,

Karthiheyan M