cancel
Showing results for 
Search instead for 
Did you mean: 

Populate DropDown list with RFC values

Former Member
0 Kudos

Hi All,

Can u help its urgent..

Actually,I am getting a set of values from an rfc and have it in a context attribute within a node which itself is within a node.Now, I need to display these values residing inside the atrribute in a drop down by index list which is already created.

Points ll be awarded for the solution.

Regards,

Udit

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi,

For eg. node structure is like this,

node(Value)

|

|____attribute

Bind this attribute to dropdownbox then use following coding....

WdDoInit()

{

int size=wdContext.nodebapiNode().size();

List list1=new ArrayList();

for(int i = 0; i<size; i++)

{

IPrivateView.IValuenodeelement ele =wdcontext.nodevalue.createvalueelement();

ele.setattribute(wdcontext.nodevalue.getelementAt(i).getAttributeasText("element name"));

list1.add(ele);

}

wdContext.nodevalue.bind(list1);

}

Regards,

Suresh.T

Former Member
0 Kudos

Hi

Just map the model attribute to view controller and bind it to the view DD list

Now you can only display the value in DDList of this model attribute if it is type list.

I would suggest that a better solution is to use a DDByKey and populate the attributes enumeration.

Now following is the code to do that:


IModifiableValueSet valset = wdThis.wdGetAbcController().wdGetContext().getContext().getModifiableTypeOf("Abc.Acc_Mgnt.Bukrs").getSVServices().getModifiableSimpleValueSet();
// This will give you a value set.
valset.put("key","value");

Values put in the above code :Value refer to the displayed values at runtime.

Keys : Stored in the attribute at runtime.

Regards

Amit

former_member751941
Active Contributor
0 Kudos

Hi Udit,

Check this threads also.

Regards,

Mithu

Former Member
0 Kudos

Hi Udit,

Simple binding should work in your case.

Did you bind the "Texts" propertry of the DropdownIndex to the valueAttribute ??

Thanks,Anilkumar

Former Member
0 Kudos

Hi Anil,

In wdDoModify,I got the object for the dropdown list, and used

dropList.bindTexts(myAttributeInfo);

But the thing is,all the dropdownlist values are coming only in 1st row dropdown itself.The other dropdown list values are also comin only in 1st dropdown list.Others are empty..

I am actuaaly using SUPPLY function to fill the dropdown list..And it is actually getting called the no. of rows I have in table.So SUPPLY fn is working fine I suppose..

Regards,

Udit

Former Member
0 Kudos

Udit,

If you bind the dropdown to valueattribute then it will display all the values in the context.

Let us know the context structure.

Anilkumar

Former Member
0 Kudos

Hi Anil,

My context Structure is:

NodeA

-


NodeB

-


Attr

NodeA gives me the no. of rows in table and NodeB gives no. of items in Drop Down List.NodeA is binded to table structure.

Here, In supply fn for NodeB,

I have to write code....

Like each row has drop down list with say 2 options..

So whatver no. of rows are there, each row's dropdown list must show list of items inside it...

Tell me the code..I am stuck it seems..

According to my code, only 1st dropdown list is getting populated with all values i.e values of other dropdown lists also...

Regards,

Udit