cancel
Showing results for 
Search instead for 
Did you mean: 

Dynamic buttons in webdynpro

Former Member
0 Kudos

Dear Experts,

Can anyone help me in creating buttons dynamically in webdypro?.

The scenario is " i have one webdynpro screen.In that, at requestor level-the requestor screen should contain only SAVE,DELETE buttons & at approval level-the approver sceen should contain only APPROVE & REJECT buttons.

Please help with any example code/documents/links which helps me achieve this functionality.

Thanks

Katrice

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

In my scenario,I'm using Feeder class with IF_FPM_OVP component.How to achieve this button visibitity functionality in OVP using feeder class>?

Katrice

Former Member
0 Kudos

1. Define attributes MR_FPM of type ref to IF_FPM  and MR_CNR of type ref to IF_FPM_CNR_OVP in component controller.

2.  Get the reference to the IF_FPM interface in WDDOINIT of COMPONENTCONTROLLER

   wd_this->mr_fpm = cl_fpm_factory=>get_instance( ).

3. Now in the WDDOMODIFYVIEW of your view check  the user is of  requester level or approver level and based on the condition define the required buttons like :

wd_comp_controller->mr_cnr ?= wd_comp_controller->mr_fpm->get_service( if_fpm_constants=>gc_service_key-cnr_ovp ).

   CALL METHOD wd_comp_controller->mr_cnr->define_button

     EXPORTING

       iv_variant_id     = 'YOUR_VARIANT_ID'

*      iv_mainstep_id    = 'YOUR_MAIN_STEP_ID'

**      iv_subvariant_id  = ''

**      iv_substep_id     = ''

       iv_function       = if_fpm_constants=>gc_button-other_function

       iv_element_id     = 'SAVE'

*      iv_sequence_id    = '0'

       iv_design         = '01'

       iv_enabled        = 'X'

**      iv_explanation    = ''

*      iv_on_action      = 'FPM_NEXT_STEP'

       iv_text           = 'YOUR BUTTON TEXT'

*      iv_tooltip        = ''

*      iv_visibility     = ''

*      iv_default_button = ''

*      iv_hotkey         = ''

       .

Answers (4)

Answers (4)

Former Member
0 Kudos

Issue resolved.

Special thanks to Upendra Agrawal and Aravind Aravi for their valuable replies.

P.S : points rewarded.

Katrice

Former Member
0 Kudos

How to achieve this same functionality using feeder class?

Katrice

m_aravindan
Active Participant
0 Kudos

Hi Katrice,

         See this example from sap technical.com..  how to create a Feeder class  and UI elements in it ..  hope it helps you..

http://www.saptechnical.com/Tutorials/WebDynproABAP/GUIBB/Feeder.htm

Regards

Aravindan

Former Member
0 Kudos

If you are having the same view (screen) for requester and approver then you may create all the buttons ( SAVE,DELETE, APPROVE & REJECT ) in your view and based on the condition whether requester level or approver level you can hide the ones which you do not require.

Check :

http://wiki.sdn.sap.com/wiki/display/WDABAP/Simple+application+to+change+properties+of+UI+Elements+d...

http://scn.sap.com/thread/1656054

m_aravindan
Active Participant
0 Kudos

Hi Katrice,

                 Below are some links , which helps you to learn creation of UI elements dynamically in webdynpro..

http://wiki.sdn.sap.com/wiki/display/WDABAP/Creating+UI+Elements+Dynamically+in+Abap+Webdynpro+Appli...

the below one is an example for hiding and enabling ui elements ..

http://webdynproabap.wordpress.com/2012/10/08/dynamic-ui-element/

Hope it helps you..

Regards

Aravindan