on 09-19-2014 11:43 AM
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
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
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
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
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
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
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
6 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.