cancel
Showing results for 
Search instead for 
Did you mean: 

Make Visible FPM Toolbar Button(Add->'Other bank') on Bank Data Delete

0 Kudos

Hi Experts,

I have implemented the requirement to restrict a user's other bank data to 2.

I have used the feeder class (CL_HRESS_PER_OVERVIEW) IF_FPM_GUIBB_LIST~GET_DATA method to implement the same.

But When I delete the bank data the get data method is not getting called.

I read that the visibility of FPM toolbar in ESS can only controlled by that method.

So during delete how can I make it visible.

The method is called on toggle the toolbar tray. If it is not possible to make visible the FPM Toolbar is it possible to toggle the tray by code.

Please help me I am stuck on this for almost a month.

Regards,

Porselvan

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi porselvan,

If get data method is not getting called. Then you can make the use of model controller class by implementing the interface IF_FPM_OVP_CONF_EXIT. you need to implement the method OVERRIDE_EVENT_OVP.

From this method you can handle the visibility of FPM toolbar and you can handle the toggle toolbar as well. By the use of ovp instance  io_ovp you can play around the fpm application.

I hope your problem will be solved.

Thanks & Regards

Praveen Gupta

0 Kudos

Hi Praveen,

Thanks for your response.

Now I have found that the get data method is getting called and the toolbar visibility attribute also set but still the I am not able to see the change.

Is it because the page needs a refresh kind of something to make the visibility happen.

Please let me know.

Thanx in Advance.

-Porselvan

Former Member
0 Kudos

Hi porselvan,

I think you have to set EV_DATA_CHANGED = abap_true. then only you will be able to see the toolbar visibility changes.

Thanks & Regards

Praveen Gupta

0 Kudos

Hi Praveen,

Thank you for your response.

I have done that but still my changes aren't reflecting.

Please let me know how I can proceed on this.

As per you suggestion I have added that. This is my code.

  DATA: lv_pernr TYPE pernr_d,

          ls_action_usage LIKE LINE OF ct_action_usage.

    TRY.

      lv_pernr = cl_hress_employee_services=>get_instance( )->get_pernr( ).

    CATCH cx_hress.                                   "#EC NO_HANDLER

    ENDTRY.

    IF lv_pernr IS NOT INITIAL.

      IF MV_INFTY EQ 0009 AND MV_SUBTY EQ 1.

         DATA BANK_COUNT TYPE I.

         SELECT COUNT( * ) INTO BANK_COUNT FROM PA0009 WHERE PERNR = LV_PERNR AND SUBTY = '1' AND ENDDA GE SY-DATUM.

         IF BANK_COUNT GE 2.

           IF CT_ACTION_USAGE IS NOT INITIAL.

             LOOP AT CT_ACTION_USAGE INTO LS_ACTION_USAGE.

               IF ls_action_usage-TEXT EQ 'Other bank'.

                 ls_action_usage-visible = cl_wd_uielement=>e_visible-none.

                 MODIFY CT_ACTION_USAGE FROM LS_ACTION_USAGE.

                 EV_DATA_CHANGED = abap_true.

              ENDIF.

             ENDLOOP.

           ENDIF.

         ELSE.

           IF CT_ACTION_USAGE IS NOT INITIAL.

             LOOP AT CT_ACTION_USAGE INTO LS_ACTION_USAGE.

               IF ls_action_usage-TEXT EQ 'Other bank'.

                 ls_action_usage-visible = cl_wd_uielement=>e_visible-VISIBLE.

                 MODIFY CT_ACTION_USAGE FROM LS_ACTION_USAGE.

                 EV_DATA_CHANGED = abap_true.

              ENDIF.

             ENDLOOP.

           ENDIF.

         ENDIF.

      ENDIF.

    ENDIF.

Please let me know what I am missing here.

-Porselvan

Former Member
0 Kudos

Hi Porselvan,

Your code seems to be right. Check ENABLED parameter in LS_ACTION_USAGE structure..

Otherwise no error in this code. After modifying CT_ACTION_USAGE table , check action modified or not. In debugging you need to find when actually it's clearing your visible option.

Thanks & Regards

Praveen Gupta

0 Kudos

Hi Praveen,

Thanks for your response. Still it is not working.

CT_ACTION_USAGE gets modified and the enable also is 'X'.

Please help me with this.

-Porselvan

Former Member
0 Kudos

Hi Porselvan,

Can you check u place 'ABAP_TRUE' instead of 'X'. Sometime it works . Second thing r u using any exit class for the FPM model controller. Might be there ct_action_usage refilled with initial action.

Third thing when you exit the get_data method at that time put the break point and see the value of your action in CT_ACTION_TABLE table is actually that what you have set in your code.

Surely this will help you...

Thanks & Regards

Praveen Gupta

0 Kudos

Hi Praveen,

You are perfect.

At the end it gets reloaded with intial data.

Please help me.

I am not sure about the exit class of FPM model controller.

How do I find that. What is the solution for this.

Please help me on this.

-Porselvan

0 Kudos

Hi Praveen/All,

Please help on this. How can I proceed on this.

Regards,

Porselvan

Former Member
0 Kudos

Hi porselvan,

