cancel
Showing results for 
Search instead for 
Did you mean: 

Internal table in WDA

Former Member
0 Kudos

Hi,

I want to insert records in a Internal table.

Internal table doesnt have global structure(not defined in SE16).

How can I do this???

1. I tried declaring structure in a method, but not able to declare it as table.

2. I tried creating node context (like a structure) with 0..n

but how can i insert records into it?

Any solution???

Thanks,

Suba

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

hi subaram,

you can use like this:


   
    data:
            begin of str,    // your structure
              <field1>  <type>,
              <field2> <type>,
             end of str,

             itab like standard table of str.   // your internal table

---regards,

alex b justin

Former Member
0 Kudos

Hi Suba,

There is no need for structure declaration.

Consider this example. You have one node Node1 and it has some three attributes like Name, age, sex.

Now in method just read the node Node1. So at the generated code see the str_node type ref to if_(ur view name).

So the str_node is the your structure of the Internal table.

Now write the code like,

data : Itab like table of str_node.

Then append the values to itab using str_node. Like this,

str_node-name = 'ur data".
str_node-age    = '22'.
str_node-sex    = 'm'.

append str_node to itab.

Then bind the internal table to your node using bind_table method.

Thanks.

Former Member
0 Kudos

Hi,

Here you cannot insert records as the context for which you want to add attributes are nothing but fields in the structure.So whatever fields you have in structure those only will come.Ie for every context you should have structure.Even though if you try to add attributes they will come as separate attributes but not under context.