How to Add Custom BO Tabs to Account 360 Ver 0514

Embed Size (px)

Citation preview

  • 8/10/2019 How to Add Custom BO Tabs to Account 360 Ver 0514

    1/21

    How to add custom BO tabs to Account 360 in C4C

    Tim Chang 5/14/14

    Background:

    Our Cloud professional services team recently brought the customer live on Cloud for Customer project. Thecustomer needed to standardize their selling process and provide greater transparency to their pipeline. One key

    requirement was to provide visibility to sales history from a disparate system and to capture sales forecast all in one

    place. The customer had decided that they wanted to have custom data objects that could be placed into the C4C

    account 360 views as a separate facet (tab).

    The team explored the capabilities of using a Cloud Data Source within the Business Analytics work center; however

    the customer required additional UI functionality as well as data validation rules. Therefore, two custom objects were

    created. One object was to capture Sales Actuals and the second captured Sales Budgets /Forecasts that were read

    only except for forecast column that could be edited.

    We will describe how to develop and deploy this Sales History and Planned Sales in SAP C4C solution.

    In summary, the steps are:

    1. Develop a new Work Center in C4C to manage each of the new business objects Sales History

    BO and Planned Sales BO

    2. Develop a list UI component to display of BO in the Accounts Tab

    3. Implement the file input of each BO

    4. Configure the file input job in C4C

    Since both the Sales History Bo and Planned Sales BOs are quite similar, our guide will focus on the steps

    for Sales History BO.

    1. Develop a new Work Center for Sales History.

    In the SAP Cloud Applications Studio, we started with a new solution, and added a new BO. We

    defined the Sales History BO as:

    importAP.Common.GDT asapCommonGDT;

    import AP.FO.BusinessPartner.Global;

    import AP.PC.IdentityManagement.Global;

    import AP.FO.ProductDataMaintenance.Global asapProdGlobal;

    businessobjectSalesHistory raisesMsgProductErr, MsgSoldtoErr, MsgEndUserErr, MsgEmployeeErr,

    MsgProductBlank, MsgSoldtoBlank, MsgEndUserBlank, MsgEmployeeBlank {

    messageMsgProductErr text "Product &1 does not exist": ProductInternalID;messageMsgSoldtoErr text "Sold To &1 does not exist": BusinessPartnerInternalID;

    messageMsgEndUserErr text "End User &1 does not exist": BusinessPartnerInternalID;

    messageMsgEmployeeErr text "SalesPerson ID &1 does not exist": apCommonGDT:EmployeeID;

    messageMsgProductBlank text "Product must be filled for record &1": ID;

    messageMsgSoldtoBlank text "Soldto must be filled for record &1": ID;

    messageMsgEndUserBlank text "EndUser must be filled for record &1": ID;

    messageMsgEmployeeBlank text "Employee must be filled for record &1": ID;

    [AlternativeKey]

  • 8/10/2019 How to Add Custom BO Tabs to Account 360 Ver 0514

    2/21

    [Label ("Sales History Key")]

    elementSHkey : ID;

    [Label ("Fiscal Period")]

    elementfiscalper : YearMonth;

    [Label ("Calendar Period")]

    elementcalendarper : YearMonth;

    [Label ("Sold To")]

    elementsoldto : BusinessPartnerInternalID ;

    [Label ("End User")]elementenduser : BusinessPartnerInternalID ;

    [Label ("Product Family")]

    elementproductfamily : ID ;

    [Label ("Product Category")]

    elementproductcategory : ID ;

    [Label ("Product Type")]

    elementproducttype : ID ;

    [Label ("Product ID")]

    elementproductID : apCommonGDT:ProductInternalID ;

    [Label ("SalesPerson")]

    elementsalesperson : apCommonGDT:EmployeeID ;

    [Label ("Transaction Date")]

    elementtransactiondate : Date;

    [Label ("Weight MT Actual")]

    elementweight_mt_act : DecimalValue ;

    [Label ("Weight ST Actual ")]elementweight_st_act : DecimalValue ;

    [Label ("Revenue")]

    elementrevenue_act : Amount ;

    [Label ("Est. Avg EBITDA")]

    elementest_avg_ebitda : Amount ;

    [Label ("Avg EBITDA")]

    elementavg_ebitda_percent : Percent ;

    // for end-user only

    associationToEndUserCustomer toCustomer;

    associationToMaterialSH toMaterial ;

    associationToRespEmployee [0,1] toEmployee;

    associationToCustomerSH toCustomer ;

    // action

    actionDeleteSH ;

    }

    In the above ABSL code, we have defined the error messages needed for validation, the structure of the

    BO, the associations for related data in other master BOs, and an action to handle deletion of a row.

    Once this BO is saved and activated, do a right-mouse click on the .BO and selectCreate Screens(see

    below). We are using the automated screen creation to setup a full set of Work Center (WC), OWL, TT,

    TI and other screens with navigation fully linked and working.

    The screen type we want is theScreen Scenario with Thing-Based Navigation:

  • 8/10/2019 How to Add Custom BO Tabs to Account 360 Ver 0514

    3/21

    Once the screens are created, be sure to activate the entire solution.

    The newly created WC will provide the ability to update data in the BO, add rows and delete rows

    for administrative use only, especially if incorrect data was imported. The user will not have access

    to this WC.

    This is a good milepost to test the Sales History WC. You can edit your user id, and add the WC.

    2. Develop a list UI component to display of BO in the Accounts Tab

    In the Accounts 360 screen, you can add a new facet (aka tab) by using available slots in the

    Studio on the Account TI screen object. In this new facet, we can place a custom UI component

    called embedded component (EC) that displays a list of the Sales History rows.

    Since the Account 360 screen is showing only 1 account, we will need to send current account ID

    as a parameter to the EC to retrieve only the Sales history for that account.

    First, lets build this EC, which is a list of the Sales history and will accept a parameter.

    In the solution, we add a New Item from the Embedded Component type.

  • 8/10/2019 How to Add Custom BO Tabs to Account 360 Ver 0514

    4/21

    The object SalesHistoryEC.EC.uicomponent is added to the solution, and double-clicking

    on the .EC.uicomponent will bring up the UI Designer.

    In the UI Designer, drag and drop the Advanced List Pane to the left side into the UI

    box. The Advanced List Pane is available from the Toolbox.

    Afterwards, it looks like this with 3 columns:

  • 8/10/2019 How to Add Custom BO Tabs to Account 360 Ver 0514

    5/21

    We update the 3 columns and add the remaining ones.

    Click on the upper left corner of the l ist box see below.

    Click to go the Properties tab.

    Click on ChildElements->ListColumns. It brings up the Column editor see below.

  • 8/10/2019 How to Add Custom BO Tabs to Account 360 Ver 0514

    6/21

    Lets map the Columnto one of the data elements in the BO.

    Click on Data Information->Value->./Column and it brings up the DependentProperty Editor

  • 8/10/2019 How to Add Custom BO Tabs to Account 360 Ver 0514

    7/21

    In theSelect BO-Modelprompt, select the Sales History BO. Then select the field that this UI

    column maps to.

    In this case, we will choose the fieldfiscalperwhich shows the fiscal period.

    It will prompt to use the associated Backend Text. ClickYes.

    Repeat the above association steps for the remaining 2 fields.

    We will walk to add a new column and an example of showing the Product Description, available

    by association we defined in the BO, since the user may not be familiar with the Product ID.

    Click theAddbutton. It adds a generic namedColumnas shown below.

  • 8/10/2019 How to Add Custom BO Tabs to Account 360 Ver 0514

    8/21

    Click onData Information->Value->./Column and it brings up the DependentProperty Editor

    We look in the BO list of attributes one of which is the ToMaterialSH, which is our gateway to

    the Material BO and the description text. See below.

  • 8/10/2019 How to Add Custom BO Tabs to Account 360 Ver 0514

    9/21

    We continue to add the remaining fields of the BO to the EC.

    As a last step, make sure all the columns are read-only by setting theBehavior->ReadOnlyvalueto true, as shown here:

  • 8/10/2019 How to Add Custom BO Tabs to Account 360 Ver 0514

    10/21

    To complete this EC, we now need to setup the parameter to show just the Sales History records

    for 1 account.

    First define the parameter, which needs to be in a structure. In the DataModel tab of this EC,

    We define the structureSearchByAccountID, and then the variable:

    Then we add the actual parameterAccountID:

    Switching to the Controller tab, we define our Query:

  • 8/10/2019 How to Add Custom BO Tabs to Account 360 Ver 0514

    11/21

    We set the Results List/Root/DataList, and bind the queryQueryByElements. We set the query

    using the down arrow to add the parameter which will use thesoldtofield to parameter defined

    above.

  • 8/10/2019 How to Add Custom BO Tabs to Account 360 Ver 0514

    12/21

    We add an Inport, which is like the doorman who will take parameter from the outside caller,

    and pass it to the query.

    This doorman will also run the query on initialization, so we need to set the behaviors

    RequestAutoRefireandRequestFireOnInitializationto true. The event OnFire needs to set to

    default EventHandler. These items are on the right side in the Properties tab.

  • 8/10/2019 How to Add Custom BO Tabs to Account 360 Ver 0514

    13/21

    Click on Save and Activate on your EC.

    Now that the EC has been created, we need to add this to a new facet of the Accounts TI screen.

    Use the Configuration Explorer tab to look for theCOD_Account_TIscreen see path in the

    screenshot:

  • 8/10/2019 How to Add Custom BO Tabs to Account 360 Ver 0514

    14/21

    The TI screen will start in a new tab of the UI Designer.

    Click on Extensibility Explorer, and select the entity Undefined zmnx.

    Click onAdd View with embedded Component.

    Name the Tab Title appropriately.

    Select the EC you created.

    ClickBind.

    In the Bind setup, on the right you will use the defined outport PublicOutputECCustomerRoot

    and the InPort->Parameterand bind them.

  • 8/10/2019 How to Add Custom BO Tabs to Account 360 Ver 0514

    15/21

    This sends the current AccountID in Account 360 to the Inport (aka doorman) of the EC, and it

    will load the query showing any records from the Sales History BO for this Account ID.

    Click Save and Activate. This EC will now display in a new facet for Account 360. And, thats it

    for step 2.

    3. Implement the file input of each BO

    This step creates the interface that allows you to upload XML files of Sales History data into the

    BO. The XML files can be created using a format (or schema) provided from the Studio.

    In the Studio, right-mouse click on the Sales History BO, and selectCreate Service Integration.

    It will start of a wizard of 5 steps.

    a. Select theXML File Input.

    b. Name the XML interface and the receiving BO

    c. Select all (or the needed fields) that will be imported in.

  • 8/10/2019 How to Add Custom BO Tabs to Account 360 Ver 0514

    16/21

    I do not suggest UUID as an import column. Your normal key (SHkeyID) should be enough,

    as long as you make it unique.

    Most important, click onMass Processing.

    d. In step 4, selectBy Alternative Key. Choose SHkey.

    e. Click Finish

    The program object SalesHistory.pidwil be created.

    ClickSave and Activate. Its also a good idea to do aSave All.

  • 8/10/2019 How to Add Custom BO Tabs to Account 360 Ver 0514

    17/21

    To get the schema file, you will need to exit the Studio and re-log back in. After logging

    back into the Studio, theSalesHistory.xsdwill be an active link, and you can save the schema

    file in a local directory.

    f. To use the .XSD file as an template for data, run Microsoft Excel with a new sheet.

    g. Click on Developer->Source. Click on XML Maps.

    Click on Add button, and add the .XSD from the Studio. See below.

  • 8/10/2019 How to Add Custom BO Tabs to Account 360 Ver 0514

    18/21

    h. Upon clicking OK, you will a list of data nodes in the XML Source.

    Scroll down to the node with your BO name, and drag and drop the node to row A2 (not row

    1). You should see this resulting sheet:

    You can delete all of the superfluous columns that start with schema or SAP_To

  • 8/10/2019 How to Add Custom BO Tabs to Account 360 Ver 0514

    19/21

    i. Drag and drop the CreationDateTime to cell A1. This will bind the CreateDateTime element

    to this cell, so any values entered here will be exported to the XML.

    An example of the data for this cell is 2014-03-03T10:11:00.0000000Z

    j. At this point, save this document as your blank template for future data files you will create

    for importing into the SalesHistory BO.

    k. Heres an example of data rows.

    To create the XML, click onDeveloper->Export

  • 8/10/2019 How to Add Custom BO Tabs to Account 360 Ver 0514

    20/21

  • 8/10/2019 How to Add Custom BO Tabs to Account 360 Ver 0514

    21/21

    b. Enter the Run ID and Description, and use the dropdown to select the Interface. In the example

    below, Ive created it for Sales History.

    c. Click Save. Then click Actions->Set to Active to make it usable.

    d. Now this Run is available. Continue as normal to schedule and run the imports.