on 02-09-2016 9:41 AM
Hi,
Try below code in wddoinit.
DATA LO_ND_ALV_TABLE TYPE REF TO IF_WD_CONTEXT_NODE.
DATA itab TYPE WD_THIS->ELEMENTS_ALV_TABLE.
refresh itab.
LO_ND_ALV_TABLE = WD_CONTEXT->GET_CHILD_NODE( NAME = wd_this->wdctx_ALV_TABLE ).
SELECT * FROM bsak INTO corresponding fields of TABLE itab.
LO_ND_ALV_TABLE->BIND_TABLE(
NEW_ITEMS = itab
SET_INITIAL_ELEMENTS = ABAP_TRUE ).
Thanks,
Prasad.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Lakshmi,
Thanks for ur help. I implemented ur code but still the data is not coming in alv output . Please go through the link and the code below.
http://qwerty.uio.com:8000/sap/bc/webdynpro/sap/zwebdynproprac2_exe?sap-client=800&sap-language=EN
method WDDOINIT .
DATA LO_ND_ALV_TABLE TYPE REF TO IF_WD_CONTEXT_NODE.
DATA LO_EL_ALV_TABLE TYPE REF TO IF_WD_CONTEXT_ELEMENT.
DATA LS_ALV_TABLE TYPE WD_THIS->ELEMENT_ALV_TABLE.
DATA : itab TYPE wd_this->elements_alv_table,
wa_itab LIKE LINE OF itab.
refresh itab.
** navigate from <CONTEXT> to <ALV_TABLE> via lead selection
LO_ND_ALV_TABLE = WD_CONTEXT->GET_CHILD_NODE( NAME =
wd_this->wdctx_ALV_TABLE ).
** @TODO handle non existant child
* IF lo_nd_alv_table IS INITIAL.
* ENDIF.
*
** get element via lead selection
* LO_EL_ALV_TABLE = LO_ND_ALV_TABLE->GET_ELEMENT( ).
** alternative access via index
* lo_el_alv_table = lo_nd_alv_table->get_element( index = 1 ).
** @TODO handle not set lead selection
* IF LO_EL_ALV_TABLE IS INITIAL.
* ENDIF.
**refresh itab.
*** get all declared attributes
** LO_EL_ALV_TABLE->GET_STATIC_ATTRIBUTES(
** IMPORTING
** STATIC_ATTRIBUTES = LS_ALV_TABLE ).
* Fetch data from BSAK
SELECT * FROM bsak INTO CORRESPONDING FIELDS OF TABLE itab.
* Transfer data from itab to context
lo_nd_alv_table->BIND_TABLE(
* EXPORTING
NEW_ITEMS = itab
SET_INITIAL_ELEMENTS = ABAP_TRUE ).
* INDEX =
.
What is the error ? Please explain with screenshots how to debug lo_nd_alv_table
endmethod.
Hi Saurav,
lo_nd_alv_table->BIND_TABLE(
* EXPORTING
NEW_ITEMS = itab
SET_INITIAL_ELEMENTS = ABAP_TRUE ).
* INDEX =
Instead of the above lines please write the below statement
lo_nd_alv_table->BIND_TABLE( itab ).
Place a breakpoint at this statment and check in debugger if the internal table "ITAB" is populated or not.
This should solve your problem, if you are still facing the problem, let me know.
Thanks and Regards,
Shitanshu Sahai
Hi Saurav,
As per your words i can understand u are requirement is to re-use the standard ALV component. the code which u have written is used only for normal Table Ui Element . if u want to Re-use the ALV component .
Below is the link u can follow,
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Saurav,
Hope you are doing well..
* If you want to Display data in your ALV output Initially..you have to Implement the code in WDDOINIT Method ( Hook Method ).
Regards,
Rohan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Rohan,
Thanks for ur help. I implemented the code but still the data is not coming in alv output . Please go through the link and the code below.
http://qwerty.uio.com:8000/sap/bc/webdynpro/sap/zwebdynproprac2_exe?sap-client=800&sap-language=EN
method WDDOINIT .
DATA LO_ND_ALV_TABLE TYPE REF TO IF_WD_CONTEXT_NODE.
DATA LO_EL_ALV_TABLE TYPE REF TO IF_WD_CONTEXT_ELEMENT.
DATA LS_ALV_TABLE TYPE WD_THIS->ELEMENT_ALV_TABLE.
DATA : itab TYPE wd_this->elements_alv_table,
wa_itab LIKE LINE OF itab.
refresh itab.
** navigate from <CONTEXT> to <ALV_TABLE> via lead selection
LO_ND_ALV_TABLE = WD_CONTEXT->GET_CHILD_NODE( NAME =
wd_this->wdctx_ALV_TABLE ).
** @TODO handle non existant child
* IF lo_nd_alv_table IS INITIAL.
* ENDIF.
*
** get element via lead selection
* LO_EL_ALV_TABLE = LO_ND_ALV_TABLE->GET_ELEMENT( ).
** alternative access via index
* lo_el_alv_table = lo_nd_alv_table->get_element( index = 1 ).
** @TODO handle not set lead selection
* IF LO_EL_ALV_TABLE IS INITIAL.
* ENDIF.
**refresh itab.
*** get all declared attributes
** LO_EL_ALV_TABLE->GET_STATIC_ATTRIBUTES(
** IMPORTING
** STATIC_ATTRIBUTES = LS_ALV_TABLE ).
* Fetch data from BSAK
SELECT * FROM bsak INTO CORRESPONDING FIELDS OF TABLE itab.
* Transfer data from itab to context
lo_nd_alv_table->BIND_TABLE(
* EXPORTING
NEW_ITEMS = itab
SET_INITIAL_ELEMENTS = ABAP_TRUE ).
* INDEX =
.
What is the error ? Please explain with screenshots how to debug lo_nd_alv_table
Regards,
Saurav Lahiry
User | Count |
---|---|
85 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.