on 12-28-2010 11:11 PM
Dear I want learn WD ABAP. I am reading the documentation that follow:
[Web Dynpro for ABAP: Tutorials for Beginners|http://www.sdn.sap.com/irj/sdn/nw-wdabap?rid=/webcontent/uuid/367b73e5-0901-0010-daa3-9de4771fc985] [original link is broken];
However I have doubt with the following code:
method WDDOINIT .
* data declaration
data:
Node_sflight type REF TO IF_WD_CONTEXT_NODE,
Itab_sflight type standard table of SFLIGHT.
* get data from table SFLIGHT
select * from SFLIGHT into table Itab_sflight.
* navigate from <CONTEXT> to <SFLIGHT> via lead selection
Node_sflight = wd_Context->get_Child_Node( Name = `SFLIGHT_NODE` ).
* bind internal table to context node <SFLIGHT>
Node_sflight->Bind_Table( Itab_sflight ).
endmethod.
This code use several methods that is generated, but I want know How is got this code, there is a Wizard for generate this code? or I should learn this code
Hi,
In pattern, choose ABAP Objects patterns.
In that in radio button, Call Method choose the following from F4 button.
Instance Node_sflight
Class/Interface IF_WD_CONTEXT_NODE
Method Bind_table
It will generate the below code.Pass the internal table as shown in bold.
CALL METHOD node_sflight->bind_table
EXPORTING
new_items = itab_sflight
set_initial_elements = ABAP_TRUE
index =
.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
You can use code wizard for reading the context node. In this case, SFLIGHT_NODE.
After that, write the select statement by your own.
Then for binding the table, either you can use Pattern button as normal for OOPS ABAP or you can write the single table.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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 :-
[http://help.sap.com/saphelp_tm70/helpdata/en/3b/29933f09a5fb47e10000000a114084/content.htm]
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
82 | |
10 | |
10 | |
9 | |
6 | |
6 | |
5 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.