cancel
Showing results for 
Search instead for 
Did you mean: 

FPM_OIF_COMPONENT - Release button Read Only on conditions

Former Member
0 Kudos

Hi all,

I'm working in a Procurement Document that has buttons from FPM_OIF_COMPONENT, I need to set the attribute ENABLE = space or ENABLE = 'X'.

I noticed that I can change it in debugger in COMPONENTCONTROLLER->WDDOPOSTPROCESSING->render_buttons( ).

but in RENDER_BUTTONS( ) how do I know I'm coming from a particular procurement document?

Any idea how I can meet my requirement? I tried the post-exit in the WDDOPOSTPROCESSING and I change get a table from my context node update the table but then how I can bind my change to the context?

thanks!

Jason PV

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

If you want to set the button in OIF CNR area to be enabled or disable then you can try the following code

DATA lo_cnr_oif TYPE REF TO if_fpm_cnr_oif.

  • FPM Reference

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

*get instance of OIF CNR

lo_cnr_oif ?= wd_this->mr_fpm->get_service( cl_fpm_service_manager=>gc_key_cnr_oif ).

CALL METHOD lo_cnr_oif->get_buttons

IMPORTING

et_buttons = lt_buttons[].

READ TABLE lt_buttons[] INTO ls_button WITH KEY element_id = 'BTN_EDIT'.

IF sy-subrc = 0.

CALL METHOD lo_cnr_oif->define_button

EXPORTING

iv_function = ls_button-function

iv_element_id = ls_button-element_id

iv_enabled = ' '. " space = disabled

ENDIF.

You can write this code in Process_before_output or in process_event method present in component controller which uses FPM.

Hope this helps

Manas Dua

Answers (1)

Answers (1)

ChrisPaine
Active Contributor
0 Kudos

Jason,

you need to update/enhance the embedded FPM component - not the framework component.

Have a read of the [FLOORPLAN MANAGER FOR ABAP - DEVELOPER'S GUIDE|http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/90f3cfd2-46d0-2b10-b3ab-eabf3452cc50] to start to understand how the FPM works.

If you can tell us the application that you are trying to enhance we can probably help you find the component that you need to work with. (Although you may be able to figure this out yourself if you read the guide linked above.

Hope this helps,

Chris

Former Member
0 Kudos

Chris, thank you for getting on this.

I'm currently working the problem right now. I haven't read your link but I will in a bit.

I'm working for component /SAPSRM/WDC_CTR_DOFC_OV_H and when I open this webdynpro FPM_OIF_COMPONENT gets triggered.

I know that when we pressed a button it will run BUTTON_PRESSED method in the CNR_VIEW of FPM_OIF_COMPONENT.

is this info helpful to describe my problem to you?

thanks!

Jason PV

ChrisPaine
Active Contributor
0 Kudos

Jason,

sorry - I don't have SRM installed on the machine I'm working on - are you sure that is the component or the application?

Do a search on your system - there should be an application configuration for the application - if you launch the configuration editor for the app config you should be able to see the OIF configuration (another configuration) drill into this and you should be able to see the components that are embedded within the framework - it is one of these components that you'll need to enhance, not the FPM framework component. (the FPM framework will be completely oblivious of any of the data in the components that it displays).

It is worth reading that doc if you're going to be enhancing an FPM application!

Good luck,

Chris

Former Member
0 Kudos

ok, I just saw the configuration id; it opened a component configuration and I see all the buttons available.

How I can configured here conditions for the button to be enable or not enable depending in some validations?

Thanks!

Jason PV

ChrisPaine
Active Contributor
0 Kudos

Hi Jason,

Not in the configuration directly

but you may find that there is a component assigned to the configuration which implements an interface that does allow you to control the buttons dynamically: Click on display global settings - you'll see a web dynpro component - eg in the configuration of FPM_DEMO_OIF_ADMIN_ADVANCED_OIF the assigned component is FPM_OIF_ADMIN_CONF_EXIT. In that component you'll see some interfaces that have been implemented that potentially allow you to manipulate the buttons.

I really strongly suggest you read that guide

Cheers,

Chris