cancel
Showing results for 
Search instead for 
Did you mean: 

Web Dynpro Change View Configuration

Former Member
0 Kudos

Hi,

I'm trying to create a WD application with 2 views.

On the first view I can select colors from a list and click "OK". The second view shows the selected collor name.

I'm trying to do this with component configuration.

The second view should be from a diferent configuration of the same component based on the color.

How can I select the configuration I want when I make the color selection.

Regards

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Thanks Ricardo, you are giving me a great help.

Now I have it all working.

I press a button and the url changes but my layout is still the same for the two configurations I made.

The two configurations are obviously different!

Is it something missing?!

Former Member
0 Kudos

You need to change the last parameter of your URL and replace it with yout App.Configuratio ID


....sap-wd-configId=PUT_YOUR_APP_CONFIG_HERE

Are you doing this ?

The code I sent you (with ZRQ_AC_EN) was just an example.

This should work.

Kind Regards

/Ricardo

Answers (4)

Answers (4)

Former Member
0 Kudos

Dear Khaytaah,

one last thing that I forgot to mention (but is implicit on the solution).

You will need to use a EXIT plug on your window.

And you need to configure it yourself.

Here's how I've configured mine:

[http://imageshack.us/photo/my-images/37/20110905121430.jpg/]

Kindest Regards

/Ricardo Quintas

Former Member
0 Kudos

Dear Khaytaah,

Not sure how you're calling that method.

My example whas linked to an action, and to a button UI on my view.

Then by cliking on that button, the method I sent you above would be called.

Maybe you haven't created the necessary references on your view regarding using the window component.

Check this screenshot, it is from my VIEW and how I've configured regarding the WINDOW

[http://imageshack.us/photo/my-images/94/viewx.jpg/]

Kindest Regards

/Ricardo Quintas

Former Member
0 Kudos

Dear Khaytaah,

not sure if is this what you're looking for,

but you could dynamically call different comp.configurations for the same WD by doing this type of redirection inside a method.

I did this and it solved my problem:


method ONACTIONGOTO_WD .
  DATA: lo_main_window      TYPE REF TO ig_w_main,
        l_string            TYPE sy-repid.

(...)

  lo_main_window = wd_this->get_w_main_ctr( ).

  if l_string = 'TRUE'.
    lo_main_window->fire_goto_external_wd_plg( url = 'http://HOSTNAME_HERE/sap/bc/webdynpro/sap/YOUR_WEBDYNPRO_APP_HERE?sap-language=DE&sap-wd-configId=ZRQ_AC_EN' ).
  ELSEIF l_string = 'FALSE'.
    lo_main_window->fire_goto_external_wd_plg( url = 'http://HOSTNAME_HERE/sap/bc/webdynpro/sap/YOUR_WEBDYNPRO_APP_HERE?sap-language=DE&sap-wd-configId=ZRQ_AC_DE' ).
  endif.

endmethod.

KIndest Regards

/Ricardo Quintas

Former Member
0 Kudos

lo_main_window = wd_this->get_w_main_ctr( ).

Changed w_main to my main window name and keep getting "Method unknown or protected or private." error.

former_member199125
Active Contributor
0 Kudos
o_main_window = wd_this->get_w_main_ctr( ).

Changed w_main to my main window name and keep getting "Method unknown or protected or private." error.

it means, you forgot to declare you window controller as used controller.

then it wil solve.

Regards

Srinivas

saravanan_narayanan
Active Contributor
0 Kudos

Hello Khaytaah,

For this requirement, I would rather go with config controller then component configuration. Is there any special reason for going for component configuration, instead directly passing the data from view 1 to View 2?

BR, Saravanan

Former Member
0 Kudos

I read this thread:

and it pretty much says what I want.

I want to run a diferent component configurations based on the first selection.

I know I can only do it by dynamic embedding both the component and the component configuration in a main component.

How can I do that?

saravanan_narayanan
Active Contributor
0 Kudos

Hello Khaytaah,

I really doubt whether the solution suggested in the referred thread will suit you. here is summary of the solution proposed

1. there should be a main component

2. the main component should use the second component

3. based on the condition you need to create the component usage (of the second component) by passing the configuration id. If the component usage is already created then you need to delete and re-create the same.

BR, Saravanan

Former Member
0 Kudos

Dear Khaytaah,

Just add to my previous post, my solution dynamically redirects you to a specific configuration.

There might be other alternatives for sure.

But this one is simple and it works.

If it suits you, it is up for you to test and decide - since I don't know the full specs of your problem.

Kindest Regards

/Ricardo Quintas