Skip to Content

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.

  1. 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)

/wp-content/uploads/2013/03/img1_193408.jpg

2. Click on ‘Start Configurator’. This will open up configuration screen in a browser

/wp-content/uploads/2013/03/2_193424.png

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’

/wp-content/uploads/2013/03/4_193426.png

5. A new pop-up window asking for new variant name will appear on the screen

/wp-content/uploads/2013/03/5_193427.png

6. Click on ‘Copy’.

7. All mainview and subview IDs have ‘_1’ appended at the end

Mainview ‘Header’

/wp-content/uploads/2013/03/6_193428.png

Subview ‘Notes and Attachments’

/wp-content/uploads/2013/03/7_193429.png

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.

/wp-content/uploads/2013/03/8_193431.png

Because of this reason, we had to change the mainview ID from PO_ITM_1 to PO_ITM

/wp-content/uploads/2013/03/9_193430.png

9. To hide a button from the screen, select the button and choose ‘Is not visible’ option from ‘Visibility’ dropdown.

/wp-content/uploads/2013/03/10_193432.png

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.

To report this post you need to login first.

6 Comments

You must be Logged on to comment or reply to a post.

  1. Agustin Puerma

    Good job Sankara,

    I’m facing a problem. I cannot copy the variant, do you know what could be the reason?

    Regards and thanks for your blogs,

    Agustín.

    (0) 
      1. Agustin Puerma

        This option is disabled in my text editor so will try to be more accurate.

        After create an enhancement to the standard component configurator, when I open it (the Z component) in change mode, I cannot see the option of copy a variant. What I can do is to Add, Detele or Change (only 3 buttons).

        Moreover I have noticed that the option “Initial Screen” is disabled.

        We are on SAP_BASIS 701

        (0) 
  2. Devraj Singh

    Dear Sankara,

    Just wondering, We can also achieve this by Creating a new Application Configuration & Corresponded Component Config.

    Regards

    Devraj

    (0) 
    1. sankara rao bhatta Post author

      Hi Devraj,

      Yes you can.. The background for this blog was to display screen differently using same application configuration. Application configurations are linked to roles in SRM. So In a scenario where same user with same roles, should see different layout, we could create different variant and call it in the code based on custom logic.

      Thanks,

      sankar.

      (0) 
  3. Ramin Shafai

    Hello,

    Is there a way to switch variants from within the GAF steps?

    I need the initial screen to select variants be Step 1. So user can go back to it and select a different variant if they want.

    Is this possible?

    Thanks

    (0) 

Leave a Reply