Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

ALV Webdynpro Output

Dear Expertise

I  have created a ALV  Webdynpro for EKPO.

I have taken 6 fields.

one is input.

While displaying , its not displaying the output .

Here's the code as-

method ONACTIONACTION_DISPLAY .


   DATA: node_node_ekpo TYPE REF TO if_wd_context_node,

     elem_node_ekpo TYPE REF TO if_wd_context_element,

     stru_node_ekpo TYPE if_input_view=>element_node_ekpo .



* navigate from <CONTEXT> to <NODE_VBAK> via lead selection

   node_node_ekpo = wd_context->get_child_node( name = if_input_view=>wdctx_node_ekpo ).



* get element via lead selection

   elem_node_ekpo = node_node_ekpo->get_element).



* get all declared attributes

   elem_node_ekpo->get_static_attributes(

     IMPORTING

       static_attributes = stru_node_ekpo ).





   DATA: ls_where(72) TYPE c,

         lt_where LIKE TABLE OF ls_where,

         lt_ekpo TYPE STANDARD TABLE OF zstr_alv.



* create where condition

   IF NOT stru_node_ekpo-ebeln EQ''.

     CONCATENATE 'EBELN = ''' stru_node_ekpo-ebeln '''' INTO ls_where.

     APPEND ls_where TO lt_where.

   ENDIF.

*  IF NOT stru_node_ekpo-erdat EQ '00000000'.
*
*    CONCATENATE 'ERDAT = ''' stru_node_ekpo-erdat '''' INTO ls_where.

     IF stru_node_ekpo-ebeln NE''.

       CONCATENATE 'AND' ls_where INTO ls_where SEPARATED BY space.

     ENDIF.

     APPEND ls_where TO lt_where.

*  ENDIF.



  SELECT EBELN EBELP LOEKZ AEDAT MATNR LGORT

   FROM ekpo INTO TABLE lt_ekpo WHERE (lt_where).





   DATA:

     node_node_alv TYPE REF TO if_wd_context_node,

*    elem_node_alv TYPE REF TO if_wd_context_element,

     stru_node_alv TYPE if_input_view=>element_node_alv .



* navigate from <CONTEXT> to <NODE_ALV> via lead selection

   node_node_alv = wd_context->get_child_node( name = if_input_view=>wdctx_node_alv ).





* get all declared attributes

   node_node_alv->bind_table( lt_ekpo ).

endmethod..



While debugging, problem lies with Select statement

Can any one help me in this scenario.

Regards

varun

Former Member
Former Member replied

Hi,

The thing is that you're trying to access node which might be from 0 to 1 or n records (cardinality). And at runtime point you have 0 records with 0 elements. That's why you have problem.

There might be something wrong with logic how you trying to display some data in your text fields.

At runtime there is no context element from which system could take values.

Or you have to change parent node cardinality to 1..1 if that meets logic or review your logic.

Thanks

KH

1 View this answer in context
Not what you were looking for? View more on this topic or Ask a question