cancel
Showing results for 
Search instead for 
Did you mean: 

Enhancing UI elements not possible

Former Member
0 Kudos

Dear Friends,

I'm doing some enhancements with this WD

FITV_POWL_TRIP_DETAIL

I want to enhance the view V_DETAIL.

And all goes well when I'm enhancing its methods.

But if I try to enhance its UI elements, then things become ugly.

As soon as I press the enhance button, all the properties for the UI element I want to change become greyed out.

Thus I can't enhance that particular UI element.

In my particular example I want to enhance a UI Label and make it invisible.

The property I want to enhance is the "visible", I want to change its binding from

V_DETAIL.LINE_DETAILS.TRAVEL_PLAN to a context attribute I have created.

This happens with other UI elements on that same View.

Questions:

- is this normal to happen ?

- with enhancing framework can I add, delete and modifuy UI elements to my view ? or is it just add, delete and no modify ??

- do I have to configure anything special for the enhancement framework work with views on WD ?

What puzles me the most, is that I have access to another system (sandbox) where I tried to do this same enhancement.

And it works !

So I really don't understand why on my development system I can't do this particular enhancement to my UI element.

Any clues ??

Kind Regards

/Ricardo Quintas

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi Lukas,

Thank you for your reply.

I don't understand neither.

The system I'm using, where this enhance works, has these settings:

================================

IDES SAP System

EHP4 FOR SAP ERP 6.0 / NW7.01

SAP_ABA 701 0003 SAPKA70103 Cross-Application Component

SAP_BASIS 701 0003 SAPKB70103 SAP Basis Component

PI_BASIS 701 0003 SAPK-70103INPIBASIS Basis Plug-In

ST-PI 2008_1_700 0000 - SAP Solution Tools Plug-In

SAP_BS_FND 701 0002 SAPK-70102INSAPBSFND SAP Business Suite Foundation

SAP_BW 701 0003 SAPKW70103 SAP Business Warehouse

SAP_AP 700 0015 SAPKNA7015 SAP Application Platform

WEBCUIF 700 0002 SAPK-70002INWEBCUIF SAP WEBCUIF 700

...

================================

I know that you can use WDDOMODIFYVIEW and that was what I was planning to use as well.

(thanks for the code nevertheless)

But I just wanted to confirm if is it possible to enhance UI elements and modify the properties ?

And why does it work on a system but not on another ?

Still no clear answer on this thread.

I will waif for SAP answer to my message on this one,

but will move onwards wit my change (using code of course).

Kind Regards

/Ricardo Quintas

Lukas_Weigelt
Active Contributor
0 Kudos

But I just wanted to confirm if is it possible to enhance UI elements and modify the properties ?

No. Not in the Layout editor directly, there you can only delete standard UI-elements, redo their deletion and add custom UI-elements. But you definitely cannot alter UI-Element's properties in the Layout Editor in Enhancement mode.

Cheers, Lukas

Former Member
0 Kudos

Hi ,

As I think instead of enhancing the view itself , you should have to make a Z configuration for this application by using SPRO reference IMG to make changes in WD ABAP User Interface .

In this Z configuration , you can easily make the UI related changes . This is better way to achieve same .

Hope this help .

Regards,

Dinesh

Former Member
0 Kudos

Dear Dinesh

Thank you so much for your answer, nevertheless that is not a viable alternative to us.

The truth of the mater is that enhancing a UI like I'm willing to it is possible - as I said, I did just that on a different system.

What I don't understand is why this is possible in one system but not on a another ?

Any clues?

Kind Regards

Former Member
0 Kudos

Hi Ricardo,

No i did not meant that.

My proposition was clear : To do what you want, you have to :

In Enhancement mode :

1 - Delete your UI Element (that you want make changes on it).

2 - Create an other UI Element with same properties of standard one. On this UI element, make the right binding you want.

Because enhancement does not allow you to change UI Element's properties !

For the system you are allowed to make changes : I am not sure you can have changes you want even you are allowed to make changes into properties, i think it's a standard bog.

Did you try to activate the component, and run the application to see if you get what you want ?

Hope i've clarify my idea

Best regards.

Former Member
0 Kudos

Dear Jcrios,

again thank you so much for you reply.

Yes I did activate the change.

And yes it works.

So, I conclude that it is possible.

We have a note already written to SAP, because we really don't understand why it works

on one system, but not on another.

Here's what I did

