This blog is to add New Date Fields as Context Attribute to the UI component. There are some objects of the object model for business transaction which cannot be enhanced using EEWB/AET. For such cases SAP provides an alternative enhancement option. 

This Document explains how to add new Date Fields as context attribute to the UI component. 

  1. Define Date Types
  2. Extend Model for Business Transactions with New Relations
  3. Create Context Attributes
  4. Change the super class to CL_CRM_UIU_BT_DATE_CN of the Z context node’s class
  5. Modify the ON_NEW_FOCUS as below.
  6. Modify the GET_XXX of the newly added attribute to remove NOT BOUND text in the field
  7. Modify the GET_I_XXX of the newly added attribute to make the field editable if required.
  8. Add the new Date Fields attribute to WEB UI View Configuration from the component work bench
  9. Result
     

Define Date Types

For Duration Field

Extend Model for Business Transactions with New Relations

    

For Duration field

 Create Context Node in Component work bench


Change the super class to CL_CRM_UIU_BT_DATE_CN of the Z context node’s class


Check for the errors(Remove the extra Base_Entity_Name attribute from the class) and activate

Now you can observe the new date attribute has been added to the node

Modify the ON_NEW_FOCUS as below.

Pass the’ I ‘for Item, ‘H’ for Header

Pass the Date Type defined in the date profile

Pass the category as T for Dates. 

Add the new field to the UI Config 

For Date field

For Duration field


 Results 

Advertisements