cancel
Showing results for 
Search instead for 
Did you mean: 

Table control

Former Member
0 Kudos

Hi,

I have created one table. How can i get the datas from kna1 table into table control. can you pls explain this with example?

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Also you need initialize the data source in the method WDDOINIT of the view, please find sample codes as following:

method WDDOINIT .

  • data declaration

data:

Node_KNA1 type REF TO IF_WD_CONTEXT_NODE,

Itab_KNA1 type standard table of KNA1.

  • get data from table KNA1

select * from KNA1 into table Itab_KNA1.

  • navigate from <CONTEXT> to <KNA1> via lead selection

*KNA1_NODE is your defined node in the context of view mapped to one of component.

Node_KNA1 = wd_Context->get_Child_Node( Name = `KNA1_NODE` ).

  • bind internal table to context node <KNA1>

Node_KNA1->Bind_Table( Itab_KNA1 ).

endmethod.

Answers (2)

Answers (2)

Former Member
0 Kudos

hi shyja..........

create a node woth some attributes that hold the values of the fields of kna1 and give the cardinality as 0...n. bind this node to the table..... at wddoinit or in any method according to your logic..... select the values of kna1 into an internal table and bind it to this node using the method bind_table.

you can also make use of supply function...

check this link:

[link|https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/7a89b067-0801-0010-8192-a9896a60938e ]

---regards,

alex b justin

Former Member
0 Kudos

Hi Shyja ,

you can do like this

1. In component controller create a node say tab_kna1, give dictianary structure name as kna1.

2. right clik the node -> create from container- select the attributes(fields you want)

3. save and activate comp controller

4.map the node tab_kna1 to your required view

5. then on the table control in the view -> onlayuout-> tablectrl prperties-> create binding -> map to the node tab_kna1

6. now it will display you all the attributes in the node as fields in tbctrl.

7. now in wddo init or in the method you want to populate tbctrl

create an itab of type kna1.

select your record to this itab.

using wizard or manual coding get focus to the node tab_kna1.

bind the itab to the node.

thats all

Regards

Sarath