cancel
Showing results for 
Search instead for 
Did you mean: 

data not coming in alv output

former_member574106
Participant
0 Kudos

Hi friends,

I have designed a second WEBDYNPRO ALV appl, but here also the output is not showing in the ALV. what is the issue? Points will

be rewarded .

Regards,

Saurav Lahiry

Accepted Solutions (1)

Accepted Solutions (1)

former_member205363
Contributor
0 Kudos

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.

former_member574106
Participant
0 Kudos

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.

former_member205363
Contributor
0 Kudos

Hi,

1. Your code is fine, but check the node structure and select query structure is same or not.

if not same append each line to the node table itab then bind it.

2. Try to put the code in wd component Controller->wddoinit method.

Thanks,

Prasad.

sahai
Contributor
0 Kudos

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

former_member574106
Participant
0 Kudos

Hi Laxmi,

Thanks a lot for the hint. Data has come.

Regards,

Saurav Lahiry

Answers (2)

Answers (2)

0 Kudos

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,

http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/b06d230e-df1b-2e10-0190-d9c74ad83...

former_member218528
Participant
0 Kudos

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

former_member574106
Participant
0 Kudos

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

former_member218528
Participant
0 Kudos

Hi Saurav,

Please go through the link specified by Naresh Raj..

* You have to include the standard ALV Component SALV_WD_TABLE in the Used component of your    Component/Application.

Regards,

      Rohan