cancel
Showing results for 
Search instead for 
Did you mean: 

Dorpdown key with external mapping

Former Member
0 Kudos

Hi Experts

I have a situation here i'trying to resolve. Any help would be appreciated.

I have 2 components A and B. Let say component A uses its view A and component B uses its view B.

View A of component A uses a dropdown key. The values in dropdown get populated from a RFC call in component A.

View B of component B also a dropdownkey. The values in dropdown get populated from the same RFC call as in A.

As you can seen, values in dropdown get populated and duplicated at 2 places in component A and B, hence 2 calls to RFC.

I tried to create another component C which will call the same RFC just once and populate the dropdown values in order to return to component A or B through extenal context mapping.

To achieve this, I declare a value attribute vaColor (type string) in the interface controller context of component C and uses the following code in do_init of component C. Please note the value attribute vaColor has Input Element property = true and it will be mapped to exactly the same value attribute declared in component A and B.

<b>Unfortunately this does not work. The problem is WD does not permit to modify a data type of a value attribute used in external context mapping. How do you experts resolve this ?</b><b> Please remember that my objective is to have 1 single RFC call in a child component to populate the dropdown list and this dropdown list will be transferred back for use by different parent components.</b>

ISimpleTypeModifiable myType = wdThis.wdGetAPI().getContext).getModifiableTypeOf("vaColor");

IModifiableSimpleValueSet valColor = myType.getSVServices().getModifiableSimpleValueSet();
.........
.........
.........
.........
calling RFC
..........
.........
...........
for (int i = 0; i < wdContext.node<>.size(); i++) {
valColor.put(wdContext.node<>.getXXElementAt(i).getKey(),
	wdContext.node<>.getXXElementAt(i).getText());
}

Thanks a lot in advance guys

Accepted Solutions (1)

Accepted Solutions (1)

lajitha_menon
Contributor
0 Kudos

Hi Ralph,

Instead of directly trying to modify the type as in your method, I would do the following.

-Call RFC in the init of comp C to get data. This data will be copied to a value node(created in comp C) - say this is the value node structure

Plant

-Value

-Description

Comp A and Comp B will use Comp C. They will have the same node Plant , mapped to comp C's context.

Data will be populated when comp C is initiated(after executing the Bapi, copy values from model node to this Plant node)

Comp A and comp B get the values through context mapping. In the individual view wdDoInit method, your code of ISimpleModifiable... is called, and values are populated from this node.

Hope that helps,

Regards,

LM

Answers (0)