cancel
Showing results for 
Search instead for 
Did you mean: 

Standard webdynrpo enhance

Former Member
0 Kudos

Dear webdynpro gurues:

     I'm currently implementing "Enterprise Compensation Management", the webdrynpro that controlls this is this one:

http://help.sap.com/erp2005_ehp_05/helpdata/en/ea/eb0926874d4d218f71ca7aaaa053bc/content.htm   it seems it is based on GAF.

    I would like to enhance this webdynpro so that a button is only allowed for some users (the approval button). Is there any way to enhance that webdyrpo to add custom code? Perhaps adding a controller which get triggered when the button is pressed so I can validate the user and send an error message... I know nothing about this so if anyone out there can give me a hand or confirm me it is possible (in a standard way) I would really appreciate it.

Thank you very much!

Federico.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

Refer this link:

http://scn.sap.com/message/14394490#14394490

In this requirement was to remove print and export button.

Let me know if this helps,else i will find exact method to be enhanced for you.

Former Member
0 Kudos

Thanks so much friends!

    Hitesh I think that with your answer in the other thread I'm very close to my solution. The method provided in the other thread does not get triggered, the screen I need to modify shows up previously and the WD is HRECM00_PLANNING_OVERVIEW. I'm enclosing the technical help of the button from the portal (the button is the "Approve"):

If you have the time and can provide some light on this I would really appreciate it

Thank you very much once again

Former Member
0 Kudos

Hi,

The Approve button is appearing from the below view:

The visiblity of this button is binded to attribute 'IS_APPROVE_VISIBLE' of node 'UI_SETTINGS'.

You can change the value of this attribute to hide the button according to your needs.

Former Member
0 Kudos

Hitesh you are the best man! Thanks so much for your great help! I'm trying to control this button so it is enabled for some users, so I need to add a simple logic to determine if the user has the access or not and then change the property. I tried to add this logic in the method PROCESS_BEFORE_OUTPUT of the componentcontroller; however I don't know very well how to modify there the property of the button... May be I'm using the wrong method. I know I'm asking too much but if you happen to have the time to throw me the last hint it would be great

Thank you once again!

Federico.

Former Member
0 Kudos

I would suggest to write a post exit in WDDDOINIT method of the view we found above.

If the button is not to be shown then populate attribute 'IS_APPROVE_VISIBLE' of node 'UI_SETTINGS' with '01'.

Let me know if this works.

Lukas_Weigelt
Active Contributor
0 Kudos

Hi Frederico,

Although Hitesh has already provided a suitable solution, I would want to throw in the possibility of directly accessing the Button programatically over the View-API. For example using a post exit of wddomodifyview:

(pseudo code, might have syntax errors)

DATA lo_el_approve_but TYPE REF TO cl_wd_toolbar_button.

lo_el_approve_but ?= view->get_element( ID = 'BTN_APPROVE').

IF lo_el_approve_but IS NOT INITIAL.

   lo_el_approve_but->set_enabled( EXPORTING VALUE = abap_false).

ENDIF.

Since you were explicitly talking about 'enabling', this might be helpful. Though, manipulation of the View-API with help of the context (see Hiteshs above post tweaking the context value to influence the bound visibility property) is always a 'cleaner' approach in my opinion.

Cheers, Lukas

Answers (2)

Answers (2)

Former Member
0 Kudos

Lukas / Hitesh:

   Your help has been invaluable. I was able to achieve my requirement with your help; I finally used Lukas method because it gets called every time the user creates an event in the webdynpro, so it allows me to verify if the user changed the compensation review and then recheck the authorization for it (WDDDOINIT is only called the first time).

Thank you once again fellas, I owe you both big time.

P.S: for the technical stuff about enhancing a webdynpro I used this document: http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/700317da-bd79-2c10-368e-8f18bf5d8... 

Lukas_Weigelt
Active Contributor
0 Kudos

Thanks for the positive feedback!

Former Member
0 Kudos

Hi Montanana,

If it is a Webdynpro component then you will have to create an enhancement which in turn adds a PRE and PRO exits in any view you are trying to enhance and you will be able to add relevant code as per your requirement.

Phani