cancel
Showing results for 
Search instead for 
Did you mean: 

duplication of data

Former Member
0 Kudos

I have 3 dropdownfields (a,b,c) but all these field are filled with the same outputfield of the Bapi, but don't need to have the same values. How can I solve this?

Accepted Solutions (1)

Accepted Solutions (1)

luciano_leitedasilva
Contributor
0 Kudos

Hi,

Shoud you read the Bapi result and fill every one dropdown field with the right values. Each dropdown field will bind its attribute context and you will populate individually.

IModifiableSimpleValueSet valueSet_A = wdThis.wdGetController().wdGetContext().getContext().getModifiableTypeOf("Node.AttributeA").getSVServices().getModifiableSimpleValueSet();

// read the bapi result and fill following the specification to each field ...

valueSet.put(key, value);

...

IModifiableSimpleValueSet valueSet_B = wdThis.wdGetController().wdGetContext().getContext().getModifiableTypeOf("Node.AttributeB").getSVServices().getModifiableSimpleValueSet();

// read the bapi result and fill following the specification to each field ...

valueSet.put(key, value);

...

Regards,

Luciano

Former Member
0 Kudos

Luciano, could you pleas explain your code. Should I make all the a seperate attribute and then bind them with this code?

luciano_leitedasilva
Contributor
0 Kudos

Hi Dresen,

Yes, you should bind all attributes with this code. At this case, these attributes are created at the Component Controller.

So, you have tree dropdows and tree attributes. Your code will read the content at the bapi return and set at these attributes. In your view, bind each attribute value with each dropdow.

Regards,

Luciano

Former Member
0 Kudos

what do you mean then with key and value?

<code>

IModifiableSimpleValueSet valueSet_A = wdThis.wdGetUWL_Form_CustController().wdGetContext().getContext().getModifiableTypeOf("PersonalData.P0002_NATIO").getSVServices().getModifiableSimpleValueSet();

// read the bapi result and fill following the specification to each field ...

valueSet_A.put(key, wdThis.wdGetContext().currentCountriesElement().getNatio());

IModifiableSimpleValueSet valueSet_B = wdThis.wdGetUWL_Form_CustController().wdGetContext().getContext().getModifiableTypeOf("PersonalData.P0002_NATI1").getSVServices().getModifiableSimpleValueSet();

// read the bapi result and fill following the specification to each field ...

valueSet_B.put(key, wdThis.wdGetContext().currentCountriesElement().getNatio);

IModifiableSimpleValueSet valueSet_c = wdThis.wdGetUWL_Form_CustController().wdGetContext().getContext().getModifiableTypeOf("PersonalData.P0002_NATI2").getSVServices().getModifiableSimpleValueSet();

// read the bapi result and fill following the specification to each field ...

valueSet_c.put(key, wdThis.wdGetContext().currentCountriesElement().getNatio);

<code>

luciano_leitedasilva
Contributor
0 Kudos

Dresen,

The Key and Value are the values that BAPI return. So, you have a Key and a Value for each option. If you don't have a Key, just a text value, you can set the Value otherwise like a Key.

All right?

Reguards,

Luciano

Answers (3)

Answers (3)

BeGanz
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hallo Sven,

to propse the best solution for your problem it would be helpful to get a more detailed description of your application scenario?

- What's meant with "3 fields are filled with the same outputfield of the BAPI"? Some exectuable Adaptive RFC model object returns a list of displaytexts? What's the output? A list of values?

- Dropdownfields are normally bound to a context attribtue of type "Adaptive RFC Logical Dictionary Simple Type". Is there any such Simple Type envolved? If you have such a Simple Type you can just define three context value attributes of this type without creating three modifiable simple types.

- What happens after selecting one of the 3 dropdownfields. I assume that you must send this data back to the SAP system using another RFC.

Regards, Bertram

Former Member
0 Kudos

well 3 value attributes A, B, C (type string) which are connected to dropdown by key.

One bapi with output nationality.

The dropdown is filled by an other bapi (table dump) what I want to create is when the table dumb bapi is empty for these attributes. then these attributes (A,B,C) should be filled with the bapi with output nationality.

Former Member
0 Kudos

Hi,

Which one u using: Dropdown by Key or Index?

Regards

Fahad Hamsa

Former Member
0 Kudos

dropdown by index binded to a modelattribute

Former Member
0 Kudos

Hi Dresen,

So u r having three dropdown by index elements.Check whether u had bound same model attribute with all dropdowns because then only all will appear as same. Also insert wdContext.nodeOutput.invalidate() in ur custom controller where u calls RFC

Regards

Fahad Hamsa

Former Member
0 Kudos

is there a way to make the value attributes flexible. dpending on the result of the bapi. If the result is empty it should get an other attribute then when it is filled?

Former Member
0 Kudos

Hi Dresen,

Inorder to make the value attributes flexible, u have to define the value attributes inside wdDoModifyView().

For example, to create a value attribute of type string at runtime to the context,

IWDNodeInfo TableNodeInfo=wdContext.getNodeInfo).addAttribute (<attributename> , "ddic:com.sap.dictionary.string")

To create a value attribute of type int at runtime to the context,

IWDNodeInfo TableNodeInfo=wdContext.getNodeInfo).addAttribute(<attributename>, "ddic:com.sap.dictionary.integer");

Regards

Fahad Hamsa

Former Member
0 Kudos

Try to set attribute 'singleton' to false for node which you mapped on drop down control.