Technology Blogs by SAP
Learn how to extend and personalize SAP applications. Follow the SAP technology blog for insights into SAP BTP, ABAP, SAP Analytics Cloud, SAP HANA, and more.
cancel
Showing results for 
Search instead for 
Did you mean: 
Former Member

Here are simple steps to add extension fields to the header of standard BO and show those fields in a EC within a standard UI. I will use Service Request as an example

1. Create a XBO

[Extension] businessobject AP.CRM.Global:ServiceRequest {

        // You must activate this business object before you can access the extension fields

        // or messages in script files, forms, and screens.

                 //Scheduling time points

                 [Label("Scheduled Start Time")] [Tooltip("Scheduled Start Time")] element ScheduledStartTime : Time;

                 [Label("Scheduled End Time")] [Tooltip("Scheduled End Time")] element ScheduledEndTime : Time;

                 [Label("Requested Start Time")] [Tooltip("Requested Start Time")] element RequestedStartTime : Time;

                 [Label("Requested End Time")] [Tooltip("Requested End Time")] element RequestedEndTime : Time;

                 [Label("Scheduled Start Date")] [Tooltip("Scheduled Start Date")] element ScheduledStartDate : Date;

                 [Label("Scheduled End Date")] [Tooltip("Scheduled End Date")] element ScheduledEndDate : Date;

                 [Label("Requested Start Date")] [Tooltip("Requested Start Date")] element RequestedStartDate : Date;

                 [Label("Requested End Date")] [Tooltip("Requested End Date")] element RequestedEndDate : Date;

             

                 //Service location, default to US

                 [Label("Country")] [Tooltip("Country")] element CountryCode : CountryCode = "US";

                 [Label("House Number")] [Tooltip("House Number")] element HouseNumber : LANGUAGEINDEPENDENT_EXTENDED_Text;

                 [Label("Street")] [Tooltip("Street")] element Street : LANGUAGEINDEPENDENT_EXTENDED_Text;

                 [Label("Postal Code")] [Tooltip("Postal Code")] element PostalCode : LANGUAGEINDEPENDENT_EXTENDED_Text;

                 [Label("City")] [Tooltip("City")] element City : LANGUAGEINDEPENDENT_EXTENDED_Text;

                  [Label("State")] [Tooltip("State")] element State : LANGUAGEINDEPENDENT_EXTENDED_Text;

                 node ServiceReferenceObject {

             }

  

}

2. Create an EC and bind it to the SR

3. Add a Data Field in the Data Model to hold the SR UUID. Don't bind this field to anything. Example: SRUUID below.

4. Add an Event that is a Read BO Operation and bind it to the SRUUID field you configured above. Example: EV_LOADSR

5. Add an Inport and bind it to the SRUUID field you configured above. Also set the following properties: OnFire: EV_LOADSR, RequestAutoRefire: True, RequestFireOnInitial: True

6. Add the EC with the Extensibility Explorer for the Service Request Agent Workspace Thing Inspector. Bind the TI Generic Outport ServiceRequest_UUID with the EC Inport

Final Result

The Appointment and Service Location section groups are the XBO fields for the Service Request.

Here is a working solution template example.

https://www.dropbox.com/s/scc1r5hwfj6am6p/YTEEM9L1Y_12-10-2013_115830_PM%28MRS%20Integration%29.zip

Thanks,

Rei

Rei Kasai

Product Management

SAP Cloud for Customer

7 Comments