Skip to Content
author's profile photo Former Member
Former Member

ALV Row Editable for specific column

Hi,

I am creating a transaction using ALV - Webdynpro. I would like to enable or disable the row ,(specific column in that row ).

Problem is very similar to the thread posted in the below link.

enable-or-disable-row-in-alv

Please let me know how to achive the scenario.

Thanks,

Kumar

Add a comment
10|10000 characters needed characters exceeded

Related questions

4 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on May 23, 2008 at 03:20 AM

    Hi,

    for that particular coulm in table bind the property to an attribute say

    x of type wdy_boolean.

    then based on the condition use

    data: lo_element TYPE REF TO if_wd_context_element.

    lo_element = wd_context->get_element( ).

    lo_element->set_attribute(

    EXPORTING name = `x'

    value = 'abap_true' ).

    or

    lo_element = wd_context->get_element( ).

    lo_element->set_attribute(

    EXPORTING name = `x'

    value = 'abap_false' ).

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on May 23, 2008 at 03:37 AM

    Hi,

    In your context have an additional attribte read_only. When you want to allow the column to be edited, set this attribute to space and bind the alv back.

    the do the following ;

    loop at lt_columns into ls_column.

    case ls_column-id.

    when 'COLUMN'.

    create object lr_input_field

    exporting

    value_fieldname = ls_column-id.

    lr_input_field->set_read_only_fieldname( 'READ_ONLY' ).

    ls_column-r_column->set_cell_editor( lr_input_field ).

    endcase.

    endloop.

    Shruthi

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on May 23, 2008 at 04:29 AM

    Hi

    By default all the columns in the alv table will be in display mode. if u want to make it editable u have to create an input field as cell editor for that particular column.

    DATA lr_input_field TYPE REF TO cl_salv_wd_uie_input_field.

    DATA lr_column TYPE REF TO cl_salv_wd_column.

    lo_config_model_value->if_salv_wd_table_settings~set_read_only( abap_false).

    lr_column = lo_config_model_value->if_salv_wd_column_settings~get_column( 'HEADER' ).

    CREATE OBJECT lr_input_field

    EXPORTING

    value_fieldname = 'HEADER'.

    lr_column->set_cell_editor( lr_input_field ).

    regards

    chythanya

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jun 02, 2008 at 08:59 PM

    Hi,

    I would like only the specific cell in the ALV as enabled or disabled based on condition.

    Please note : This is for ALV and not for normal table.

    Thanks,

    Kumar

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.