on 03-20-2012 7:54 PM
Hi,
I have a problem in using inbound and outbound plug
I am having two views in my window and defined one inbound and one outbound to each view and proper navigation is done
In first window by giving material document number i am fetching data from MSEG table and displaying on the screen in if i click on the button 'Navigate' then the second view will trigger in the second view based on the material fetched from the first view i am fetching Material details and displaying in the second view and thr is button in the second view 'Back' if i press that it will navigate to first view.
My problem is when again i try to execute from the first view instead of getting data its going for dump saying 'null node '
when i came back to first view the old data will be thr on screen is it necessary to clear those things and reinitializee the whole context??
if yes how to do that?? so plzzz help me to solve this issue
Thanks
Nirmal Jain
Hi Nirmal,
I have tried to re-create the scenario. Please find the steps:
First Node: IT_MATNR: Map it with MSEG-MATNR
Cardinality: 1..1
Selection: 0..1
Second Node: IT_DETAILS: Map it to MARA-MATNR and MARA-ERSDA (same cardiniality and selection as above)
{code}
wd_comp_controller->fetch_data( ).
wd_this->fire_out12_plg( ).
{code}
Code will look like:
{code}
METHOD fetch_data .
DATA lo_nd_it_matnr TYPE REF TO if_wd_context_node.
DATA lo_el_it_matnr TYPE REF TO if_wd_context_element.
DATA ls_it_matnr TYPE wd_this->element_it_matnr.
DATA lv_matnr TYPE wd_this->element_it_matnr-matnr.
* navigate from <CONTEXT> to <IT_MATNR> via lead selection
lo_nd_it_matnr = wd_context->get_child_node( name = wd_this->wdctx_it_matnr ).
* get element via lead selection
lo_el_it_matnr = lo_nd_it_matnr->get_element( ).
* get single attribute
lo_el_it_matnr->get_attribute(
EXPORTING
name = `MATNR`
IMPORTING
value = lv_matnr ).
DATA: lv_mat TYPE matnr,
lv_ers TYPE ersda.
SELECT SINGLE matnr ersda INTO (lv_mat, lv_ers) FROM mara
WHERE matnr = lv_matnr.
DATA lo_nd_it_details TYPE REF TO if_wd_context_node.
DATA lo_el_it_details TYPE REF TO if_wd_context_element.
DATA ls_it_details TYPE wd_this->element_it_details.
DATA lv_ersda TYPE wd_this->element_it_details-ersda.
* navigate from <CONTEXT> to <IT_DETAILS> via lead selection
lo_nd_it_details = wd_context->get_child_node( name = wd_this->wdctx_it_details ).
* get element via lead selection
lo_el_it_details = lo_nd_it_details->get_element( ).
* set single attribute
lo_el_it_details->set_attribute(
name = `MATNR`
value = lv_mat ).
* get element via lead selection
lo_el_it_details = lo_nd_it_details->get_element( ).
* set single attribute
lo_el_it_details->set_attribute(
name = `ERSDA`
value = lv_ers ).
ENDMETHOD.
{code}
Regards,
Ajoy
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanx for ur detailed explanation it helped me to solve the issue and please continue this
The problem was when i navigate from second view to first view and try to do any action on the first view it was going for dump.
To fetch the details from node2 i.e in view2 i used WD_CONTEXT.
When i navigate from second view to first view the node name COMPONENTCONTROLLER is replaced by node2 name in WD_CONTEXT i.e node name is filled with the name of node2.
And alwayzz it has to be COMPONENTCONTROLLER details.
so we should not alter WD_CONTEXT contents.
I hope i made attempt to explain clearly
Thanks a lot
Nirmal Jain
Paste the error from ST22. You can invalidate the code (clear the context) so that user can enter data as new input or you can default the material number. It depends on your requirement whether to clear the data when you come back to 1st view from a 2nd view.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanx fr ur valuable reply
I need to clear the values in the first view i.e i can say it has to start as fresh page(reset )
Now i am just navigating by using outbound plug when the navigate button is pressed the outbound will trigger which is taking me to the first view
Problem is when i come back to first view, the data fetched previous action again appears init
and if i do any action its going for dump so according to my understanding it has to clear the data and initialize again as a fresh page The dump
The exception 'CX_WD_CONTEXT' was raised, but it was not caught anywhere along
the call hierarchy.
Since exceptions represent error situations and this error was not
adequately responded to, the running ABAP program
'CL_WDR_CONTEXT_ELEMENT========CP' has to be
terminated.
how to reset or initialize again the context or node?? or is it possible to call fres page again???
Thanks
Nirmal Jain
Hi Nirmal,
you said you want to clear the values in node1 when you are navigating from view 2 to view1, in your button action, after you fire the navigation plug, then clear the view node contents.
As we do not know the view1 contents, we cannot guess the point of error unless you provided some thing
Regards
Srinvias
User | Count |
---|---|
95 | |
11 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.