In this blog I will explain how to create new variant for PO FPM component configuration. Also, will show you how to call this new variant based on custom logic. This can be used, if we need to display different buttons/tabs in PO screen when accessed from different places.
- Go to SE80, go to component FPM_OIF_COMPONENT and expand component configuration node and select configuration ZENH_SAPSRM_WDCC_PO_PURCH ( In my case I already had created a custom variant with delegation to standard configutaion)
2. Click on ‘Start Configurator’. This will open up configuration screen in a browser
3. Click on ‘Change’ button. You will see a pop-up asking for transport request. Select the existing request or create a new one.
4. Click on ‘Copy’ button and select ‘Variant’
5. A new pop-up window asking for new variant name will appear on the screen
6. Click on ‘Copy’.
7. All mainview and subview IDs have ‘_1’ appended at the end
Subview ‘Notes and Attachments’
8. In general we don’t have to change these IDs, but in case of PO, we faced an issue with PO item details button. Below error appears when we click on ‘Details’ button at item level.
Because of this reason, we had to change the mainview ID from PO_ITM_1 to PO_ITM
9. To hide a button from the screen, select the button and choose ‘Is not visible’ option from ‘Visibility’ dropdown.
10. Finally click on ‘Save’.
How to call the new variant from ABAP code:
Create an implicit enhancement in method OVERRIDE_EVENT_START of class /SAPSRM/CL_FPM_OVRIDE_HDLR and use below code to set the variant
mo_fpm->mo_app_parameter->set_value( EXPORTING iv_key = ‘SAPSRM_VARIANT_ID’
iv_value = ‘VARIANT_1’ ).
Thanks for taking time and reading the blog.