cancel
Showing results for 
Search instead for 
Did you mean: 

ALV Webdynpro Output

Former Member
0 Kudos

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

Accepted Solutions (1)

Accepted Solutions (1)

former_member184578
Active Contributor
0 Kudos

Hi,

Your where condition is incorrect. Change it as below

data lv_where type string. 

CONCATENATE 'EBELN = ' `'` stru_node_ekpo-ebeln `'` INTO lv_where RESPECTING BLANKS.

Regards,

Kiran

Former Member
0 Kudos

Hi

I have changed  according to you. still not getting output.

can you modify the code.

Actually when i perform debugging , it comes out when it reaches Select query.

help

Regards

varun

former_member184578
Active Contributor
0 Kudos

Hi,

Keep a break point at select query and see the content in lt_where/lv_where.

Please paste your modified code.

Regards,

Kiran

Former Member
0 Kudos

Hi

code is  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: lv_where TYPE string,

         lt_where LIKE TABLE OF lv_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 lv_where RESPECTING BLANKS.

     APPEND lv_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' lv_where INTO lv_where SEPARATED BY space.

     ENDIF.

     APPEND lv_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.


Regards

varun

former_member184578
Active Contributor
0 Kudos

Hi,

Why again you are inserting it to string table!

May I know what you are trying to do with the below code? you are checking ebeln is not initial twice?

  IF stru_node_ekpo-ebeln NE''.

       CONCATENATE 'AND' lv_where INTO lv_where SEPARATED BY space.

     ENDIF.



Try the below code:

data lv_where type string.

IF stru_node_ekpo-ebeln IS NOT INITIAL.

CONCATENATE 'EBELN = ' `'` stru_node_ekpo-ebeln `'` INTO lv_where RESPECTING BLANKS.

ENDIF.

IF stru_node_ekpo-ebelp IS NOT INITIAL.

CONCATENATE lv_where ' AND ' 'EBELP = ' `'` stru_node_ekpo-ebelp `'` INTO lv_where RESPECTING BLANKS.

ENDIF.

SELECT EBELN EBELP LOEKZ AEDAT MATNR LGORT

   FROM ekpo INTO TABLE lt_ekpo WHERE (lv_where).

Regards,

Kiran

Former Member
0 Kudos

Hi

Now, i have used the code  which you told me to do .

But still with same error  as-

ERROR: Error in module RSQL of the database interface (termination: RABAX_STATE)

Regards

varun

former_member184578
Active Contributor
0 Kudos

Hi,

Did you copy&paste the code or you modified the code? Have you check the value in lv_where during debugging.

Please check the value/content of lv_where in debugging.

Regards,

Kiran

Former Member
0 Kudos

Hi

I have check

lv_where value comes in IF condition .

But while Select query its throwing error.

help.

Regards

varun

Former Member
0 Kudos

Hi

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: lv_where TYPE string,

         lt_where LIKE TABLE OF lv_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 lv_where RESPECTING BLANKS.
**
**    APPEND lv_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' lv_where INTO lv_where SEPARATED BY space.
**
**    ENDIF.
**
**    APPEND lv_where TO lt_where.
**
***  ENDIF.
**
**
**
**  SELECT EBELN EBELP LOEKZ AEDAT MATNR LGORT
**
**  FROM ekpo INTO TABLE lt_ekpo WHERE (lt_where).
IF stru_node_ekpo-ebeln IS NOT INITIAL.

CONCATENATE 'EBELN = ' `'` stru_node_ekpo-ebeln `'` INTO lv_where RESPECTING BLANKS.

ENDIF.



IF stru_node_ekpo-ebeln IS NOT INITIAL.

CONCATENATE lv_where ' AND ' 'EBELN = ' `'` stru_node_ekpo-ebeln `'` INTO lv_where RESPECTING BLANKS.

ENDIF.





SELECT EBELN EBELP LOEKZ AEDAT MATNR LGORT

    FROM ekpo INTO TABLE lt_ekpo WHERE (lv_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.


But still it gives the error as-


ERROR: Error in module RSQL of the database interface (termination: RABAX_STATE)


Regards

varun


Former Member
0 Kudos

Hi,

The error is because of your WHERE clause.Check your where condition in debugger,Else try this code

SELECT EBELN EBELP LOEKZ AEDAT MATNR LGORT

FROM ekpo INTO CORRESPONDING FIELDS OF TABLE lt_ekpo WHERE EBELN = stru_node_ekpo-ebeln.

Thanks

KH

Former Member
0 Kudos

Hi

I have used select according to you.

Error comes

ERROR: Error in INPUT_FIELD "ROOTCT_EBELN" of view "Z_ALV.INPUT_VIEW": Context binding of property VALUE cannot be resolved: Node INPUT_VIEW.1.NODE_EKPO does not contain any elements (termination: RABAX_STATE)

Regards

varun

former_member184578
Active Contributor
0 Kudos

Hi,

Now the where clause looks fine. I guess the order of fields in your Z structure is not same as you mentioned in your select query! 

Is "zstr_alv" has the same fields which you mentioned in the Select query?

Regards,

Kiran

Former Member
0 Kudos

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

Former Member
0 Kudos

Hi

yes

order is same .

But still error arises

Can you modify my code for me.

I will be thankful to you.

Regards

varun

Former Member
0 Kudos

Hi

Thanks for immediate reply.

Problem solved .Cardinality  was the issue.

Now, if i want to use select options also.

can you help

Regards

varun

Former Member
0 Kudos

Hi,

Pls close the thread and create new thread with your new queries.Anyhow, browse this link Using Select-Options in Web Dynpro for ABAP

Thanks

KH

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi

In addition to kiran above.

I think you should write the condition in capital  letters too.

CONCATENATE 'EBELN = ''' STRU_NODE_EKPO-EBELN '''' INTO ls_where.


Regards

Vaibhav juneja