cancel
Showing results for 
Search instead for 
Did you mean: 

method WDDOINIT

Former Member
0 Kudos

Hello experts,

I know that WDDOINIT is called automatically when a controller is initialized for the first time. Does this method ever get called again ?

I have added code in an exit button to close the current browser. When I click this button, it again runs the code in this Init method. Note that I have only one controller and one window. There is no further navigation. Why does the Init method get called again is what I am wondering!

Pls. advise. Thx, Liz

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi liz,

WDDOINIT will trigger only once when the component initialize, and even when we talk about

view context it will only trigger. I wonder why your exit functionality is triggering the WDDOINIT

again, we have tried doin same but linked exit functionality to an action and it dosent seem calling

the WDDOINIT again. We kept break-point in WDDOINIT but it just triggers only once.

Regards and Best wishes.

former_member574468
Participant
0 Kudos

hi ,

If you plan to EXIT, it is again start from DOINIT().

If so then capturecontrol with flag.....

i.e., you check flag = 'X' in DOINIT() Mthd.

and then if u press EXIT Button, then clear flag.

the code wont trigger again.

Regards...

Vimal

Former Member
0 Kudos

Hi Vimal,

I think you are explaining this one about the WDDOMODIFYVIEW more than WDDOINIT method.

anand_nidamanuru
Active Participant
0 Kudos

The view WDDOINIT is called every time a popup window is called.

But clicking on the exit button, the corresponding action handler will be called, WDDOINIT should not be called.

Please check if it is the same usage or something else? or you are trying to throw some popup?

Thanks,

Anand

Former Member
0 Kudos

Hello everyone!

Thanks for your responses. My exit plug is working correctly.

This is more info on my View. It has an adobe form that has many dropdowns and input fields. There are some fields which get automatically populated based on entries made by the users. There are several internal tables getting populated in the WDDOINIT method. I have a 'Submit Button' which when clicked should close the browser, retrieve data in the Context and do processing in SAP.

I have been testing and this is what I have found. I kept a breakpoint in the Init method and its not being called now (So maybe I should start a new thread for this!). But when I click on the submit button, I get a 'Wait' symbol for a very long time and then the Connection timed out error comes up.

I commented the population of some internal tables. Obviously some fields dint work. But when I tested by clicking this button, it worked. The browser got closed and processing in SAP was done too.

I am working with a fairly large data. 2-3 of the internal tables (that I commented) have 2000-3000 records. Is there is restriction on how much data the WDN can handle? I am stuck now because even though all codes are correct, the wdn is not able to handle the data.

Any suggestions ? appreciate all your help! Liz

Former Member
0 Kudos

Issue is resolved. When I reduced the data load, the submit button worked ! So I have a workaround to get the data into my form and this works now

Thanks all, Liz

Answers (1)

Answers (1)

Former Member
0 Kudos

I don't know exactally why it's happening with you. But you can check how to create the Exit plug and compare your functionality with this.

1) Create a Outbound plug say EXIT_PLUG (plug type - Exit) in your window and pass the Importing parameter for EXIT_PLUG as CLOSE_WINDOW type BOOLEAN. Ensure that you have checked the interface property of the Exit plug.

2) Write this code in your action event to fire the Exit plug:

DATA: lo_view_cntr TYPE REF TO if_wd_view_controller.

DATA: lo_win_cntr TYPE REF TO if_wd_window_controller.

DATA: ls_parameter TYPE wdr_event_parameter.

DATA: lt_parameter TYPE wdr_event_parameter_list.

DATA: lv_value TYPE REF TO data.

FIELD-SYMBOLS <fs> TYPE ANY.

  • Get the embedding Window Controller instance of the view

lo_view_cntr = wd_this->wd_get_api( ).

lo_win_cntr = lo_view_cntr->get_embedding_window_ctlr( ).

  • Insert the parameters for the exit plug

ls_parameter-name ='CLOSE_WINDOW'.

CREATE DATA lv_value TYPE c.

ASSIGN lv_value->* TO <fs>.

<fs> = 'X'.

ls_parameter-value = lv_value.

INSERT ls_parameter INTO TABLE lt_parameter.

  • Fire the exit plug

lo_win_cntr->if_wd_view_controller~fire_plug( EXPORTING

plug_name = 'EXIT_PLUG' parameters = lt_parameter ).

Hope it helps you.