SAP Knowledge Base Article - Public

2492291 - Event AfterModify under AddressInformation Node is not getting triggered in SDK

Symptom

You have tried modifying few fields in the AddressInformation tab but the AfterModify event is not getting triggered even though the fields are in the same BO node.

Environment

  • SAP Cloud Applications Studio
  • SAP Cloud for Customer

Reproducing the Issue

  1. Login to Cloud Applications Studio.
  2. Open the solution and navigate to the relevant path.
  3. Put a breakpoint in the AfterModify event of AddressInformationnode from Customer BO.
  4. Login to UI.
  5. Navigate to Customer work center.
  6. Open any account and switch to Addresses tab.
  7. Try to modify some standard address-related fields like Postal Code, Street, House Number, etc.
  8. You can see that the debugger is not hit in the event AfteModify. 
  9. Also, the script is not triggered when updating the field on the account Quick Create (QC) screen.

Cause

A script on a node will only be called if fields of that node are changed or the association from that node is changed.

The data that you see on an account comes from a combination of different Business Objects (BO) + Dependent Objects (DO) in the backend. Address information itself is a regular node on the Business Partner BO. It doesn't hold any real Address information but holds just a pointer and data values to the actual DO (address snapshot) where the real address is stored.

When you do an update, changes are done to the snapshot but no changes are done to AddressInformation node as nothing relevant to this has changed i.e. it still points to the same snapshot instance. Hence, updating address will not call the AfterModify of AddressInformation node.

Resolution

You can create a BeforeSave event on AddressInformation node, which will then get triggered on save of the account, if address-related fields are changed.

Alternatively, if you want to have some logic which checks whether AddressInformation is filled, you may create an AfterModiffy script on Common node and once fields under this node (for example standard field Name or an KUT/PDI extension field) is updated, it will be executed.

Keywords

PDI, SDK, script, modifying, phone, number, does, not, trigger, event, after, modify, e-mail, e-mail, address, information , KBA , address node , event after modify not triggered , address information node , LOD-CRM-ACC , Account , AP-RC-BDS-SCR , ByDesign Studio Scripting (ABSL) , How To

Product

SAP Business ByDesign all versions ; SAP Cloud for Customer add-ins all versions