cancel
Showing results for 
Search instead for 
Did you mean: 

Force Child Realtionship(ZZ23REEWRel) when creating Parent(BuilRealtionship)

Former Member
0 Kudos

Hi,

I have requirement that whenever user creates Builrelationship , they must also fill in child ( ZZ23REEWRel). I tried to achieve this through front end , I was able to show error prevent user going back. But I notice  even though I displayed error  parent entity ( Builrelationship ) ia already created with out child(ZZ23REEWRel)  and allowing to save. Please show some light how to achieve this.

Thanks,

Senthil

Accepted Solutions (1)

Accepted Solutions (1)

nicolas_busson
Active Contributor
0 Kudos

Hi Senthil,

You could write your custom logic within badi CRM_BP_UIU_SAVE to prevent the account from behind saved in case you detect missing piece of information:

1246664 - Checks on save

One advantage that I see is that you can bundle many checks at one place instead of coding some checks here and there on every single component.

Regards,

Nicolas.

Former Member
0 Kudos

Thank you Nicolas. I prefer to solve this by front end. I made changes at  DO_HANDLE. I was able get the data for Relationship ,but not for child unless it makes  the round trip.

former_member182421
Active Contributor
0 Kudos

Hi Senthil,

I think the Nicolas way will give you less trouble, in upgrades for example I'm not very fan to put logic on the controller methods if I can use a BADI.

Cheers!

Luis

Former Member
0 Kudos

Can any one help me to force child entry. I need zz23REEWRel enity  to be  mandatory upon changing BuilRealtionship. Modifying the genil class CL_BUPA_IL_RELATION.  MY requirements are whenever user creates new relationship then they must create an entry in zz23REEWRel.  Sometimes they create Builreationship and click back button without  filling the child.  I need to raise an error either in genil level or in WebUI.  Tried Webui,, saves without child data. Any solution to this other than BADI save.

nicolas_busson
Active Contributor
0 Kudos

By the way, did you try to use the "composition" relationship type instead of "aggregation"? I never tested it personally, but as far that I understand this type could probably fit your business case better... And who knows, handle the error message you're asking for automatically. Your feedback will be great if you can test it.

Regards,

Nicolas.

Former Member
0 Kudos

Nothing worked . So changing at Genil level after enhancing the class ZCL_BUPA_IL_RELATION

( EXECUTE_CHECK_BEFORE_SAVE). How do we check which entity is being changed. The code executes even there is change in address at this level.  User want to throw error only when they change the  Builrelationship.  Any help please.

nicolas_busson
Active Contributor
0 Kudos

Hi Senthil,

Sorry but 2 things are not clear for me:

1) Why would you prefer to implement a modification to SAP standard code (changing genil underlying class is considered a modification) instead of implementing a BADI?

2) Why would you care which type of entity is being changed? If you want to prevent the user from saving the account if some values are missing, then when the user is changing the address your custom check will be OK and no error will be thrown anyway... Correct?

former_member182421
Active Contributor
0 Kudos

Today I had the same requermient or at least very similar, "don't allow to create/save a relationship if some data of the source of the relationship is not complete" when I'm back to work( Monday ) I will see what we can do, with this I mean if there's any point which is independent of the input method (Web UI, BAPI, etc.) I hope I can give you some details.

But definetly modifying GENIL is not a very good idea, plus think about if the realtionship is created via FM, the effort of modfying the standard at genil level won't worth it

Former Member
0 Kudos

Currently  the  system allows even the address is wrong at BUPA  header  level. Even If  I raise  error message. l is

Former Member
0 Kudos

Nicholas,

Appreciate your valuable input, I finally Implemented BADI  CRM_BP_UIU_SAVE. I am not hitting break-point when I tried to save the BP. I tried with multiple components Filter still did not hit break-point.  We are upgrading our system to   CRM 7.0 EHP3  within 2 weeks. . Any thoughts.

former_member182421
Active Contributor
0 Kudos

Hi,

Did you tried without filters? I have this BADI implemented without filters and works fine (for other stuff, not relationships)

Cheers!

Luis

former_member182421
Active Contributor
0 Kudos

Good news, I found a way to do it without modification use the BDT of the relationships, I briefly used BDT and is very obscure plus some events works and some other not because are replaced by BADIs, In our scenario we don't have any BADI so there's no other option than use BDT or modify standard, of course if you want to prevent the saving the BADI provided by Nick will work but at the header view not at the relationship view( so you won't be able to prevent the back behaviour).

Use the transaction BUBI and select event which suits you best (depending how the system manages the FG memory) DSAVB, DCHCK, DSAVEC  or DSAVE (I'm using DSAVC) here you can add your own BDT function module I recommend you copy the first entry (100000 - BUB_BUPR_EVENT_DSAVC) and replace the FM for your custom one.

In order to understand how to retrive the info and rise the messages I recommend take a look how the FM BUB_BUPR_EVENT_DSAVC is coded, you can alos check the other ones. This should resolve you issue, it solved mine

Former Member
0 Kudos

Thank You Luis. I finally  made changes at front BP_HEAD component, and prevented the user from saving..

former_member182421
Active Contributor
0 Kudos

Thanks for letting us know, but let me adivce this is not the best approach, how are you controlling when you are in the BP head component the user press back button and you save via pop up instead of  saving with the save button?

Former Member
0 Kudos

I am passing data from from BP_EEW component through Global variable based on certain  condition. In BP_HEAD under EH_ONSAVE checking data passed from BP_EEW and raising error,returning control without saving.

Very straight forward, we planned to revisit this requirement after the  Upgrade Ehp3. Since it is time critical for us ( Prevent data  multiplying) , for now I am using this approach.

Thanks to every one especially to Nicholas and Luis.

Answers (0)