cancel
Showing results for 
Search instead for 
Did you mean: 

How to get the Key value in the value help?

Former Member
0 Kudos

Hi All,

I am using dropdown by key to display the values from the RFC. I am able to get the text by,

ISimpleValueSet div = wdThis.wdGetContext().getContext().getModifiableTypeOf ("Header.VH_BUnit").getSVServices().getModifiableSimpleValueSet();

return div.getText(wdContext.currentHeaderElement().getVH_BUnit());

Please say how to get the key ?

Thanks & Regards,

Mugundhan

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

Have you tried the following one.

wdContext().currentHeaderElement.getVH_BUnit();

Regards

Ayyapparaj

Former Member
0 Kudos

Hi,

Thanks for ur reply. wdContext.currentHeaderElement().getVH_BUnit() is returning the value in the dropdown only.

Consider this line..

return div.getText(wdContext.currentHeaderElement().getVH_BUnit() );

More simillarly return div.gettKey(................); is there. What value should be given inside. if i gave wdContext.currentHeaderElement().getVH_BUnit() means, it sowing "Cannot convert from object to String " error.

So i created an object like this,

Object attributevalue = wdContext.currentHeaderElement().getAttributeValue(IPublicReportrtComp.IHeaderElement.VH__B_UNIT);

But this too not accepting..

Thanks & Regards,

Mugundhan

Former Member
0 Kudos

Instead of < return div.getText(wdContext.currentHeaderElement().getVH_BUnit()) >, could you try getting this value in a variable first and then use it or return it ?

Former Member
0 Kudos

Hi.

What is the type of VH_BUnit context attribute?

Maybe this helps:


final Object keyObj = wdContext.currentHeaderElement().getVH_BUnit();
final String keyStr = keyObj == null ? null : keyObj.toString();

Former Member
0 Kudos

Hi pavel,

It is String. I had solved the problem by creating a new attribute called temp. I copied the contents to that attribute.

In the RFC i was getting the BusinessUnit and the division as value help. In the key field they r sending the BU and in the Text field division. So there was a bit of problem in fetching it.

So i set the data oh VH_BUnit to temp I fetched the text from the temp.

Thank u all for repying....!

Thanks & Regards,

Mugundhan

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Kandha,

Following links could be helpful for your scenario, please have a look:

Value of RFC in Dropdownbykey:

OVS: https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/e038cf90-0201-0010-0a9a-ec69262a...

Regards,

Anagha

Former Member
0 Kudos

Hi, kandha mugundhan!

Current key value stored in corresponding context attribute.

Try this way:


String key = wdContext.currentHeaderElement().getVH_BUnit();