cancel
Showing results for 
Search instead for 
Did you mean: 

Method to initialize the controller

Former Member
0 Kudos

Dear all,

I'm creating a simple webdynpro project. I have four import parameters in the rfc which will act as search criterion in the search view. Now at the step of writing code in the Implementation tab of the controler. In the method <b>public void wdDoInit()</b>, How will i create element fo these parameters??

for example in the demo example for the flightlist for the input parameter destination_from it is give:-

Bapi_Flight_Getlist_Input input = new Bapi_Flight_Getlist_Input();

wdContext.nodeBapi_Flight_Getlist_Input().bind(input);

Bapisfldst bapisfldstFrom = new Bapisfldst();

input.setDestination_From(bapisfldstFrom);

<b>how wud i do same for my input parameter docdate_from??</b>

please suggest.

Thanks,

Anup.

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Anup,

If docdate_from is your model attribute direclty under your root model node then, no need to initialize for this.

Bapi_Flight_Getlist_Input input = new Bapi_Flight_Getlist_Input();

wdContext.nodeBapi_Flight_Getlist_Input().bind(input);

Bapisfldst bapisfldstFrom = new Bapisfldst();

input.setDestination_From(bapisfldstFrom);

In above code, first two lines are for initializing yoor main model node. And, second two lines are for child model node under your root model node.

If your input parameters are inside such child nodes, then only your need third and forth line.

But, if you want to set some default value for your attribute, then you can use set method as given below.

input.setDestination_From(<default value>);

Regards,

Bhavik

Former Member
0 Kudos

Hi Anup,

The following statement will intialize all your input elements

Bapi_Flight_Getlist_Input input = new Bapi_Flight_Getlist_Input();

You can trype input.seXXX() to set the default values for your input attributes.

Regards, Anilkumar