cancel
Showing results for 
Search instead for 
Did you mean: 

Alternate to WDDOINIT method..!

Former Member
0 Kudos

Hi Guys,

               I design a webdynpro application with multiple views.

in the summary view, which is the last one, I am calling a method to calculate values in WDDOINIT method in summary view.

But when the user go back make changes after entering summary view, I need to call the calculate method again.

Wondering what's the best method to call it again. not sure WDDOMODIFYVIEW will help ?

Thanks

Sam

Accepted Solutions (1)

Accepted Solutions (1)

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

The other option is to change the lifetime property on the Summary View to When Visible. That way when you navigate away from the view, it will be destroyed.  This causes the WDDOINIT to fire again each time you come back to this view.

Former Member
0 Kudos

Hi Thomas,

                  I am using this view in FPM GAF component, so controlling it through "when visible property" isn't possible..!

I am calling it in PROCESS_BEFORE_OUTPUT in comp. controller, the only issue is its called many times as I have 8 screens.

Thanks

Sam

Shivesh
Advisor
Advisor
0 Kudos

Hi Sam,

    Use ur custom method as a static method and use it, however you want to. This is not exactly as per ur requirement. But will help u:

http://scn.sap.com/community/web-dynpro-abap/floorplan-manager/blog/2012/04/12/sharing-data-between-...

Regard's,

Shivesh Ranjan.

Answers (5)

Answers (5)

thomas_szcs
Active Contributor
0 Kudos

Hi Sam,

you should do your calculation inside of the assistance class. This object is shared among all controllers of your component. Views should only contain UI related logic.

Best regards,

Thomas

Shivesh
Advisor
Advisor
0 Kudos

HI Sam,

     You can do one thing, it will be simple. Keep the results in Attribute of View or Component Controller in the desired data type or structure or Int. Tab. And, u cal the method again and use previous values for your computation.

Or, what u can do, make it a static method, keep the instance of class in attribute of view or component controller and use it for further use. As, last instance of data will be captured or stored.

Regard's,

Shivesh Ranjan.

Former Member
0 Kudos

Hi,

The WDDOINIT method will be called only once in the lifetime of the view.

In your post, you mentioned that User goes back and make some changes and comes again to Summary View.

If user goes back to previous view and comes back to Summary View then you must be using Outbound and inbound plugs for this navigation.

You can write the related code in the method HANDLE_<Inbound Plug Name>... method which is a handler connected with inbound plug. It will be called every time user navigates to Summary View.

For Ex. If the inbound plug name is "From_XYZ_View" , then there will be a corresponding method as

HANDLEFrom_XYZ_View.

Regards,

Rohit

Shivesh
Advisor
Advisor
0 Kudos

Hi Sam,

     This method WDDOPOSTPROCESSING at Component Level is called after every processing in any of the views. You can use this.

Regard's,

Shivesh Ranjan.

Former Member
0 Kudos

Hi Sam,

You can write the code in PROCESS BEFORE OUTPUT method in the component controller. This method will be called each time you enter the summary screen.

Thanks,

Pris.