cancel
Showing results for 
Search instead for 
Did you mean: 

Dynamic hiding of assignment block

0 Kudos

Hi.

Has anybody an experience in dynamic hiding of assignment blocks?

We need some our blocks would not be shown in BP_HEAD during runtime depending on the attributes of a BP.

That is we have our block in BP_HEAD. When a user chooses a partner we have to hide our block or show it depending on the attributes of the chosen BP.

Thank you.

Accepted Solutions (0)

Answers (2)

Answers (2)

0 Kudos

I cannot assign pnts, an error on the site. I'll try later.

Edited by: Nekrasov Alexey on Mar 19, 2010 9:53 AM

Edited by: Nekrasov Alexey on Mar 19, 2010 9:54 AM

arunprakash_karuppanan
Active Contributor
0 Kudos

Hi,

I have created a wiki on this topic just now. The links may not work as the page may be moved. As to your requirement,

- Go to the BPHEADOverview page. That would be the overview controller.

Step 1 - Identify the name of the assignment block

Go to the run time repository of the component. Note down the component usage name. Note down the interface view name. Now, the name of the assignment block page will be

'component_usage_name'.'interface_view_name'. (concatenate both separated by '.' ) or debug to get correct name.

Step 2 - Overview page coding

Detaching Views

In the overview page controller, redefine the method 'DETACH_STATIC_OVW_VIEWS'. This method will be called during each page refresh and will return views to be removed from the overview page.


DATA: ls_viewid TYPE bsp_dlc_ovw_stat_view_attach.
  CONSTANTS: c_view_id TYPE string VALUE 'CUBTOrgSet.BTORGSET/OrgSet'.
*do validations
*if validation fails    
ls_viewid-viewid = c_view_id.
APPEND ls_viewid TO rt_viewid.
*endif
 

Reattaching Views

In the same overview page controller, redefine the method 'REATTACH_STATIC_OVW_VIEWS'.


*basically the same code as in detach views. 
*The return table carries the views to be reattached
*Make sure that the views are not attached already
 DATA: ls_viewid TYPE bsp_dlc_ovw_stat_view_attach.
  CONSTANTS: c_view_id TYPE string VALUE 'CUBTOrgSet.BTORGSET/OrgSet'. 
*if validation ok

  READ TABLE view_area WITH KEY appl_viewname = ls_view_id
                                        type          = space
                                        traymode      = abap_undefined
                                        transporting no fields.
 if sy-subrc = 0.
     ls_viewid-viewid = c_view_id.
    APPEND ls_viewid TO rt_return.
endif.
*endif

Regards,

Arun Prakash

0 Kudos

Hi, Arun Prakash.

Am I right, I need "access key" to redefine the method 'DETACH_STATIC_OVW_VIEWS' of the BPHEADOverview page? No workarounds exist?

Can my component control the necessity of visualization of itself in the BPHEADOverview page?

arunprakash_karuppanan
Active Contributor
0 Kudos

Hi,

Uh oh...I think that you are trying to edit the standard class. You have not enhanced the component BP_HEAD. For enhancing the component, look at this wiki.

[http://wiki.sdn.sap.com/wiki/display/CRM/HowToEnhanceaWebUIComponentinSAP+CRM]

Follow the wiki and enhance the view 'BPHEADOverview page'. Then, you will be able to redefine the methods.

Regards,

Arun Prakash

former_member189678
Active Contributor
0 Kudos

Nekrasov,

First and the foremost step is to enhance your UI component. After which you will need to exhance the view. After enhancing the view, in the IMPL class you will redefine the DETACH_STATIC_OVW_VIEWS & REATTACH_STATIC_OVW_VIEWS methods based on your business conditions to hide certain assignment blocks.

This is the best possible method to achieve it.

Regards,

Harshit

0 Kudos

Would you compare the offered method and the BAdI "Configuration of Assignments" that used for screen modifications and enables to detach or attach assignment blocks dependent on any given criteria. Any advantages or disadvantages of the BAdI?

arunprakash_karuppanan
Active Contributor
0 Kudos

Hi,

I'm sure that there are no BADIs that can fulfill your purpose. What's the BADI that you have specified anyway?

Regards,

Arun Prakash

0 Kudos

Good day.

I've implemented the badi BADI_CRM_BP_UIU_VIEWS. Seek, for example, in

spro - sap reference IMG - CRM - master data - BP - business add-ins - Configuration of Assignments.

It works and fulfills the purpose. Anyway I am grateful to you for your help, your method is suitable too.

Former Member
0 Kudos

Arun,

I have just been looking through the various posts related to the adding of new assignment blocks. In my case I need to add several to the standard Account (Individual account) screen. And also several to the PDF fact sheet, although I think I may have the PDF fact sheet covered as there's a details note on the subject.

A lot of the posts are confusing in regards to adding new AB's and I was wondering whether there was a clear and precise guide for CRM 7. A lot cover 5.1/ 5.2 and vary slightly from CRM 7.

With regards

Jason