cancel
Showing results for 
Search instead for 
Did you mean: 

Dropdown values order change

Former Member
0 Kudos

Hi experts,

I have DropdownbyIndex in my webdynpro screen. The values are coming from (BAPI.Using Jco connection)

In BAPI values are displayed in the BAPI side the following ways

1.ABAP

2.XI

3.EP

4.BI

in My webdynpro dropdown values are displayed in the same order. Is there any possiblity to change the order?If yes How to change the order of the values(without chaging from BAPI side) and how to display the different order in the dropdown?

Regards,

P.Manivannan.

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi,

Create a simple type . n give values n coressponding text in ur desired order.

now create a value node in context of vew . map the value prperty wid this simpletype,whch u hv created.

hpe it will solve ur problm.

Regards

Khushboo

Former Member
0 Kudos

Hi Khushboo,

Thanks for your reply. I have different portal user like ABAP,XI,EP,BI

If ABAP user login into the portal my dropdown value shown in the below order . the first value of the dropdown is "ABAP"

1.ABAP

2.XI

3.EP

4.BI

similiarly if XI user logged in portal dropdown should be (the first value of the dropdown is "XI"

)

1.XI

2..ABAP

3.EP

4.BI

similiarly if EP user logged in portal dropdown should be (the first value of the dropdown is "EP"

)

1.EP

2.XI

3.ABAP

4.BI

similiarly if BI user logged in portal dropdown should be (the first value of the dropdown is "BI"

)

1.BI

2.XI

3.EP

4.ABAP

Regards,

P.Manivannan.

ravindra_bollapalli2
Active Contributor
0 Kudos

hi,

go for the dynamic programming like

if the portal user is ep and set the dynamically call the dropdown as u needs

(like if the user id ep)

let me know if u need any futher info

bvr

Former Member
0 Kudos

Hi.

it just tht u want to set default value accoding to user role.

like if user's role is abaper thn first value in dropdown will b ABAP..

If i'm getting u right.

then first get role of user in Wdinit()

for role fetahing u cn go through :

[role|https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/80ef07f8-3e6c-2b10-9cb7-81d4ef2e294a]

then hold this role in varible n apply a condition like

If (var.equalsIgnoreCase(")

{

wdcontext.current<Valuenodeforsimpletype>.set("ABAP");

}

likewise u cn apply conditions for each n every role.

hope it'll hlp u

Regards

Khushboo

ravindra_bollapalli2
Active Contributor
0 Kudos

hi Khushboo,

As per the P.Manivannan. written in above note

he has 4 differenet user. whenever the user (optional) we have to get the current user and we can change the dropdown list accroding to it

/message/553298#553298 [original link is broken]

we can store in list..later we can assign the list to dropdown index

let me know u need any further info

bvr

Former Member
0 Kudos

Hi all,

If i use this code

If (var.equalsIgnoreCase("<abaprole>)

{

wdcontext.current<Valuenodeforsimpletype>.set<attribute>("ABAP");

}

the corresponding value is coming in the top of the dropdown list. But my scenario was the

"Dropdown values coming from BAPI"

If i use above code additionally one value is added in my dropdown

For eg: If i choose EP following order will come

1.EP

2.XI

3.ABAP

4.BI

5.EP

EP displayed twice? any other suggestions

Regards,

P.Manivannan.

Former Member
0 Kudos

Hi manivannan,

1. Loop trough the node using the node.size() method.

2. Read the element from the node using get.....ElementAt(i)

3. Check if it is the element you are looking for then use:

4. Deselect any element that might be selected: node.setLeadSelection(IWDNode.NO_SELECTION)

5. Select the element you found: node.setSelected(index, true);

That's it.

Jeschael

Former Member
0 Kudos

Hi,

As u said EP is displayed twice ..thn I wud like to tell u that first EP is ur defult selected value in drop down.

2nd EP is drop down value..u dnt hav to wrry bout it..

If u select any value frm dropdown, it doesnt mean tht it'll be removed from dropdown.

this is d scenerio..

hope it solves ur problm..

Regards

Khushboo

Former Member
0 Kudos

solved

former_member201361
Active Contributor
0 Kudos

hi,

create a context node and attribute of type String .

copy the model data from the model node to a collection(for eg List) and sort it in what ever order you want.

use the below code to populate the node .

wdContext.node<ValueNode>.bind(<Collection>);

bind the attribute to the text property of drop down by index.

Thanks and Regards