cancel
Showing results for 
Search instead for 
Did you mean: 

The process to stop the save of newly created account when having errors

former_member381146
Participant
0 Kudos

Hi Experts,

There is a requirement to maintain atleast one sales area while creating an account in WEB UI. If not, an error message is being thrown. But, though sales area is not maintained, the account is getting saved successfully having error messages.

Please let me know the process to stop save while having error messages for an account.

Regards,

Santosh

Accepted Solutions (0)

Answers (3)

Answers (3)

former_member381146
Participant
0 Kudos

The issue is resolved. Implemented the BADI CRM_BP_UIU_SAVE under the enhancement CRM_UIU_BP_ENHANCEMENT.

Referred thread

former_member381146
Participant
0 Kudos

The issue is resolved. Implemented the BADI CRM_BP_UIU_SAVE under the enhancement CRM_UIU_BP_ENHANCEMENT.

Refer thread

Edited by: Santosh Kacham on Nov 14, 2011 9:10 AM

Edited by: Santosh Kacham on Nov 14, 2011 9:11 AM

Former Member
0 Kudos

Hi Santosh,

To stop the save event when sales area is not found can be performed in method EH_ONSAVE( ) which is triggered when you click on save( ).

If the method is not aready redefined, please redefine it & place a check to check existence of sales area assigned to the newly created account.

You can do this by, reading the entities using Genil Relations.


lr_entity = me->typed_context->account->collection_wrapper->get_current( ). "-- Get reference of the account entity.
lr_sales_ent = lr_entity->get_related_entity( 'BuilSalesArrangementRel' ). "-- Get the related Sales Area entity.
If lr_sales is bound.
  " Check if there is data maitained
  lr_sales_ent->get_properties( importing es_attributes = ls_sales ).
if ls_sales is initial.
  "-- Raise Donot Save  Fill error messages
else.
   "-- Fill error messages for NO Save.
endif.

- Dedeepya

former_member381146
Participant
0 Kudos

We are raising the error messages. Though theyare displayed, account is getting saved succesfully.

There are no exceptions to be raised in EH_ONSAVE() event of WEB UI.

Former Member
0 Kudos

I hope you are raising the messages in the right class then.

because before the commit takes place the super class of EH_ONSAVE checks for error messages existence & if found it cancels the save.

Please debug into the standard Save method & check which class is being checked for error messages; you can add your Error Messages to that class & check once again.