on 01-18-2013 12:28 PM
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
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
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
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
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
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
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.
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
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
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
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
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
User | Count |
---|---|
85 | |
10 | |
10 | |
9 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.