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

How to get context from a table back into an internal table

Hello,

I am new with working WD ABAP. I achieved to build a table with some data.

But now I want to get the data back from the view table to an internal table,

to update for example a sap table.

How can ik do this? With the node->bind_table I achieved to give the data to

the view . But what must I do to render it back to an internal table.

For a normal field I know how to this, with the get_attribute method of an element.

Thanks in advance.

Harrie

Add a comment
10|10000 characters needed characters exceeded

Related questions

2 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Jan 29, 2007 at 06:21 AM

    Hi Harrie Prinsen

    You can use GET_DATA_SOURCE() method of the class CL_WD_TABLE.

    Regards

    Rakesh

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 29, 2007 at 07:24 AM

    Hi Harrie.

    You can read the data from the context node directly.

    data:
              Node_Po_Data     type ref to If_Wd_Context_Node,
              Node_Po_Items    type ref to If_Wd_Context_Node.
    
        data:
              lt_items         type table of bapimepoitem.
    
        data:
              Stru_Po_Items    type If_V_Po_Data=>Element_Po_Items,
              ls_item          type bapimepoitem.
    
        field-symbols:
                       <items> type any table.
    
    *   navigate from <CONTEXT> to <PO_DATA> via lead selection
        Node_Po_Data = wd_Context->get_Child_Node( Name = IF_V_PO_DATA=>wdctx_Po_Data ).
    
    *   navigate from <PO_DATA> to <PO_ITEMS> via lead selection
        Node_Po_Items = Node_Po_Data->get_Child_Node( Name = IF_V_PO_DATA=>wdctx_Po_Items ).
    
    *   @TODO handle not set lead selection
        if ( Node_Po_Items is initial ).
        endif.
    
       assign lt_items to <items>.
    
    *   get actual content
        node_po_items->GET_STATIC_ATTRIBUTES_TABLE(
          importing
            table = <items>
         ).
        move <items> to lt_items.
    
    

    Hope this helps.

    Cheers,

    Sascha

    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.