cancel
Showing results for 
Search instead for 
Did you mean: 

Custom UI element to bind to existing context?

Former Member
0 Kudos

Hi,

I'm doing ESS customisation for one of the screens(Addresses) to add a UI element. Here is what I need to do, on the addresses screen layout I have few communication subtypes something like below

com01 num01

com02 num02

com03 num03

Where com01, com02, com03 are three different items available as dropdown UI element and corresponding num01, num02 and num03 as inputfields UI element. This com01,02,03 are totally 3 dropdowns with corresponding num01,02,03 inputfields. These subtypes are all put under one transparent container and currently not visible on the portal. We can make it visible, but the requirement is different for me and we want users to see only one dropdown UI element and bind it to proper subtype as follows.

I have to create a custom dropdown UI element which will have predefined list of items. Now I have to make this custom UI dropdown element visible on the portal at particular location on the screen and the item selected from this dropdown should get updated on the num02 of com02 in the backend.

NOTE: The custom UI dropdown element predefined values would come from local dictionary, simple type enum object. All the subtypes are available under existing ESS addresses context

Now under implementation coding of the addresses screen, under what method or event should I write coding when user selects item from custom UI dropdown element I should assign the selected item of custom UI element to num02 context. I know what value should go into com02 value so I need to hard code that value to com02. Basically like key,value binding here com02 is key and value is num02.

Please let me know where(e.g. wdDoModifyView method or onActionDummy method of UI onselect action) and how I can bind this custom UI element selected value to existing context attribute num02?

Once this is done at the coding level, the context will have the selected values then this addresses screen is a roadmap, so the next step is review where I can just display the num02 value.

Please let me know if anything is not clear above.

Thanks

Praveen

Accepted Solutions (0)

Answers (5)

Answers (5)

Former Member
0 Kudos

Are you sure there is relation between making a subtype visible and subtypes getting saved to the backend?

if you are not able to see the save button in your view it must be in some other view and both the view must be integrated in a single view using FPM..

Former Member
0 Kudos

Hi, we ended up finding out configuration missing at

SAP Field control table: V_T588MFPROPS

We were using Sweden Addresses screen, and at the employee level it was still pointing to different country(NZ in my case). By default com02,03,04 are disabled in the config above table. Once we enabled it everything started working. Now I can easily bind to any new UI element to the com fileds.

Thanks everyone for their help.

Praveen

Former Member
0 Kudos

hi,

As you said "These subtypes are all put under one transparent container and currently not visible on the portal".

probable because of this funtionality..there is no save method written for those fields

Former Member
0 Kudos

Yes those subtypes are under one seperate transparent container but I made it visible, but still there are not getting saved to the backend. As you are saying probably there is no save method written, is this something I can enable or write to make these fields updated in the backend?

Or is it in the Badi that we need to check from ABAPers.

Is there anyway I can check the values getting passed to R3 just before hitting SAVE button, I mean where is this SAVE button I cannot see it in the view layout of addresses DC? May be I can put some system.out.println at this point to check if it's passing all the input field values to the R3.

Thanks

Praveen

Edited by: Praveen11 on Jul 23, 2009 7:38 AM

Former Member
0 Kudos

on the onselect method retrieve the value on the context

wdcontext.nodename.nodeelement.getAttribute()

and set it on second context

Why do you want to change the binding of the same UI element..to show different value in the same dropdown or to show the selected value of dropdown is other UI element

Former Member
0 Kudos

you will have to bind the UI element to context attribute

Former Member
0 Kudos

Aishwarya, the custom UI dropdown is currently bound to local dicationary simple type enum object to populate the list of predefined items on the selectedKey property, I don't know how else we can bind it using properties without writing code on the onSelect event.

I think we need to write code in the onSelect or someother action method to manually bind this selected value to the context num02.

Thanks

Praveen

Former Member
0 Kudos

Hi,

in the method onSelect of the UI element.

Regards,

Satya.

Former Member
0 Kudos

Satya, thanks for quick response. Ok I can now write the code on the onSelect of the dropdown.

Would you be able to give me sample code of how I can bind this selected item of dropdown element to the context attribute? Appreciate your help.

Thanks

Praveen

Former Member
0 Kudos

HI,

create a context attribute1,

bind the attribute1 type to dictionary type.

, bind the selected key property of the drop down to the context atrribute1.

create anoter context attribute2.

on the onselect method,

get the current value of attribute 1 and set it to attribute2.

Regards,

Satya.

Edited by: Satya on Jul 21, 2009 2:02 PM

Former Member
0 Kudos

I'm trying out exactly what you all were saying.

Can I also do as mentioned below to set the dropdown selected value to context attribute of num02.

this.wdContext.currentSelectedInfoTypeElement().setNum02(""); // here I set the value selected by custom UI element

Where SelectedInfoType is the model attribute and num02 is the model attribute where I want to bind to.

Thanks

Praveen

Former Member
0 Kudos

hi,

'selectedinfotype' is a model attribute? or a model node? or

do you mean , the 'selected info type' and 'num02' are under a model node ?

if the selectedinfotype''model attribute's type is bound to any simple type, yes you can do that way.

Regards,

Satya.

Edited by: Satya on Jul 21, 2009 2:22 PM

Former Member
0 Kudos

Let me try and I shall come back to you.

Thanks

Praveen

Former Member
0 Kudos

Hi, it worked successfully when I added the code onSelect method as described on my post above. Thanks for that.

However, the interesting thing is as I said there are 3 subtypes com01, com02 and com03 with their corresponding value fields as num01, num02 and num03.

If I enter values in the R3 for above 3 fields, I can see them in the frontend portal under edit mode. But if I update these 3 fields on the frontend then only the first subtype i.e. com01 and num01 are updated not the other two. The other two which is com02,com03 and their num02 and num03 are updated empty(lost their values).

The portal is reading correctly from R3 and displaying but not updating the backend correcly for 2 subtypes, why would this happen? No errors are reported during save.

Since this is a ESS BP all fields and mappings are standard so shouldn't it work out of the box correctly? Is there anything I can check or change to make those 2 subtypes updated?

Thanks

Praveen

Former Member
0 Kudos

HI,

when you save the changes, there will be some functionality in r/3( BAPI)n which will update them in r/3.

may be the logic there is only to update one sub type?

may be ABAPers can give some inputs on this?

Regards,

Satya.