cancel
Showing results for 
Search instead for 
Did you mean: 

How to call a view from the onaction method of another view.

Former Member
0 Kudos

Hi experts,

I have two view let view1 and view2 in my web dynpro component.

In view1 there is a submit buttons having an action name fetch .

Now within the code of onactionfetch I want to call second view as well as  want to pass wa data to to second view.

For Eg:

method ONACTIONfetch .

---

---

if sy-subrc <> 0.

******* call second view  ie view2

endif.

endmethod

thanks.

Accepted Solutions (0)

Answers (1)

Answers (1)

former_member219762
Contributor
0 Kudos

Hi,

Define outboundplug  for view1  and inboundplug for view2  and navigation link between them and fire outboundplug method ONAvalueTIONfetch.To send values use outboundplug parameters.

For more details go through http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/308ebfe9-a07a-2c10-e494-9849d50ef...

Regards,

Sreenivas.

Former Member
0 Kudos

Hi Rao,

I know to navigate from one view to another view and vice versa on clicking action button with help of inbound and outbound plug.

But here I want to call view2 when the sy-subrc fails within the code of view1. I knw how to call view if user click action button. But how to call the view without user interacation I mean if sy-subrc get fail within code of view1 it should automatically trigger view2  dynamically??

I need it urgent.

former_member219762
Contributor
0 Kudos

Hi,

IF sy-subrc<> 0.

wd_this->fire_<outboundplug of view 1>( ).

endif.

Regards,

Sreenivas.

Former Member
0 Kudos

Thanks Sreenivas,

Its working now ...