cancel
Showing results for 
Search instead for 
Did you mean: 

Table init

Former Member
0 Kudos

Hi!

I have the following context:

- ND_TABLE (node)

- - ND_TABLE_PROPERTIES (subnode)

- - - READ_ONLY (attribute in the subnode)

- - AT_COL1 (attribute in the node, it comes from a DDIC structure)

- - AT_COL2 (attribute in the node, it comes from a DDIC structure)

- - AT_COL3 (attribute in the node, it comes from a DDIC structure)

We can say, there are 5 lines in the internal table (ITAB), that will be beound to the context node ND_TABLE.

ITAB has 3 columns, COL1, COL2 and COL3.

I would like to set the read_only property for each line, in the view's WDDOINIT method.

What can I do for it, how can I set the READ_ONLY property for each line, based on some condition (if itab-col1> itab-col2 then read_only = 'X', else empty).

Thank you

Tamá

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

I have the following context.

- ND_TABLE (node - cardinality 1:n)

- - AT_COL1 (attribute in the node, it comes from a DDIC structure)

- - AT_COL2 (attribute in the node, it comes from a DDIC structure)

- - AT_COL3 (attribute in the node, it comes from a DDIC structure)

- - ND_TABLE_PROPERTIES (subnode, cardinality 1:1)

- - - READ_ONLY (attribute in the subnode)

The "-" signs are the levels. I've created my "ND_TABLE" node from a DDIC table, called ZZMYTABLE. It contains 3 fields, AT_COL1, AT_COL2, AT_COL3.

So the "ND_TABLE_PROPERTIES" subnode and the "READ_ONLY" attributes are not the part of my internal table ITAB, what I made from ZZMYTABLE DDIC table.

So I would like to create an internal table, which contains the whole structure above including the subnode and the READ_ONLY attribute also. Is it possible and if yes, how?

Thank you

Tamá

Former Member
0 Kudos

Hi,

Yes, yuo can use the method CREATE_TABLE_FROM_NODE of CL_WD_DYNAMIC_TOOL to create an Internal table.

But why you want to create it under a subnode. Just add this readonyl attribute to the existing attribtues.

Regards,

Lekha.

Answers (2)

Answers (2)

Former Member
0 Kudos

I wanted to collect the table property (read-only, enabled, etc...) relevant attributes into a separated subnode. But it seems, it cannot be made very easily...

Thanx anyways.

Former Member
0 Kudos

Hi,

Is this a Table UI or ALV.

Create a context attribute READ_ONLY inthat ND_table node.

Now get the table vlaues.

loop at lt_flight into ls_flight.

lv_index = sy-tabix.
if ls_table-col1>ls_table-col2.

ls_table-read_only = 'X'.    "Non editable
else.
ls_table-read_only = ' '.    "editable 
endif.

modify tabe lt_table index lv_index.

endloop.

If you want to make entire row editable or particualr cell editable.

If this is table UI element, for each column have an input field and Bind this readonly attribute

to the READ_ONLY property of that input field.

Regards,

Lekha.

Former Member
0 Kudos

This is an UI table.

"Create a context attribute READ_ONLY inthat ND_table node." - Is it really necessary? Can't I create a subnode in the context of the table, and then put an attribute within this subnode?

How can I have the structure of the context to create an internal table, which contains all of the necessary fields, including the READ_ONLY field?

Thank you

Tamá

Former Member
0 Kudos

Hi,

lt_flight is a table to which the TABLE UI element is bound.

COL1, COL2, COL3 and READONLY attributes of that node to which table UI element is bound.

READ ONLY is rquired becasue based on some condition you want to make it editable right.

How can I have the structure of the context to create an internal table, which contains all of the necessary fields, including the READ_ONLY field?

I did not get you.

Regards,

Lekha.