on 03-15-2015 12:57 PM
Hi ,
I want to create simple web dynpro application to display contents in my z db table.
for that i have added attributes from dictionary to node but when i am trying generate code using wizard in WDDOINIT Method it is generating the below code.
DATA LO_ND_N_ALV TYPE REF TO IF_WD_CONTEXT_NODE.
DATA LT_N_ALV TYPE WD_THIS->ELEMENTS_N_ALV.
* navigate from <CONTEXT> to <N_ALV> via lead selection
LO_ND_N_ALV = WD_CONTEXT->GET_CHILD_NODE( NAME = WD_THIS->WDCTX_N_ALV ).
* @TODO handle non existant child
* IF lo_nd_n_alv IS INITIAL.
* ENDIF.
** @TODO compute values
** e.g. call a model function
*
LO_ND_N_ALV->BIND_TABLE( NEW_ITEMS = LT_N_ALV SET_INITIAL_ELEMENTS = ABAP_TRUE ).
I dont think this is the correct code.
Can anyone help me on this?
I dont think this is the correct code.
Hi,
What you are expecting the code generator to do for you? Unfortunately the code generator is not intelligent enough to read the logic from (y)our mind and populate the data from the database table automatically according to (y)our expectations!
As of now it could generate that much which is correct. You need to populate the data to internal table before bind_table( ).
DATA LO_ND_N_ALV TYPE REF TO IF_WD_CONTEXT_NODE.
DATA LT_N_ALV TYPE WD_THIS->ELEMENTS_N_ALV.
* navigate from <CONTEXT> to <N_ALV> via lead selection
LO_ND_N_ALV = WD_CONTEXT->GET_CHILD_NODE( NAME = WD_THIS->WDCTX_N_ALV ).
SELECT * FROM <DB_TABLE> INTO TABLE LT_N_ALV <where_clause>.
LO_ND_N_ALV->BIND_TABLE( NEW_ITEMS = LT_N_ALV SET_INITIAL_ELEMENTS =ABAP_TRUE ).
Regards,
Kiran
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
78 | |
10 | |
9 | |
7 | |
6 | |
6 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.