[http://imageshack.us/photo/my-images/822/20110923101609.jpg/]

Here you can see the standard WD FITV_POWL_TRIP_DETAIL being enhanced.

I've added a new node+attribute to view V_DETAIL

[http://imageshack.us/photo/my-images/839/20110923101927.jpg/]

Here I'm binding the property created above to a label.

This was done using enhancement.

(on the system that this is not working - all the "properties" would be greyed out and I couldn't move onwards with this setting)

[http://imageshack.us/photo/my-images/88/20110923102842.jpg/]

Finally the end result.

As you can see the WD compiles and runs without errors.

The label is no longer visible - as pretended.

It seems, at least with this SAP system, that enhancement does allow you to change UI Element's properties.

Any clues ?

Is this a bug ?

A setting somewhere ?

Something new due to a different version (both systems I'm using are not same version) ?

Kind Regards

/Ricardo Quintas

Lukas_Weigelt
Active Contributor
0 Kudos

Hi,

In my opinion it's a bug that you are able to change the UI-properties in the Layout at all in enhancement.... This isn't supposed to be possible (at least up to EHP4, beyond, I don't know).

If you want to make alterations to the Layout, you can do so in runtime without limits.

Hook method WDDOMODIFYVIEW supplies you with the Object reference "VIEW". Which you can then, for example, bind to a global attribute of IF_WD_VIEW. This will allow you to grab the View-Reference at any point in the Webdynpro and you can use the respective Classes (respectively for the UI-Element you want to alter) to make changes.

Example:

Global reference of View:

method WDDOMODIFYVIEW .

* Datenmodell

  CONSTANTS lv_c_visibility TYPE WDUI_VISIBILITY VALUE '01'.

* Mainview-Referenz in globales Attribut schreiben

  IF first_time = abap_true.
    wd_comp_controller->z_go_view = view.
  ENDIF
endmethod.

Altering UI-Elements in Custom Method:

method Z_CHANGE_BUTTON_LABEL1 .

* WD4A_Framework

 DATA: lo_nd_ui_elemente  TYPE REF TO   if_wd_context_node,
       lo_el_ui_elemente  TYPE REF TO   if_wd_context_element,
       lo_el_ui_root      TYPE REF TO cl_wd_uielement_container,
       lo_el_trans_cont1  TYPE REF TO cl_wd_uielement_container,
       lo_el_button1     TYPE REF TO cl_wd_button.

* Datenmodell

 CONSTANTS lv_c_butt_show TYPE string VALUE 'Details anzeigen'.
 CONSTANTS lv_c_butt_hide TYPE string VALUE 'Details verbergen'.

 Data: lv_visibility TYPE WDUI_VISIBILITY. " 01 = none, 02 = visible
 Data: lv_button_text TYPE string. " Text ausgelesen aus Button

* Casting auf Button und Text auslesen

 lo_el_ui_root ?= wd_comp_controller->z_go_view->get_element( 'ROOTUIELEMENTCONTAINER' ).
 lo_el_trans_cont1 ?= lo_el_ui_root->get_child( ID = 'CONTAINER_LEHR_AND_VERWDEP' ).
 lo_el_button1 ?= lo_el_trans_cont1->get_child( ID = 'BUTTON_DETAILS_1' ).
 lo_el_button1->get_text( RECEIVING value = lv_button_text ).

* Button Text verändern

 IF lv_button_text = lv_c_butt_show.
   lo_el_button1->set_text( value = lv_c_butt_hide ).
 ELSEIF lv_button_text = lv_c_butt_hide.
   lo_el_button1->set_text( value = lv_c_butt_show ).
 ELSE.
 ENDIF.

endmethod.

Since you can see how to do UI-Element alterations in general you can i.e. make implicit enhancements in any standard method and call your custom-code there.

Hope this helps you.

P.S. Just curious, what system are you on where you can enhance the UI-Elements via Layout directly?

Cheers, Lukas

Former Member
0 Kudos

Hi Ricardo,

You can not change UI Elements attributes by enhancement.

That what you can do with enhancement [Help SAP|http://help.sap.com/saphelp_nw04s/helpdata/en/c5/f4b9422e0fb911e10000000a1550b0/frameset.htm]

My propsition : You delete the UI element you want, and try to create an other with the same properties that it mades for the stadandard UI element, of caurse you will change the binding attribut as you want.

For the other system you speak above, i think you can change the standard attributes but you will not have changes when you activate your component, make a test and you will see. It's a standard bog.

The only thing you can do is to delete the UI Element by enhancement.

Hope this help

Best regards

Jalal

Former Member
0 Kudos

Hi Jcrios

thank you for your reply.

So if I understood you correctly there's a system setting that enables that on and off.

Do you have more info of what is that setting, please ?

Where/how can I access it and do some tests myself ?

Kind Regards

/Ricardo Quintas