cancel
Showing results for 
Search instead for 
Did you mean: 

WDDOINIT method executes every time when returning to View

aaron_morden2
Contributor
0 Kudos

We are making Enhancements to the Travel Expense WDA. (Package: PTRM_WEB_UI)

When creating a New Expense Report, the WDDOINIT method is being executed only once each time the View is displayed. This is what is expected.

When changing an existing Expense Report, the WDDOINIT method is being executed each time the view is displayed.

The Lifetime Property of all of the views are set to "framework controlled". It seems like when in change mode, the lifetime property of the views is acting as if they were set to "when visible".

Is there some way that this property is being dynamically changed when in change mode? Does anyone know if SAP intended the Travel Expense WDA to act this way when in change mode?

Any help or insight regarding this issue would be helpful.

Thanks,

Aaron

Accepted Solutions (1)

Accepted Solutions (1)

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

It could be that there are multiple component usages and that this view belongs to an inner component. The parent component could call DELTE_COMPONENT on the component usage if no views from that componet are currently visibile. This is done for memory manage as there is no garbage collection of compoonent instances at runtime. This would have the effect that the WDDOINIT would be called again if the component is used again/the view is reshown. I have seen complex internal applications that use separate components for each tab for instance. When the tab switch occurs, they perform a DELTEE_COMPONENT. This can have a significant positive impact on the memory consumption of the session. This could explain the behaviour you are seeing.

aaron_morden2
Contributor
0 Kudos

This application does have multiple Component Usages and is pretty complex. That is probably the case, it just seems weird that it would behave differently depending on if you were in Create or Change mode.

Answers (1)

Answers (1)

aaron_morden2
Contributor
0 Kudos

Anybody have any idea why this is happening?

I did see that you can dynamically set the lifetime via method SET_LIFESPAN in IF_WD_RR_VIEW, but when debugging this method, I found that the Lifetime Propery is always set to framework controlled.