step by step guide for model controller in FPM.

1.

An application WD component or an ABAP class that should act as an application

controller can implement the interface IF_FPM_OVP_CONF_EXIT. Its method

OVERRIDE_EVENT_OVP passes a reference to the OVP interface of IF_FPM_OVP to the

application which provides full runtime access to the OVP floorplan, including the

page composition and layout. The interface IF_FPM_OVP provides the following methods:

2. implement the OVERRIDE_EVENT_OVP method and place below coding

   as per your button element id.

io_ovp->get_toolbar_button(
   EXPORTING iv_toolbar_element_id =  <BUTTON_ID>

             iv_content_area       = <PAGE_ID>

   IMPORTING es_toolbar_button     = ls_button     ).

CALL METHOD io_ovp->change_toolbar_button

              EXPORTING

                iv_content_area       = iv_content_area_id
              IMPORTING

                is_toolbar_button     = ls_button.

In ls_toolbar_button you change the visibility of the button.

3.Configuration Guide.

Give model controller class in the red marked area.

This will solve your problem.

Thanks & Regards

Praveen Gupta

0 Kudos

Hi Praveen,

Really happy to get your inputs.

Your comments are helpful as always.

I have got my controller component and only thing is I am not able to identify the toolbar button Id.

In IO_OVP->MT_TOOLBAR there is no id with Add or Other bank.

Either there is SAVE or SAVE_AND_BACK_TO_MAIN or BACK_TO_MAIN.

How to I identify my toolbar button Id.

Is it possible through debugging.

Thanks & Regads,

Porselvan.

Former Member
0 Kudos

Hi Porselvan,

you need not to worry about MT_TOOLBAR . you just follow above posted step by step guide and you need to give element_id which you have given at the time of configuration.othewise go to the configuration ans see in the attribute details of the button you will find every thing like element id , action assigned, visibility , enable.

Call the change toolbar button method and make sure you are passing the coreect value to necessary parameters.

Thanks & Regards

PraveenGupta

0 Kudos

Hi Praveen,

Sorry to disturb you again.

I am really finding trouble in identifying the right value to change_toolbar_button method.

How do I get them.

My component configuration does not have something like below. I am not able to identify the fpm toolbar id for this button.

PFB the page

From Configuration too, I am unable to find fpm toolbar id. I found one thing about this button is the these are feeder defined events. PFB the snapshot for the same.

Please help me with this on how I can proceed.

Expecting your kind support as always.

-Porselvan

0 Kudos

Hi Praveen/All,

Please let me know if I can try this method or I need to try some other approach.

Kindly let me know how I can proceed.

Please.

-Porselvan

Former Member
0 Kudos

Hi Porselvan,

First of all you have told us wrong requirement.

The button which you are trying to hide it...it is a toolbar button choice and instead of using change_toolbar_button you have to use CHANGE_TOOLBAR_BUTTON_CHOICE.

Surely it will work..

Thanks

Praveen Gupta

0 Kudos

Hi Praveen,

Really sorry for the misinformation given.

I am really not able any specific FPM Toolbar ID.

Please help me in finding the right values to pass to the method.

(See the above configuration snapshot for reference).

I tried toolbar id as '_crea_1_' and uibb key as '_CFG_UIBB_7' which I found after debugging.

Sorry I am really new to ABAP and FPM and hence the confusion.

-Porselvan

Former Member
0 Kudos

Hi Porselvam ,

I am totally confused with your scenario.

Please describe your problem in details what you want to achieve in that toolbar buton visibility.

Then probably i can help you out...

Thanks & Regards

Praveen Gupta

0 Kudos

Hi Praveen,

My actual requirement is to restrict the number of other bank entries a user can enter to 2.

Technically after adding second bank the 'Add'->'Other Bank' Button should be hidden.

After deleting the same should be displayed.

Using the code in the IF_FPM_GUIBB_LIST~GET_DATA method of feeder class CL_HRESS_PER_OVERVIEW.  I achieved the hiding of the button when the user adds a bank record.

But when I delete the bank data 'Add'->'Other Bank' button does not appear back.

The code works but on screen it appears only if I reopen the page or only if I toggle the Bank Information tray.

Really sorry for the confusion caused.

-Porselvan

Former Member
0 Kudos

Hi Porselvan,

Normal button you can hide & show but you can't do show / hide with the button choice event , only you can enable/disable the button event in button choice on diffrent condition as you said in above post. This enable & disable functionality you can achieved through the IF_FPM_GUIBB_LIST~GET_DATA and ct_action_usage parameter.

Don't forget ev_action_usage_changed parameter = abap_true.

Try this surely it should work...

Thanks & regards

Praveen Gupta

ssharma28
Participant
0 Kudos

Hi Porselvan,

I have a similar requirement. could you achieve this.

did you enhance the standard method of feeder class to place your code?

could you solve the problem of getting add button again after deleting bank.

Thanks,

Seema

0 Kudos

Hi Seema,

Yes. I enhanced the method IF_FPM_GUIBB_LIST~GET_DATA of class CL_HRESS_PER_OVERVIEW.

You can check the code above in this thread for reference.

You can also refer to this thread.

Regards,

Porselvan

Answers (0)