Skip to Content
0

Need to hide an entity using code as CBA not working

Oct 27, 2017 at 05:09 AM

168

avatar image
Former Member

Hi,

We have a requirement to hide an entity for a specific change request type. We did CBA but its not working and also we configured the entity in MDGIMG as 'Not relevent' but still no luck.

Is there any way where we can hide it using code in feeder class or somewhere.

Waiting for your help.

Regards,

Raj

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

4 Answers

Best Answer
Rohit Singh Jan 17 at 11:27 PM
0

Hi Raj,

First of all you need to understand how CBA works. Few points which are important:-

1) Logical Action works in sync with CR Type.

2) Once the Adaptation is loaded by the system for the UI, then it can't be changed in the same session dynamically.

So for Create Scenario, before adaption is actually getting called, System has already fetched the details for the ACTION & CR TYPE. Now based on that your desired CBA is getting triggered. Which is working.

For Display/Change Scenario, When you are clicking the BP for display. System determines the ACTION but there is no CR involved at this time, that means Base Configuration will get called. Now if you do the Change in BP & select your CR Type ( ACTION = CHANGE & CR TYPE = Selected CR ), remember point (2), your desired CBA will not get loaded. As base config is already loaded.

What you need to do in this case, put values '00' & '01' in the Step Column. This columns represent the step in the Workflow. By doing this, whenever the BP is getting displayed or changed, your desired CBA will get call.

NOTE: If the business requirement is only to hide 1 UIBB based on the user authorization, then use code to hide the UIBB from the UI

Cheers,

Rohit

Show 7 Share
10 |10000 characters needed characters left characters exceeded
Former Member

hi Rohit,

Thanks for the answer. Let me add the wf step too.

We have lot many UI hide and unhide. I am just sharing one example.

I willl get back you if it works.

Thanks a lot.

Regards,

Raj

0
Former Member

Hi Rohit,

Tried adding the wf step as 00 but still the CBA is not getting called.

I have added a new CBA with action as change & display and wf step as 00. Not trigerred

Again added CBA with action, cr type and step as 00: Not trigerred

Please let me know if I did something wrong here.

Many Thanks!!!

Raj

capture1.png (62.0 kB)
0
Former Member

Hi Rohit,

When I did step as 00 and others * in CBA dimension, then the CBA correctly trigerred. How I will trigger my CBA according to CR TYPE.

Tried all combination, nothing shows me the CRtype CBA in change.

Regards,

Raj

0

Hi Raj,

I am emphasizing my point again. When user opens an existing Vendor from the system, the CR Type is not determined here. So if you have any CBA which has step '00' it will open up else Base Config opens up. Now when you press EDIT button and select CR Type, it doesn't matter now because the UI is already loaded & system can't change the CBA during run time.

What Business Requirement you have it with you for which you are trying to create the CBA for Change Request ZBPCEMPL. And how this CBA is different than the base configuration. Let me know

Cheers,
Rohit

0
Former Member

Hi Rohit,

We have two CR type and the different UI screens like some entities are hide in one and others its available. For that I have used two CBA. As you told, CREATE is working fine but when I am searching and trying to display/change the respective CR type, the CBA is not trigerring.

Now I can understand from your last replies that for display and change its not possible as cr type is not really coming as the adapt context value.

Is there any other solution where we will get it. I tried avoid coding because there are so many UIBBs which needs to be deleted.

Example:

ZBP_EMPL and ZBPCEMPL: All UIBBS hidden except bp general data and address data.

ZBP_MNFR and ZBPCMNFR: All UIBBs shuld come except PO data and industry data.

just an example for 2 . Actually there are 6 different type of CR type for each create and change process available and the UIBB setup is different in all 6. I choose CBA over coding is because of so many CR type and the different setup.

Please help me to get the best way to achieve it.

Many Thanks!!!

Regards,

Raj

0

Hi Raj,

CBA works fine for Create / Block / Delete Actions as it will carry Action & CR Type from the beginning. However Display/Change ( Only at Requester level) will not work as expected ,but when the CR is submitted for Change Scenario and it is going to be opened again (by clicking CR), your desired CBA will work again now.

It's only 1st Step of Change, where I doubt your CBA will work.

Is it absolutely required to hide your UIBBs from the user ? Leaving it grayed out won't work ?

