Skip to Content
avatar image
Former Member

how to set single cells in a table to read only?

Hi all,

I got a problem.

I have a WD4 with a table called 'TABLE'.

I bound the structure 'SFLIGHT' as given in DDIC to it.

It isn't filled, but waiting for input (all Fields are Input Fields).

Now I have written a OnEnter-Method, that gets all the data when CARRID,CONNID and FLDATE is given and found in DDIC.

Now I want to close PLANETYPE.

But ONLY (!!!) the one line, which started the OnEntermethod....

one example:

If the user puts in come non-existing data and in line 4 he writes:

CARRID CONNID FLDATE

LH 400 05.01.2008

I want the method to get all data:

300 LH 0400 05.01.2008 666,00 EUR A310-300 280

and switch the Field Planetype with A310-300 to read-only (the other 3 before have to be left writeable.

Any ideas?

Thanks in advance

Greets

Markus Voelker

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • avatar image
    Former Member
    Nov 20, 2008 at 11:46 AM

    Hi Markus,

    have a look at this thread

    I think this can solve your problem.

    Regards,

    Andreas

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi Markus,

      i have posted same thing in a previous thread today only.....

      please see the code below

      first create a context attribute in the node you are using for table and bind it with wdy_boolean.

      you can use the code below

      DATA lo_nd_cn_table TYPE REF TO if_wd_context_node.

      DATA lo_el_cn_table TYPE REF TO if_wd_context_element.

      DATA ls_cn_table TYPE wd_this->element_cn_table.

      DATA it_table TYPE wd_this->elements_cn_table.

      DATA wa_table TYPE wd_this->element_cn_table.

      wa_table-ca_one = ' '.

      wa_table-ca_two = ' '.

      wa_table-ca_three = ' '.

      wa_table-ca_enable = ABAP_TRUE.

      APPEND wa_table to it_table.

      wa_table-ca_one = ' '.

      wa_table-ca_two = ' '.

      wa_table-ca_three = ' '.

      wa_table-ca_enable = ABAP_FALSE.

      APPEND wa_table to it_table.

      wa_table-ca_one = ' '.

      wa_table-ca_two = ' '.

      wa_table-ca_three = ' '.

      wa_table-ca_enable = ABAP_TRUE.

      APPEND wa_table to it_table.

      navigate from <CONTEXT> to <CN_TABLE> via lead selection

      lo_nd_cn_table = wd_context->get_child_node( name =

      wd_this->wdctx_cn_table ).

      get element via lead selection

      lo_el_cn_table = lo_nd_cn_table->get_element( ).

      lo_nd_cn_table->bind_table( it_table ).

      i am not sure of your requirement but with this code you will get table with 3 column and 3 rows with centre cell in non editable mode.

      regards

      Pranav

  • avatar image
    Former Member
    Nov 20, 2008 at 12:01 PM

    Hi,

    For making the field read only set its property as read only dynamically.

    For achivinng this first create a context-attribute( ATTR_TYPE ) of type boolean.

    then bind the Read Only property of the input field with this node.

    Now in your coding part set the ATTRIBUTE ( ATTR_TYPE ) with 'X' .

    When this is X this means this field will be non-editable.

    if face any problem, then get back to me.

    Thanks,

    Pankaj Aggarwal.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Nov 20, 2008 at 12:40 PM

    Get the particular Context Element which u want to make READ -ONLY and use

    SET_ATTRIBUTE_PROPERTY ito set the Element properties of the Context Element manually,

    this method can be used to change the property of the element at the runtime like

    REQUIRED

    READ_ONLY

    VISIBLE

    ENABLED

    Add comment
    10|10000 characters needed characters exceeded