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

Table control

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?

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Jan 28, 2008 at 12:40 PM

    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.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 25, 2008 at 09:17 AM

    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

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 25, 2008 at 09:18 AM

    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

    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.