on 10-30-2015 10:29 AM
Hi guru,
i would ask for you a help.
I'm new on FPM and i apologise for my question.
I want to show/hide and or Enable /Disable an entire UIBB form depending on role of user who logged on.
Could anyone explain me all steps?
Must i replace the feeder class of UIBB form with a custom one inherited from standard?
In few words, could you explain me step by step the procedure to solve this issue?
Thank you in advance
Fabio
Hello Fabio,
See the five steps below....
1. Create a global class that is to be used as your application controller.
2. In this class, implement the interface IF_FPM_OV_CONF_EXIT.
3. In the interface method, IF_FPM_OVP_CONF_EXIT~OVERIDE_EVENT_OVP, add code similar to the following:
DATA: lo_event TYPE REF TO cl_fpm_event,
lv_role TYPE string.
* Get current event ----------------------------------------------
lo_event = io_ovp->get_event( ).
* Get user role ---------------------------------------------------
lv_role = << logic to get the user's role goes here>>>
* Determine action based on event id ---------------------
TRY.
CASE lo_event->mv_event_id.
WHEN cl_fpm_event=>gc_event_leave_initial_screen.
me->maintain_uibb( EXPORTING io_ovp = io_ovp
iv_role = lv_role ).
WHEN OTHERS.
......
ENDCASE.
CATCH cx_fpm_floorplan.......
ENDTRY.
4. New custom method MAINTAIN_UIBB:
DATA: lt_uibb TYPE if_fpm_ovp=>ty_t_uibb,
lv_hidden(1) TYPE c.
* Set variable based on user role
IF iv_role = <<< your value goes here >>>.
lv_hidden = abap_true.
ELSE.
lv_hidden = abap_false.
ENDIF.
* Get UIBBS -------------------------------
io_ovp->get_uibbs( IMPORTING it_guibb = lt_guibb )
* Set attribute
READ TABLE lt_uibb ASSIGNING <uibb> WITH KEY <<your value goes here>>.
IF sy-subrc IS INITIAL.
<uibb>-hidden = lv_hidden.
io_ovp->change_uibb( is_uibb = <uibb> ).
ENDIF.
endmethod.
5. Add Application Controller in configuration.
That's it.
Best regards,
Kim Carmack
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Pierfabio,
For hiding UIBB you need to do below steps:
Below is demo code to achieve :
mo_ovp typr ref to IF_FPM_OVP.
CHECK mo_ovp IS BOUND.
TRY .
mo_ovp->get_uibbs(
EXPORTING
iv_content_area = <your content area name / Page name here>
iv_section = <your section id>
IMPORTING
et_uibb = lt_uibbs "here you will get all the settings for that UIBB
).
CATCH cx_fpm_floorplan. " Floorplan exceptions
RETURN.
ENDTRY.
In lt_uibb you will get settings of all the controls available you need to put read on this
table and find out uibb of your interest based on config_id etc.
Read table lt_uibb into ls_uibb with key config_id = <your config iD of UIBB>.
you should get only one record in this , once you get this Information then set HIDDEN
property of this UIBB
ls_uibb-hidden = 'T'. " T is for hidden type FPM_HIDDEN type.
Once you set this property you again need to update your UIBB as below
DATA : lo_ovp TYPE REF TO cl_fpm_ovp.
CALL METHOD lo_ovp->change_uibb
EXPORTING
is_uibb = ls_uibb
iv_section = <your section name>.
Your UIBB will be hidden.
Thanks-
Abhishek
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
93 | |
11 | |
10 | |
9 | |
9 | |
7 | |
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.