Sequencing Problem in Web Dynpro ABAP
Hi Web Dynpro (ABAP) Guru's,
Can anyone tell me how to read a parameter from the WDA url in my view? The situation is like this: My WDA is being rendered in the Portal EP 6.0 as an iView. When my WDA is called the portal also appends in the URL the plant number. I want to grab that plant number and use it in my view to show some default data.
As per other weblogs/forum posts I defined a parameter "PLANT_NO" in the "Default" startup plug of my Main window. I'm using the Get_Data method to read this parameter in the plug. I'm able to read the URL parameter here and so far it is good. Read below for the problem..
If I understand the order of operations correctly, doesn't the views get created, then the default plug code is run, then the views are placed on the window and then shown to the user. Since my views are created before my default plug is run I DO NOT get the URL parameter value in the WDDOINIT of my view. When I debug the application, the WDDOINIT of the embedded view gets called before the Default startup plug. Am I missing something here?
If someone can tell how to read the URL parameter in the WDDOINIT (instead of Default Startup) of the view I could default in the data I want to display. OR any other suggestions to get past this problem would be appreciated.
Does this make any sense and does anybody have an idea of where I could find some info about how to do this?
Thanks much for your help. Points will be awarded.
Klaus Ziegler replied
I was never working with the portal, so I am not sure all about this. In general I have the impression that the plant number should be part of a shared context and not the plug signature. Possibly a SDN member with portal experience can throw in some light into this.
With my limited knowhow it seems advisable to move the plug argument as fast as possible into the context. From the description that far I assume that the view triggers the build up of the context.
a.) One possible solution I see is to make the plant (number) a say toplevel node. The plant details could be subnodes with according supply methods.
b.) A little bit more dirty method is the use of controller attributes. Store the plant number as controller attribute. This attribute can be accessed by supply methods on demand. Of course this requires a manual invalidate in case the plant number changes.