on 02-22-2012 5:09 AM
Hi Experts
I have Created Web Dynpro Application With Two Views
1.Search for Flights
2.flights Display
my Input parameter is CONNID and CARRID
but When I am executing the Application i am able to put the input parameters after while we executing the Search button it is showing the below error
The following error occurred in system BQ1 : Parameter CARRID contains an invalid value .
The error occurred on application server inbiw_BQ1_00 and in work process 0 .
The termination type was: RABAX_STATE
The ABAP call hierarchy was:
Method: ONACTIONSEARCH of program /1BCWDY/OX2UNUTJ22TFU10XW8RB==CP
Method: IF_WDR_VIEW_DELEGATE~WD_INVOKE_EVENT_HANDLER of program /1BCWDY/OX2UNUTJ22TFU10XW8RB==CP
Method: INVOKE_EVENTHANDLER of program CL_WDR_DELEGATING_VIEW========CP
Method: IF_WDR_ACTION~FIRE of program CL_WDR_ACTION=================CP
Method: DO_HANDLE_ACTION_EVENT of program CL_WDR_WINDOW_PHASE_MODEL=====CP
Method: PROCESS_REQUEST of program CL_WDR_WINDOW_PHASE_MODEL=====CP
Method: PROCESS_REQUEST of program CL_WDR_WINDOW=================CP
Method: EXECUTE of program CL_WDR_MAIN_TASK==============CP
Method: IF_WDR_RUNTIME~EXECUTE of program CL_WDR_MAIN_TASK==============CP
Method: HANDLE_REQUEST of program CL_WDR_CLIENT_ABSTRACT_HTTP===CP
ONACTIONSEARCH Method
method ONACTIONSEARCH .
DATA lo_el_context TYPE REF TO if_wd_context_element.
DATA ls_context TYPE wd_this->Element_input.
DATA lv_carrid TYPE wd_this->Element_input-carrid.
DATA lv_connid TYPE wd_this->Element_input-connid.
get element via lead selection
lo_el_context = wd_context->get_element( ).
get single attribute
lo_el_context->get_attribute(
EXPORTING
name = `CARRID`
IMPORTING
value = lv_carrid ).
get single attribute
lo_el_context->get_attribute(
EXPORTING
name = `CONNID`
IMPORTING
value = lv_connid ).
wd_this->fire_toflights_plg(
carrid = lv_carrid " scarr-carrid
connid = lv_connid " sflight-connid
).
endmethod.
HANDLEFROMSEARCH
method HANDLEFROMSEARCH .
DATA :
IT_FLIGHTS TYPE TABLE OF SFLIGHT,
NODE_FLIGHTS TYPE REF TO IF_WD_CONTEXT_NODE.
CARRID TYPE SFLIGHT-CARRID,
CONNID TYPE SFLIGHT-CONNID.
SELECT * FROM SFLIGHT
INTO TABLE IT_FLIGHTS WHERE CARRID = CARRID AND
CONNID = CONNID .
NODE_FLIGHTS = WD_CONTEXT->GET_CHILD_NODE( name = 'FLIGHTS' ).
Bind Internal table to context
NODE_FLIGHTS->Bind_table( IT_FLIGHTS ).
endmethod.
Also guide me how to debug the code
please guide
Regards
Giridharan R
Tip:
You should always use "Web Dynpro Code Wizard Button (CTRL+F7)" in the toolbar. Harry Potters magic wand.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
An easier solution is to correct the structure on the other side, USE THIS instead of my former post:
method HANDLEFROMSEARCH .
DATA :
IT_FLIGHTS TYPE wd_this->ELEMENTS_INPUT, "<----------NEW
NODE_FLIGHTS TYPE REF TO IF_WD_CONTEXT_NODE.
* CARRID TYPE SFLIGHT-CARRID,
* CONNID TYPE SFLIGHT-CONNID.
SELECT * FROM SFLIGHT
INTO CORRESPONDING FIELDS OF TABLE IT_FLIGHTS "<-----------NEW
WHERE CARRID = CARRID AND
CONNID = CONNID .
NODE_FLIGHTS = WD_CONTEXT->GET_CHILD_NODE( name = 'FLIGHTS' ).
Regards
Ismail
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi
i have changed with ur code but again showing the errror which is in below
The following error occurred in system BQ1 : Could not find attribute CARRID
The error occurred on application server inbiw_BQ1_00 and in work process 0 .
The termination type was: RABAX_STATE
The ABAP call hierarchy was:
Method: IF_WD_CONTEXT_NODE_INFO~GET_ATTRIBUTE of program CL_WDR_CONTEXT_NODE_INFO======CP
Method: IF_WD_CONTEXT_ELEMENT~GET_ATTRIBUTE of program CL_WDR_CONTEXT_ELEMENT========CP
Method: ONACTIONSEARCH of program /1BCWDY/OX2UNUTJ22TFU10XW8RB==CP
Method: ONACTIONSEARCH of program /1BCWDY/OX2UNUTJ22TFU10XW8RB==CP
Method: IF_WDR_VIEW_DELEGATE~WD_INVOKE_EVENT_HANDLER of program /1BCWDY/OX2UNUTJ22TFU10XW8RB==CP
Method: INVOKE_EVENTHANDLER of program CL_WDR_DELEGATING_VIEW========CP
Method: IF_WDR_ACTION~FIRE of program CL_WDR_ACTION=================CP
Method: DO_HANDLE_ACTION_EVENT of program CL_WDR_WINDOW_PHASE_MODEL=====CP
Method: PROCESS_REQUEST of program CL_WDR_WINDOW_PHASE_MODEL=====CP
Method: PROCESS_REQUEST of program CL_WDR_WINDOW=================CP
method HANDLEFROMSEARCH .
DATA :
IT_FLIGHTS TYPE TABLE OF SFLIGHT,
IT_FLIGHTS TYPE wd_this->ELEMENTS_FLIGHTS,------->"ELEMENTS_INPUT " showing error so that i have changed
NODE_FLIGHTS TYPE REF TO IF_WD_CONTEXT_NODE,
CARRID TYPE SFLIGHT-CARRID,
CONNID TYPE SFLIGHT-CONNID.
SELECT * FROM SFLIGHT
INTO CORRESPONDING FIELDS OF TABLE IT_FLIGHTS
WHERE CARRID = CARRID AND
CONNID = CONNID .
NODE_FLIGHTS = WD_CONTEXT->GET_CHILD_NODE( name = 'FLIGHTS' ).
Bind Internal table to context
NODE_FLIGHTS->Bind_table( IT_FLIGHTS ).
endmethod.
Regards
Giridharan R
Your are using:
* get single attribute
lo_el_context->get_attribute(
EXPORTING
name = `CARRID` "<-------------------not found.
IMPORTING
value = lv_carrid ).
* get single attribute
lo_el_context->get_attribute(
EXPORTING
name = `CONNID`
IMPORTING
value = lv_connid ).
but there is no attribute 'CARRID'.
Check your context. Maybe you didn't add CARRID to the context or you renamed it, e.g. ip_carrid or something.
You have to correct your context-attributes names => ip_carrid to carrid.
This must also be done to make "select * ... into corresponding fields of table" work.
Tip:
When creating context-nodes with attributes from DB tables/structures use right-click-menu-on the node and find "add attribute from structure" or similar. My systemlanguage is not english, so I don't know the exact spelling in english of this menu-entry.
I think you are using your context not correct.
I assume you have followig context:
CONTEXT (node)
---FLIGHTS (node) (1..n)
-
CARRID (attribute)
-
CONNID (attribute)
-
...
if so, this will not work. Because CARRID is no attribute of node CONTEXT ("WD_CONTEXT") but node FLIGHTS.
ONACTIONSEARCH Method
method ONACTIONSEARCH .
DATA lo_el_context TYPE REF TO if_wd_context_element.
DATA ls_context TYPE wd_this->Element_input.
DATA lv_carrid TYPE wd_this->Element_input-carrid.
DATA lv_connid TYPE wd_this->Element_input-connid.
* get element via lead selection
lo_el_context = wd_context->get_element( ). "<-----This is not want you want to do
* get single attribute
lo_el_context->get_attribute(
EXPORTING
name = `CARRID`
IMPORTING
value = lv_carrid ).
Correct as follows. First delegate to your child node FLIGHTS before you get_attribute:
ONACTIONSEARCH Method
method ONACTIONSEARCH .
DATA lo_el_context TYPE REF TO if_wd_context_element.
DATA NODE_FLIGHTS TYPE REF TO IF_WD_CONTEXT_NODE. <----new
DATA ls_context TYPE wd_this->Element_input.
DATA lv_carrid TYPE wd_this->Element_input-carrid.
DATA lv_connid TYPE wd_this->Element_input-connid.
*Delegate to flights
NODE_FLIGHTS = WD_CONTEXT->GET_CHILD_NODE( name = 'FLIGHTS' ). <----new
* get element via lead selection
lo_el_context = NODE_FLIGHTS->get_element( ). <----new
* get single attribute
lo_el_context->get_attribute(
EXPORTING
name = `CARRID`
IMPORTING
value = lv_carrid ).
Hi
i have added Attributes before u said as per u said .but still it showing the same error
as u said it is making problem at here name = `CARRID` <----
not found.
but i am not able to get the track where exactly i have did mistake
or else we need mentioned any extra things in Attributes tab.
please guide me
Regards
Giridharan R
Its too difficult for me to help you without seeing what you have done/are doing.
I think you have troubles with the understanding of context-navigation, and reading/setting context attributes and nodes.
I can't explain you a complete WDA tutorial here. Please refer to online tutorials or SAP help.
I am sorry that I can't give you further help.
Hi...
I guess, the structure of your context-node is not the same as the structure (SFLIGHT) of the internal table you bind to the node. (You didn't use "Add attributes from structure (SFLIGHT)", or you didn't add all fields of the structure, or you deleted the structure afterwards from the nodes properties.)
Compare these structures, and also check the order of the fields (they have to be the same too.)
Regards...
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 right.Did you debug it.
Karthik.R
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I dnt seen any error in code.. just try to pass meaning ful value..make sure you use sama data type in carrid and connid from sflights table..
and for debugging just put a breakpoint in your method,
Regards
Srinivas
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
HI Srinivas
i tried with correct values but again it showing the same error
while trying to debug the code by setting BREAK-PONT.
but while Activating the view , the cursor is not setting the specified line
can u please guide me how to debug the views with methods by step by step.
correct me if am wrong in above posts methods or required further information about my application.
Regards
Giridharan R
User | Count |
---|---|
84 | |
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.