Hi carmen ,
The coding you have written above can be generated through code wizard easily.
Just you need to click the code wizard button .
just see the below link :-
you can call nodes and can call them as a table or structure.
again you can access methods and attributes of various classes . The code will be auto genarated. You just need to cange a little bit according to your need.
In pattern, choose ABAP Objects patterns.
In that in radio button, Call Method choose the following from F4 button.
It will generate the below code.Pass the internal table as shown in bold.
CALL METHOD node_sflight->bind_table
new_items = itab_sflight
set_initial_elements = ABAP_TRUE