If not, then implement your solution in a Mix n Match solution. Use CBA for all scenarios except for Change Scenario ( Requester Step), Implement the IF_FPM_OVP_CONF_EXIT~OVERRIDE_EVENT_OVP of your Application Controller Class to hide those UIBBs for Change Scenario (Requester Step).

Make Sure that you check for the Step & CR Type at the beginning in your method so that custom code only runs where it is required.

Cheers,

Rohit

0
Former Member

Hi Rohit,

Thanks!!! I am doing the same now and trying to achieve the hide/unhide using code.

I also tried to use a new field in schema like grouping and tried to write the code and still no luck.

Enough debugging and no outcome. :( :( but in the course, really understood how the CBA works. :)

Thanks a lot for the direction you have given. Really appreciate your help.

Regards,

Raj

0
Rohit Singh Oct 27, 2017 at 05:31 AM
0

Hi Raj,

CBA is the best & first approach to hide any UIBB based on CR Type. If it's not happening with CBA, try to find out the cause. In most of the cases it is because of the Personalization. Clear the personalization and it should work ( if CBA is done the right way ).

Using code should be last resort, however if you wanna do that using code, then find out the application controller class & inside method IF_FPM_OVP_CONF_EXIT~OVERRIDE_EVENT_OVP, you can hide the individual UIBBs.

Either you can enhance the Standard application controller class or the best way is to create your Z class & assign the application controller class as super class & then redefine the same method.

Cheers,
Rohit

Show 2 Share
10 |10000 characters needed characters left characters exceeded
Former Member

Hi Rohit,

Thanks for the answer. We didn't do any personalization for our processes.

First of all the action wont work as 'CHANGE' in CBA. that itself is very strange as the type we are using is process business partner. We tried many combination but it didnt work. Then we observed that the CBA is getting triggered only when we are putting * in CR type and action as 'DISPLAY'.

We have 2 CR type for process Business partner and in one of the CR type we don't want BP_RELATION entity. Could you please help me or clue how to trigger the CBA with individual CR Type.

Regards,

raj

0

Hi Raj,

Let's take the example of creating a Business Partner or a Vendor. You should have Configuration/CBA like below

I have created a CBA just for Change Request Type ZHVVEN02.

So, if I am going to create a standard Vendor (VENDR01), Process a Vendor(VENDR02) or just display a Vendor, my base configuration get called.

But if I create the Vendor using my CR type ZHVVEN02, then 3rd adaptation is getting called. See the screenshot.

I hope you are also doing the same.

Cheers,

Rohit

0
avatar image
Former Member Jan 17 at 11:42 AM
0

Hello,

Thanks!! Sorry for the late reply.

We had some design changes but now again this issue is knocking me. :)

Please find step by step approach is given and its mentioned where I need to trigger the CBA.

I really need some direction here. Somewhere stuck completely.

_____________________________________________________________

For create scenario, I have created ZBP_EMPL. Created a CBA and adjusted my UIs. For change/Display scenario, I have created ZBPCEMPL. Added a different CBA and adjusted my UIs.

For the time being, I have just added 2 CBA, One for create and other for Change/Display.

While creating the BP, its triggering correctly the required CBA. So for create ZBP_EMPL: No Issue

Once the BP is created, I am trying to display it using the search screen. Then when I am clicking the link BP is opened in DISPLAY mode and there the CBA is not trigerring. Also when I am trying to EDIT the screen, still unable to trigger the CBA defined for DISPLAY/CHANGE scenario.

Also tried using code in CL_BS_BP_GUIBB_ROOT class.

Method: IF_FPM_GUIBB_FORM~GET_DATA

Code:

Please help. I am really stuck here and not able to find any solution.

Regards,

Raj


capture1.png (82.5 kB)
capture2.png (71.5 kB)
capture3.png (42.9 kB)
capture4.png (39.9 kB)
capture5.png (34.6 kB)
capture6.png (12.0 kB)
Share
10 |10000 characters needed characters left characters exceeded
Loga Nathan Duraisamy Jan 19 at 01:58 PM
0

Hi Raj,

Sometimes you need to delete and recreate .

This is what i've done in one of the project to make it work.

Thanks and Regards,

Logan.D

Share
10 |10000 characters needed characters left characters exceeded