cancel
Showing results for 
Search instead for 
Did you mean: 

Suitable code is not getting generated when using Wizard in web dynpro

Former Member
0 Kudos

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?

Accepted Solutions (1)

Accepted Solutions (1)

former_member184578
Active Contributor
0 Kudos
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

Former Member
0 Kudos

Hey ,

i know that i have to populate data into internal table but i dint know that LT_N_ALV is an internal table ...when i checked other references where internal was clearly defined like type table of..

Anyway Thanks for the answer.

Answers (0)