cancel
Showing results for 
Search instead for 
Did you mean: 

Help required regarding ObjectValueSelector

Former Member
0 Kudos

Hi all,

I have a requirement like this, in my View I have 2 DropDownByKeys and 1 input field. The inputfield should be empty and the 2 DropDoenByKeys shud be populated with the data from backend, when I click on save button, the data shud be saved in the backend with the given values. I have a Bapi which have all these fields and will also save to the database.

How to do this appl? Give me development procedure step-wise and also suggest me where and what code shud be written. Its urgent. Plz someone share your knowledge.

regards,

Datta Saru

Thanks a lot in advance.

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi ,

You can populate dropdown values from BAPI using the following steps. I assume you have idea about custom controller.

step1:

Create custom controller.Inside custom controller Bind input value then execute BAPI.

step2:

Now you have value node which is returned from BAPI. After execute BAPI you can find size using the following code. create value node and model node object using the code.

Step3:

<custom controller name>.IRole_ResultNode modelnode=wdContext.nodeRole_Result();

<custom controller name>.IRole_OutputNode valuenode=wdContext.nodeRole_Output();

valuenode.invalidate();

int size=modelnode.size();

Step4:

After find size using loop fetch values from model node into value node.Asume in this value node contains key and value.

for(int x=0;x<modelnode.size();x++){

<custom controller name>.IRole_ResultElement modelElement=modelnode.getRole_ResultElementAt(x);

<custom controller name>.IRole_OutputElement valueElement=wdContext.createRole_OutputElement();

valueElement.setId(modelElement.getKey());

valueElement.setText(modelElement.getValue());

valuenode.addElement(valueElement);

}

step5:

After that bind this value node(Role_Output) into Component controller. Then Bind value node(Role_Output) from component controller into view.

Step6:

Finally bind dropdown UI Element into Role_Output node's attribute(ID).

Kind Regards,

S.Saravanan

Message was edited by: Saravanan S

Message was edited by: Saravanan S

Message was edited by: Saravanan S

Former Member
0 Kudos

Hi

If you have any struggle let me know.

Kind Regards,

S.Saravanan

Message was edited by: Saravanan S

Former Member
0 Kudos

Hi,

>>hi

>>Kind Regards,

>>S.Saravanan

I cannot see anything otherthan this in your reply.

Former Member
0 Kudos

Hi saravanan,

But in the customcontroller,

Bapi_View_Input input=new Bapi_View_Input();

wdContext.nodeBapi_View_Input().bind(input);

input.setMbrsh(new ); here when I press ctrl+space button am not getting anything, and also in Models->ModelClasses-> I cannot see anything like Bapisfldst,Bapiret2,Bapisflava. However the Bapi.._Input and Bapi.._Output are present. Is this the reason for not getting in input.setMbrsh(new ....)here.

Is this the problem with me Bapis???

Help required,its urgent

Thanks&regards,

Datta

Former Member
0 Kudos

Hi Datta,

Supposed to inside the Custom contoller you couldn't get anyThing please Type the nodeName explicitly on left side then right side after wdContext() it will automatically comes.

Kind Regards,

S.Saravanan.

Former Member
0 Kudos

Hi,

>>Bapi_View_Input input=new Bapi_View_Input();

>>wdContext.nodeBapi_View_Input().bind(input);

Iam getting probs heer........>>input.setMbrsh(new ????);

Former Member
0 Kudos

Hi Datta,

What are the inputs has to be given?. First you have to known the proper inputs for that BAPI. What is the meaning of Mbrsh?. I thing all BAPI inputs are string. So first you create one string variable then assign values Like;

String mbrsh="Input value for BAPI";

input.setMbrsh(mbrsh);

Like you assign all input parameter then execute BAPI. After getting result from BAPI following above steps.

Kind Regards,

S.Saravanan.

Message was edited by: Saravanan S