epic-web ui architecture

98
Web Ui Architecture The different software layers are completely separated from each other. The separation allows the connection of any business application via the BOL( Business Object Layer) layer, GenIL( Generic interaction Layer) layer to the presentation layer. Presentation Layer: The Presentation layer of CRM Webclient UI is based on the CRM User Interface Framework, which is the basis for the HTML pages running in the browser. Business Layer: The business layer of CRM Webclient UI consists of the following software layers: Business object layer ( BOL) The business object layer saves the business object data, for example of sales orders, at runtime of SAP CRM session. This layer guarantees the separation of CRM Webclient UI and the underlying business logic Generic interaction layer (GenIL) The generic interaction layer handles the data transfer from the business object layer to the application programming interfaces ( APIs) of the underlying business engine. It is

Upload: rajesh98765

Post on 20-Dec-2015

81 views

Category:

Documents


11 download

DESCRIPTION

SAP CRM Tech

TRANSCRIPT

Page 1: EPIC-Web Ui Architecture

Web Ui Architecture

The different software layers are completely separated from each other. The separation allows the connection of any business application via the BOL( Business Object Layer) layer, GenIL( Generic interaction Layer) layer to the presentation layer.Presentation Layer: The Presentation layer of CRM Webclient UI is based on the CRM User Interface Framework, which is the basis for the HTML pages running in the browser.Business Layer:The business layer of CRM Webclient UI consists of the following software layers: Business object layer ( BOL)The business object layer saves the business object data, for example of sales orders, at runtime of SAP CRM session. This layer guarantees the separation of CRM Webclient UI and the underlying business logic Generic interaction layer (GenIL)The generic interaction layer handles the data transfer from the business object layer to the application programming interfaces ( APIs) of the underlying business engine. It is the connection between the business object layer and the underlying business engine.Business Application:The business application contains the business logic and the database tables.

Getter and Setter methods:Get_attr: get the data from the bol and shown on the screen.Set_attr: sets the data which is given on the screen on to the Bol.Get_i_attr: to enable or disable codes have to write in this method.Get_p_attr: to write code for check box, radio buttons, pick lists, value search f4.

Page 2: EPIC-Web Ui Architecture

Get_v_attr: without get p method there is no get v method.                     Use this to give values for attributes.                    To give values to the pick list use get p and get v together.                     Every attribute have this getter and setter methods.Get_m_attr: this method changes the metadata.                       Whenever you’re changing the tables then only it is use full.If you don’t have the get and set methods then we can say that values stored in the database.Context node class generated methods for attributes.

EEWB & AET

Both EEWB (Easy Enhancement Workbench) and AET (Application Enhancement Tools) tools are used to add custom fields to any CRM object. Going back to history, EEWB was provided by SAP from CRM 4.0 (I only started working from CRM 4, not sure if it existed before) and was very handy tool to add new fields on CRM 4, 5.  EEWB was mainly used by developers as it still required some technical knowledge for adding fields. AET has taken the wizard to next level by enabling to directly add fields on CRM UI. AET is quite easy to use and was mainly designed with the idea to simplify adding of custom fields to any CRM object. Any person with fair amount of CRM knowledge can use AET to add custom fields.

I like both of these tools and worked extensively of EEWB. Using EEWB, I added fields. Then I created tables, tabstrips and included those custom fields on the Additional Data tab in CRMD_ORDER. This was possible as we were still working on GUI and I could play around in any way according to the requirement. We can’t add tables using AET as of now. If SAP can provide this option in the future releases, that would be great.

Below are few things that I want to highlight about these two tools.

1.       Any custom fields added using AET doesn’t exist on Additional Data/Customer Fields Tab on CRMD_ORDER. This is a bit strange and I really didn’t understand why SAP didn’t provide this feature. I know SAP wants to drive CRM only through web UI. But still I would like to have this feature of displaying custom fields added using AET on GUI as well. This is the only concern that I have with AET.

2.       AET has made life much simpler if we want to add dropdown boxes, Search Helps, Currency and Quantity fields.  Using EEWB, it was a bit more complicated in having these features.

3.       Using AET, we can reuse the custom fields in other objects. This is really cool thing which prevents us to recreate the same custom field if required in any other object.

For now, I’m enjoying AET more than EEWB. AET is future ahead for adding new fields. Maybe AET will have the capability to add assignment blocks directly some day.

Application Enhancement Tool 

The Application Enhancement Tool has been introduced to enhance CRM applications. You can use the tool to search for enhancements, and to display, create, change, and delete enhancements.Integration

Page 3: EPIC-Web Ui Architecture

You can enhance ERP business objects in the CRM WebClient UI. For more information, see Customizing for Customer Relationship Management under   Transactions  Settings

for ERP Transactions Maintained via CRM  Enhancement of ERP Fields.

PrerequisitesBefore you can use the Application Enhancement Tool, you need to define the package name, generation prefix, and namespace for enhancements. You can make the necessary settings in Customizing for Customer Relationship Management under   UI

Framework  UI Framework Definition  Application Enhancement Tool  Define System

Settings.If you are not authorized to use the Application Enhancement Tool, you need a certain  authorization role .

Only the Z namespace is supported for BDocs. Within other namespaces, you will not be able to generate enhancements that influence BDocs. This affects the enabling for CRM Mobile, and enhancements for all Marketing objects.FeaturesThe Application Enhancement Tool is integrated in the UI Configuration Tool, and can be started in this tool. The fields that you have added to an application are available in the UI configuration of the corresponding UI component and view. You can make these new fields available on the user interface by adding them to the view.The Application Enhancement Tool offers the following main functions:

         Creating custom fields         Defining dropdown list boxes for custom fields         Translating field labels and entries in dropdown list boxes         Assigning search helps and check tables to custom fields         Making new custom fields available in search criteria and/or result lists, Business

Intelligence (BI) reporting, R/3 Adapter, CRM Mobile, and CRM interactive reporting, which depends on the enhanced business object

         Using different data types, such as characters, dates, times, and numbers         Reusing fields in other business objects, if these business objects are based on the

same enhancement placeUI Configuration ToolYou can use the UI Configuration Tool to adapt the user interface of SAP CRM to your company's specific requirements. You can access the UI Configuration Tool in SAP GUI and in the CRM WebClient UI.Integration

         If you want to change field labels across multiple views, you can use the design layer to consolidate the field changes. You define these settings in Customizing under   

Customer Relationship Management  UI Framework  UI Framework Definition  Design

Layer  .

         If you want to change customer-specific fields that were created with the Easy Enhancement Workbench (EEW), and are contained in views, you can do so by using the UI Configuration Tool in the same way as with standard fields. You define your own fields in Customizing under   Customer Relationship Management  CRM Cross-Application

Components  Easy Enhancement Workbench.

Features

Page 4: EPIC-Web Ui Architecture

The UI Configuration Tool in the CRM WebClient UI enables you to easily adjust pages and views to your requirements.General FeaturesThe UI Configuration Tool in the CRM WebClient UI offers the following general features:

         The UI configuration is based on an authorization object.The UI configuration in SAP GUI is also based on an authorization object.

         The UI configuration is automatically started with the parameters that were found.This is true, if you start the UI configuration directly from an application. If you start it from the navigation bar or the work center page, you need to select manually the configuration parameters of the pages or views that you want to change.

         All configuration changes that you have made are automatically visible in the application.

         To save your configuration changes you can create a new transport request or select an existing transport request in the CRM WebClient UI.DIFFERENCE BETWEEN AET AND EEWB:AET is a Web UI based Tool to generate New Attributes in CRM. It came into being from 7.0 Version. Earlier EEWB was being used and is a SAP GUI based tool, a little tedious as well. The attributes which are generated from AET are well connected through BOL layer and also into the DB layer. The framework takes care of everything else.

UI Configuration AccessYou can enter the view configuration and fact sheet configuration in the CRM WebClient UI in the following ways.Via Logical Links in the Navigation Bar or from a Work Center PageYou can access the view configuration and fact sheet configuration in your system administrator role. They way you access the view configuration and fact sheet configuration depends on your Customizing:

         By using logical links that belong to a direct link group in the navigation bar         By using logical links that belong to a work center, for example the Administration work

centerThese logical links are displayed on the second level of the corresponding work centers in the navigation bar of your system administrator role.

         By using logical links on a work center pageThese logical links can be assigned to the Search content block on the work center page, for example on the Administration work center page.Via Icons in the ApplicationWhen the configuration mode is activated on the central personalization page of SAP CRM, you see the Configure Page icon at the top of Home pages, work center pages, and overview pages. If you click the icons, you see the View Configuration dialog.You see the Show Configurable Areas icon at the top of most pages. If you click the icon, you can see all configurable areas that are available on this page. Every configurable area is surrounded by a frame. If you click a configurable area with a frame you see the view configuration of that specific view. If the configuration mode is activated, the general navigation is deactivated. To deactivate the configuration mode click the icon again.You can use the Show Configurable Areas icon to configure only those assignment blocks that are expanded. If they are collapsed, expand them before you click the icon.Via F2 Help in the Application

Page 5: EPIC-Web Ui Architecture

To find out the name of an application component or view, click F2. The Technical Data dialog with the technical information is started. To access the UI configuration of this view and this application component, click Configure at the bottom of the dialog.Look and Feel of the UI ConfigurationView ConfigurationWhen you start the view configuration in the navigation bar you navigate to the search page where you can search for an application component. All views that belong to a certain application component are displayed in the result list. Select a view and click View Configuration. You navigate to the standard configuration page of the selected application component and view. All configurations that are available for that specific application component and view are displayed in the Configurations block. The current configuration is highlighted in theConfigurations block. The View block contains the fields, assignment blocks, and so on, that are available in that specific view.If you need more space to display data, you can collapse either the Configurations block or the View block.Fact Sheet ConfigurationWhen you start the fact sheet configuration in the navigation or in the BSP Component Workbench you navigate to the search page, where you can search for a fact sheet. All configurations (customer configuration, standard configuration) and the role configuration keys that belong to a fact sheet are displayed in the result list. Select a fact sheet configuration and click Select Page Type to define the page type and the page layout of the fact sheet. You can also click Next or the hyperlink in the column Role Config. Key. Click Assign Views to navigate to the next configuration step. In the Configurations block, you see the selected fact sheet and its role configuration key. In the View block you can assign fact sheet views to the selected fact sheet and to the tiles. In the Properties block you see the different fact sheet titles.If you need more space to display data, you can hide each of the above-mentioned blocks.UI Configuration Based on Enhancement SetsIf you select an application component and view in the CRM WebClient UI for which an enhancement set has been previously created in SAP GUI, you can perform the configuration based on the enhanced component.Configuration Access SequenceYou can change the standard access sequence that is used to determine configurations. The actual configuration that is used for a certain configurable view is determined on the basis of a search key and the available configurations that exist for a specific view. The configuration can either be a standard SAP configuration or a customer-specific configuration.To use your own access sequence, you need to implement the Business Add-In (BAdI) BSP_DLC_ACCESS_ENHANCEMENT in Customizing for Customer Relationship Management, by choosing   UI Framework  UI Framework Definition  Business Add-Ins

(BAdIs)  Define Configuration Access  BAdI: Configuration Access Determination.

DEFINING ROLL KEYwith roll key we can conrol complete configuration of view structure or standard componenet.rollkey, component usage, object type, subobject type, these four parameters controls complete configuration of component.these four fields provides the technical information of component.

roll key controls the complete bussiness role.each config will have different no of fields.

Page 6: EPIC-Web Ui Architecture

every transaction will have its own object type.

role key controls fields, navigation bar profile controls links,pecg controls authorizations.pecg is a connection between user and bussiness role.multiple bussiness roles are connected with pfcg.multiple pfcg s connected with userlevel.

         SELECT SPRO TRANSACTION.         CLICK SAP REF IMG.         SEARCH (CTRL+F).         PROVIDE SEARCH CONTENT AS : DEFINE ROLE         EXECUTE DEFINE ROLE.         ADD NEW ENTRIES.         PROVIDE ROLE KEY STARTS WITH Z AND PROVIDE DESCRIPTION.         SAVE.         PROVIDE ROLE CONFIG KEY AS YOU’RE PROVIDED ROLE KEY.         SAVE.         WITH THIS YOUR ROLL KEY GENARATED.

ENHANCEMENTS TO STANDARD COMPONENT         TO ENHANCE STANDARD COMPONENT NOTHING BUT BSP APPLICATION NAME.         TO KNOW THE DETAILS OF STANDARD APPLICATION GO TO TRANSACTION WEB-UI.         SELECT REQUIRED SALES CYCLE THEN SELECT UR REQUIRED UI.         ON THAT UI PRESS F2 BUTTON.         ONE POPUP WILL APPEAR FROM THAT UI WE CAN GET COMPLETE DETAILS OF STANDARD

COMPONENT.         DETAILS LIKE STANDARD COMPONENT, OBJECT TYPE OR WE CAN SEE TECHNICAL

INFORMATION AND FUNCTIONAL INFORMATION.         STRUCTURAL INFORMATION MEANS THAT COMPONENT VIEW STRUCTURE.

Adding A Custom Description To A Standard Component Field

STEP1: GO TO TCODE: CRM_UI  Select Any Business Role   for eg: Sales Professional->Sales Cycle->Oppertunities->Opportunity-> FsOppertunity->

Description  Press F2 on the Description Field.  Then we  Choose Technical Information of Component like below.

Page 7: EPIC-Web Ui Architecture

 

STEP2: GO TO TCODE: BSP_WD_CMPWB

From the Above we get Component: BT111H_OPPT  For this Component we have to create Enhancement Set  Provide Enhancement Name you want to Create.like: ZTestOPPT

  Then Click on Create button.  Provide Description.  Click on Display.  Click on Enchance Component

  Provide Enhancement Set You have created.

Provide Bsp Application Name: (USER DEFINE)            

  Click on Yes .

Page 8: EPIC-Web Ui Architecture

  Press Enter ( here Repository.xml will be created…..).  Save in local Package or Your own Package.

Select Component Structure Browser…

  Go to views-> BT111H_OPPT/Details  Right Click BT111H_OPPT/Details then Select Enhance.

Save in local package or own package.Then Provide Implementation Classname.

Then Provide Context Class name.

Then Save in local package or own Package.

In the status bar u wil get msg like: Enhancement Was prepared Succesfully.

After Enhancing You wil get ur Implementation ZCLASS

Page 9: EPIC-Web Ui Architecture

Go to BT111H_OPPT/Details  double click .Go to View Strucutre-> Request Processing->Select DO_PREPARE_OUTPUT->Right Click->Redefine.

Then double click on Do_Prepare_Output.Then select change mode.Write the Code as below.

method DO_PREPARE_OUTPUT.

CALL METHOD SUPER->DO_PREPARE_OUTPUT  EXPORTING    IV_FIRST_TIME = IV_FIRST_TIME.

DATA: LR_COL TYPE REF TO CL_BSP_WD_COLLECTION_WRAPPER,      LR_ENTITY TYPE REF TO CL_CRM_BOL_ENTITY.

LR_COL = ME->TYPED_CONTEXT->BTADMINH->COLLECTION_WRAPPER.LR_ENTITY ?= LR_COL->GET_CURRENT( ).LR_ENTITY->SET_PROPERTY_AS_STRING( IV_ATTR_NAME = 'DESCRIPTION'                                  IV_VALUE = 'TEST OPPUTUNITY' ).endmethod.

Save and Activate……

Go to SM30 ANDProvide: BSPWDV_EHSET_ASG

Page 10: EPIC-Web Ui Architecture

Click on Maintain.Then provide ZTESTOPPT enhancementThen save.

GO TO CRM_UI

->CHECK YOUR CUSTOMIZED DESCRIPTION FOR UR FIELD.

The Result will be.

View Creation:

1. Go to Component Structure Browser.2. Select Views.3. Right Click On View.4. Select Create.

Step1: Create View

1. Start->Continue.2. Define Name:

Page 11: EPIC-Web Ui Architecture

                                    View Name: ZChandu.3. Add Model Node->Continue.4. Add Value Node-> Value Node: ZChandu.5. Add Model Attributes->Continue.6. Add Value Attributs.

  Add AbapDictionaryType  Provide DDIC Structure: ZDemo_Cus_lead.  Continue.

7. Create Links To Custom Controllers->Continue.            Select View Type: Table View.            Properties: Configurable, Change/Display->Continue.8. Complete.

Step2:

1. Go to Component Structure Browser.2. Select the view you have created.3. Double Click the view you have created.4. Go to Configuration Tab.5. Select New Configuration->Select all Default values then Save.6. Move Your Fields from Available Fields to Display Fields then Save.7. Select Copy Configuration->Then Select Yes-> Provide Your Own Role Config          Key. ( For eg: ZRoleKey).

Step3:

1. Select Runtime Repository Editor.2. Select Change Mode.3. Select ViewSets->ViewSet BT111H_OPPT/OpportunityOVViewSet->ViewArea OverviewPage-> Right Click on ViewAreaOverviewPage->Select Addview.                                   Provide BspApplication of Your Enhancement: ZchanduBsp            Provide the View You have Created: TestView.           Step4:

1. Double Click on above VIEW.2. Go to Configuration Tab: New Configuration.3. Save4. Go to Copy Configuration->yes.5. Choose Configuration: ZChandu->Enter->Enter.6. Move Fields From available to Display Fields.7. Save Configration.8. Save Runtime Repository Editor.9. Goto Windows in Runtime Repository Editor.            1. Windows                        Window MainWindow (default)                                    View BT111H_OPPT/OpportunityOVViewSet (default).

Page 12: EPIC-Web Ui Architecture

            Doubli Click on Above Viewset.10. Edit.11. Move Our View From Assignment Block To Displayed Block.12. Provide Title for Our view in Displayed Block.13. Save……14. Check Our View on WebUI( Crm_ui ).

ADDING (INSERT,DELETE AND EDITLIST) TOOLBAR BUTTONS AND VIEW BUTTONS

STEP1

1. Go to Component Structure Browser.2. Go to Our View ( Foreg: TestView ).3. Go to View Structure->Request Processing->DO_PREPARE_OUTPUT4. Right Click DO_PREPARE_OUTPUT-> Select Redefine.5. Write the Code…

Provide Below Details in Implementation Class

Attributes

1.  GT_TOOLBAR_BUTTONS Instance Public Type CRMT_THTMLB_BUTTON_T.2.  GT_VIEW_BUTTONS Instance Public Type CRMT_THTMLB_BUTTON_T.

Code in DO_PREPARE_OUTPUT

method DO_PREPARE_OUTPUT.CALL METHOD SUPER->DO_PREPARE_OUTPUT  EXPORTING    IV_FIRST_TIME = IV_FIRST_TIME.DATA : WA_BUTTON TYPE CRMT_THTMLB_BUTTON.DATA : V_FLG TYPE boolean.

REFRESH: GT_TOOLBAR_BUTTONS,GT_VIEW_BUTTONS.

WA_BUTTON-ID = 'EDIT LIST'.WA_BUTTON-TEXT = 'EDIT LIST'.WA_BUTTON-ON_CLICK = 'EDITLIST'.

V_FLG = VIEW_GROUP_CONTEXT->IS_VIEW_IN_DISPLAY_MODE( ME ).IF V_FLG = ABAP_TRUE.  WA_BUTTON-ENABLED = 'X'.  ELSE.    WA_BUTTON-ENABLED =''.

Page 13: EPIC-Web Ui Architecture

    ENDIF.    APPEND WA_BUTTON TO GT_TOOLBAR_BUTTONS.    CLEAR WA_BUTTON.WA_BUTTON-ID = 'INSERT'.WA_BUTTON-TEXT = 'INSERT'.WA_BUTTON-ON_CLICK = 'NEW'.WA_BUTTON-ENABLED = 'X'.

APPEND WA_BUTTON TO GT_VIEW_BUTTONS.CLEAR WA_BUTTON.

WA_BUTTON-ID = 'DELETE'.*WA_BUTTON-TEXT = 'INSERT'.WA_BUTTON-ON_CLICK = 'DEL'.WA_BUTTON-ENABLED = 'X'.WA_BUTTON-TYPE = CL_THTMLB_UTIL=>GC_ICON_DELETE.

APPEND WA_BUTTON TO GT_VIEW_BUTTONS.CLEAR WA_BUTTON.

endmethod.

Go to .htm for adding code for Display Buttons

1. Go to SE80.2. Go to TagBrowser->Bsp Extensions->chtmlb-> <chtmlb:configTable>->actions.    Drag actions to .htm inside <chtmlb:configTable >   and write the code like: actions = "<%= CONTROLLER->GT_VIEW_BUTTONS %>"4. Go to TagBrowser->Bsp Extensions-> <thtmlb:areaFrameSetter>->toolbar           Buttons.            Drag <thtmlb:areaFrameSetter> above <chtmlb:configTable>            And Drag maxButtonNumber and toolbarButtons in between            <thtmlb:areaFrameSetter>            The code like below.      <thtmlb:areaFrameSetter  maxButtonNumber = "2"

  toolbarButtons = "<%= CONTROLLER->GT_TOOLBAR_BUTTONS %>"/>

The Complete .htm code will be like below.

<%@page language="abap" %><%@extension name="thtmlb" prefix="thtmlb" %><%@extension name="chtmlb" prefix="chtmlb" %><%@extension name="bsp" prefix="bsp" %>

Page 14: EPIC-Web Ui Architecture

  <thtmlb:areaFrameSetter  maxButtonNumber = "2"

  toolbarButtons = "<%= CONTROLLER->GT_TOOLBAR_BUTTONS %>"/>

<chtmlb:configTable actionsMaxInRow = "3"

                    allRowsEditable       = "TRUE"                    displayMode           = "<%= controller->view_group_context->is_view_in_display_mode( controller ) %>"                    downloadToExcel       = "FALSE"                     actions = "<%= CONTROLLER->GT_VIEW_BUTTONS %>"                    id                    = "Table1"                    onRowSelection        = "select"                    personalizable        = "FALSE"                    selectedRowIndex      = "<%= ZCHANDU->SELECTED_INDEX %>"                    selectedRowIndexTable = "<%= ZCHANDU->SELECTION_TAB %>"                    selectionMode         = "<%= ZCHANDU->SELECTION_MODE %>"                    table                 = "//ZCHANDU/TABLE"                    usage                = "EDITLIST"                    visibleFirstRow      = "<%= ZCHANDU->VISIBLE_FIRST_ROW_INDEX %>"                    visibleRowCount      = "6"                    width                 = "100%"                    xml                   = "<%= CONTROLLER->CONFIGURATION_DESCR->GET_CONFIG_DATA( ) %>" />

Go to CRM_UI & Check the Buttons Added Or Not.

Event Handling Code for Insert Button

1. Goto Component Structure Browser->Go to Ourview->View Structure->   Event Handler->Right Click Event Handler->Select Create option.            Provide Event Name: NEW.2. Select EH_ONNEW->Right Click->Redefine.

CODE FOR EH_ONNEW

method EH_ONNEW.

DATA: LR_VALUE_NODE TYPE REF TO CL_BSP_WD_VALUE_NODE.

TYPES: BEGIN OF TY_OPPT,        LEADTYPE TYPE ZDEMO_CUS_LEAD-LEADTYPE,        LEADTARGET TYPE ZDEMO_CUS_LEAD-LEADTARGET,        PARTNER TYPE ZDEMO_CUS_LEAD-PARTNER,      END OF TY_OPPT.DATA: WA_LINE TYPE REF TO TY_OPPT.

Page 15: EPIC-Web Ui Architecture

CREATE DATA WA_LINE.

CREATE OBJECT LR_VALUE_NODEEXPORTING          IV_DATA_REF = WA_LINE.

TYPED_CONTEXT->TESTNODE->COLLECTION_WRAPPER->ADD( LR_VALUE_NODE ).

endmethod.

Event Handling Code for Delete Button

1. Goto Component Structure Browser->Go to Ourview->View Structure->   Event Handler->Right Click Event Handler->Select Create option.            Provide Event Name: DEL.2. Select EH_ONDEL->Right Click->Redefine.

CODE FOR EH_ONDEL

method EH_ONDEL.

  DATA: LR_COL TYPE REF TO IF_BOL_BO_COL,        LR_MARKED_COL TYPE REF TO IF_BOL_BO_COL,        LR_SELECT TYPE REF TO IF_BOL_BO_COL,        SELMODE_MULTIEDIT TYPE REF TO CL_BSP_WD_CONTEXT_NODE_TV,        SELECTION_MODE TYPE REF TO  CL_BSP_WD_CONTEXT_NODE_TV,        LR_ENTITY TYPE REF TO IF_BOL_BO_PROPERTY_ACCESS.

  LR_COL ?= TYPED_CONTEXT->ZCHANDU->COLLECTION_WRAPPER.

  LR_MARKED_COL ?= LR_COL->GET_MARKED( ).

  LR_ENTITY ?= LR_MARKED_COL->GET_FIRST( ).

*  LR_COL->SET_MULTI_SELECT( ).

*ME->SELECTION_MODE = ME->SELMODE_MULTI .

  WHILE LR_ENTITY IS BOUND.    LR_COL->REMOVE( LR_ENTITY ).    LR_ENTITY ?= LR_MARKED_COL->GET_NEXT( ).  ENDWHILE.

endmethod.

Page 16: EPIC-Web Ui Architecture

Event Handling Code for EDITLIST Button

1. Goto Component Structure Browser->Go to Ourview->View Structure->   Event Handler->Right Click Event Handler->Select Create option.            Provide Event Name: EDITLIST.2. Select EH_ONEDITLIST->Right Click->Redefine.

method EH_ONEDITLIST.

  DATA:   LR_CUCO TYPE REF TO CL_BT111H_O_OPPTDETAILSCU_IMPL,        LR_BTADMINH  TYPE REF TO CL_CRM_BOL_ENTITY.

LR_CUCO ?= GET_CUSTOM_CONTROLLER( CONTROLLER_ID = 'BT111H_OPPT/OpptDetailsCuCo' ).LR_BTADMINH ?= LR_CUCO->TYPED_CONTEXT->BTADMINH->COLLECTION_WRAPPER->GET_CURRENT( ).

IF LR_BTADMINH->LOCK( ) = ABAP_TRUE.  VIEW_GROUP_CONTEXT->SET_VIEW_EDITABLE( ME ).ENDIF.

endmethod.

Here TESTNODE is an object of CONTEXTNODE CLASS OBJECT

MAINTAINING DROPDOWN AND POPUP MESSAGES

STEP1

1. Go to Component Structure Browser.2. Go to Our view (for eg: ZCHANDUBSP/TESTVIEW).3. Go to Context->Contex Nodes->TestNode->Attributes-> LeadType->   Select GET_P_LEADTYPE.4. Double Click on GET_P_LEADTYPE->select yes.

Write Below code in GET_P_LEADTYPE method

method GET_P_LEADTYPE.    CASE iv_property.    WHEN if_bsp_wd_model_setter_getter=>fp_fieldtype.      rv_value = cl_bsp_dlc_view_descriptor=>field_type_picklist.    WHEN if_bsp_wd_model_setter_getter=>fp_server_event.      rv_value = 'OPP_TYPE_SELECTED'. “ it is event handle method.  ENDCASE.

endmethod.

STEP2

Page 17: EPIC-Web Ui Architecture

1. Go to Component Structure Browser.2. Go to Our view (for eg: ZCHANDUBSP/TESTVIEW).3. Go to Context->Contex Nodes->TestNode->Attributes->LeadType->    Select GET_V_LEADTYPE.4. Double Click on GET_V_LEADTYPE ->select yes.

Write Below code in GET_V_LEADTYPE method

method GET_V_LEADTYPE.

  DATA: LR_DDLB TYPE REF TO CL_CRM_UIU_DDLB,        IT_DDLB TYPE  BSP_WD_DROPDOWN_TABLE,        WA_DDLB TYPE  BSP_WD_DROPDOWN_LINE.

  CREATE OBJECT LR_DDLB  EXPORTING            IV_SOURCE_TYPE = 'T'.

  APPEND INITIAL LINE TO IT_DDLB.

  WA_DDLB-KEY = '11'.  WA_DDLB-VALUE = 'TYPE1'.

  APPEND WA_DDLB TO IT_DDLB.

    WA_DDLB-KEY = '12'.    WA_DDLB-VALUE = 'TYPE2'.  APPEND WA_DDLB TO IT_DDLB.

    WA_DDLB-KEY = '13'.    WA_DDLB-VALUE = 'TYPE3'.

  APPEND WA_DDLB TO IT_DDLB.

  CALL METHOD LR_DDLB->SET_SELECTION_TABLE    EXPORTING      IT_SELECTION_TABLE = IT_DDLB.

*    LR_DDLB->SET_SELECTION_TABLE( EXPORTING IT_SELECTION_TABLE = IT_DDLB ).     RV_VALUEHELP_DESCRIPTOR ?= LR_DDLB.

endmethod.

STEP3

1. Go to Component Structure Browser.2. Go to Our view (for eg: ZCHANDUBSP/TESTVIEW).

Page 18: EPIC-Web Ui Architecture

3. Go to Context->Contex Nodes->TestNode->Attributes-> LEADTARGET ->     Select GET_I_LEADTARGET.4. Double Click on GET_I_LEADTARGET.

Write the Below Code in GET_I_LEADTARGET

method GET_I_LEADTARGET.

“ some predefine code exist in this method.

IF CURRENT->GET_PROPERTY_AS_STRING( IV_ATTR_NAME = 'LEADTYPE' ) IS INITIAL.  RV_DISABLED = 'TRUE'.ELSE.  RV_DISABLED = 'FALSE'.ENDIF.

endmethod.

STEP4

1. Go to Component Structure Browser.2. Go to Our view (for eg: ZCHANDUBSP/TESTVIEW).3. Go to Context->Contex Nodes->TestNode->Attributes-> PARTNER ->     Select GET_I_PARTNER.4. Double Click on GET_I_PARTNER.

Write the Below Code in GET_I_PARTNER.

method GET_I_PARTNER.

“ some predefine code exist in this method.

IF CURRENT->GET_PROPERTY_AS_STRING( IV_ATTR_NAME = 'LEADTYPE' ) IS INITIAL.  RV_DISABLED = 'TRUE'.ELSE.  RV_DISABLED = 'FALSE'.ENDIF.endmethod.

“ Go to crm_ui and check dropdown list added or not.

Step4: (Event Handler Method 'OPP_TYPE_SELECTED' Code)

1. Go to Component Structure Browser.2. Go to Our view (for eg: ZCHANDUBSP/TESTVIEW).3. Go to EventHanlder.->Right Click->Create                     Provide Event Name as: OPP_TYPE_SELECTED ->enter

Page 19: EPIC-Web Ui Architecture

4. Double Click On method EH_ONOPP_TYPE_SELECTED.           

Write the Below Code in EH_ONOPP_TYPE_SELECTED

method EH_ONOPP_TYPE_SELECTED.

        DATA: LR_EVENT TYPE REF TO CL_HTMLB_EVENT_SELECTION,            LR_COL TYPE REF TO IF_BOL_BO_COL,            LR_ITR TYPE REF TO IF_BOL_BO_COL_ITERATOR,            LR_ENTITY TYPE REF TO IF_BOL_BO_PROPERTY_ACCESS,            LR_CORE TYPE REF TO CL_CRM_BOL_CORE,            LR_MSG TYPE REF TO CL_CRM_GENIL_GLOBAL_MESS_CONT,            V_INDEX TYPE I.

  LR_CORE = CL_CRM_BOL_CORE=>GET_INSTANCE( ).

  CALL METHOD LR_CORE->GET_GLOBAL_MESSAGE_CONT  RECEIVING          RV_RESULT = LR_MSG.

  LR_EVENT ?= HTMLB_EVENT_EX.

  CALL METHOD CL_THTMLB_UTIL=>GET_EVENT_INFO  EXPORTING            IV_EVENT = HTMLB_EVENT_EX  IMPORTING            EV_INDEX = V_INDEX.

  LR_COL ?= TYPED_CONTEXT->TESTNODE->COLLECTION_WRAPPER.

  LR_ITR ?= LR_COL->GET_ITERATOR( ).

  LR_ENTITY ?= LR_ITR->GET_FIRST( ).

  WHILE LR_ENTITY IS BOUND.    IF LR_ENTITY->GET_PROPERTY_AS_STRING( IV_ATTR_NAME = 'LEADTYPE' ) = LR_EVENT->SELECTION AND SY-INDEX NE V_INDEX.

*      CALL METHOD LR_MSG->ADD_MESSAGE*      EXPORTING*                IV_MSG_TYPE = 'F'*                IV_MSG_ID = 'ZMSG19'*                IV_MSG_NUMBER = '000'*                IV_MSG_V1 = LR_EVENT->SELECTION*                IV_SHOW_ONLY_ONCE = 'X'*                IV_MSG_LEVEL = '1'.

      CALL METHOD LR_MSG->ADD_MESSAGE        EXPORTING

Page 20: EPIC-Web Ui Architecture

          IV_MSG_TYPE       = 'E'          IV_MSG_ID         = 'ZMSG11'          IV_MSG_NUMBER     = '000'*          IV_MSG_TEXT       =          IV_MSG_V1         = LR_EVENT->SELECTION*          IV_MSG_V2         =*          IV_MSG_V3         =*          IV_MSG_V4         =          IV_SHOW_ONLY_ONCE = 'X'          IV_MSG_LEVEL      = '1'.

    ENDIF.                LR_ENTITY ?= LR_ITR->GET_NEXT( ).   ENDWHILE.

endmethod.

TO ADD AN ERROR MESSAGE FOR SAME TYPE SELECTION.

1. Go to Component Structure Browser.2. Go to Our view (for eg: ZCHANDUBSP/TESTVIEW).3. Go to EventHanlder4. Open method EH_ONOPP_TYPE_SELECTED add below code to the existing code.

Create ZMSGCL: To Display Message

1. Go SE912. Provide Message Class: ZMsgcl4. Click on Create.5. Go to Message Tab.Write Below Code in the Message Tab.

000: LEADTYPE &1 ALREADY EXIST

Add below code to the existing code.( show pop up code ).

  LR_COL ?= TYPED_CONTEXT->TESTNODE->COLLECTION_WRAPPER.

  LR_ITR ?= LR_COL->GET_ITERATOR( ).

  LR_ENTITY ?= LR_ITR->GET_FIRST( ).

Page 21: EPIC-Web Ui Architecture

  WHILE LR_ENTITY IS BOUND.    IF LR_ENTITY->GET_PROPERTY_AS_STRING( IV_ATTR_NAME = 'LEADTYPE' ) = LR_EVENT->SELECTION AND SY-INDEX NE V_INDEX.

      CALL METHOD LR_MSG->ADD_MESSAGE        EXPORTING          IV_MSG_TYPE       = 'E'          IV_MSG_ID         = 'ZMSGCL'          IV_MSG_NUMBER     = '000'*          IV_MSG_TEXT       =          IV_MSG_V1         = LR_EVENT->SELECTION

          IV_SHOW_ONLY_ONCE = 'X'          IV_MSG_LEVEL      = '1'.

    ENDIF.                LR_ENTITY ?= LR_ITR->GET_NEXT( ).   ENDWHILE.

Creation of POPUP DIALOG

Requirement: If We change the LEADTYPE the pop up should be displayed as                         Dependencies Exist do you want to change them.

CONFIRMATION POP UP DIALOG DISPLAY CODE

1. Go to Component Structure Browser.2. Go to Our view (for eg: ZCHANDUBSP/TESTVIEW).3. Go to EventHanlder4. Open method EH_ONOPP_TYPE_SELECTED add below code to the existing code.

Some prerequisite information has to follow

The Attributes that should be declared in Implementation Class

1. GR_CONF_POPUP  Instance Attribute Type Ref To IF_BSP_WD_POPUP.2. V_INDEX TYPE I.

Add below code to the existing code.( show pop up code ).

************* SHOW POPUP CODE ***************LR_ENTITY ?= TYPED_CONTEXT->TESTNODE->COLLECTION_WRAPPER->FIND( IV_INDEX = V_INDEX ).

IF LR_ENTITY->GET_PROPERTY_AS_STRING( IV_ATTR_NAME = 'LEADTARGET' ) IS NOT INITIAL OR   LR_ENTITY->GET_PROPERTY_AS_STRING( IV_ATTR_NAME = 'PARTNER' ) IS N

Page 22: EPIC-Web Ui Architecture

OT INITIAL.

  CALL METHOD COMP_CONTROLLER->WINDOW_MANAGER->CREATE_POPUP_2_CONFIRM    EXPORTING      IV_TITLE          = 'DEPENDANCY CONFIRMATION'      IV_TEXT           = 'DEPENDANCY EXIST. DO YOU WANTO TO CANCEL'      IV_BTNCOMBINATION = IF_BSP_WD_WINDOW_MANAGER=>CO_BTNCOMB_YESNOCANCEL*      IV_CUSTOMBUTTONS  =    RECEIVING      RV_RESULT         =  GR_CONF_POPUP.

  CALL METHOD GR_CONF_POPUP->SET_ON_CLOSE_EVENT  EXPORTING          IV_VIEW = ME          IV_EVENT_NAME = 'CONF_POP_CLOSED'.

  GR_CONF_POPUP->OPEN( ). ENDIF.

Code for Event Handler CONF_POP_CLOSED.

1. Go to Component Structure Browser.

2. Go to Our view (for eg: ZCHANDUBSP/TESTVIEW).

3. Go to EventHanlder.->Right Click->Create

         Provide Event Name as: CONF_POP_CLOSED ->enter

4. Double Click On method EH_ CONF_POP_CLOSED.          

Write the Below Code in EH_CONF_POP_CLOSED.

method EH_ONCONF_POP_CLOSED.            DATA: V_PLUG TYPE SEOCMPNAME,        LR_ENTITY TYPE REF TO IF_BOL_BO_PROPERTY_ACCESS.

        V_PLUG = GR_CONF_POPUP->GET_FIRED_OUTBOUND_PLUG( ).

        IF V_PLUG = 'YES'.          LR_ENTITY ?= TYPED_CONTEXT->TESTNODE->COLLECTION_WRAPPER

                                            -> FIND( IV_INDEX = V_INDEX ).          LR_ENTITY->    SET_PROPERTY_AS_STRING( IV_ATTR_NAME = 'LEADTARGET' IV_VALUE = '').          LR_ENTITY-> SET_PROPERTY_AS_STRING( IV_ATTR_NAME = 'PARTNER' IV_VALUE = '').

        ENDIF.endmethod.

Page 23: EPIC-Web Ui Architecture

Saving Custom Data From Webui to Our Custom Table ( EH_ONSAVE )

STEP1:

1. Go to Component Structure Browser.2. Go to CustomController3. Select Any CustomeController( for eg: BT111H_OPPT/OpptDetailsCuCo ).4. Right Click on above Customcontrol.5. select Enhance.( after enhancing your zclass of impl & contx wil be created).6. Go to Context->ContexNode->Right Click on Context Node->Select Create.

ContextNode Creation=====================1. Start2. Define ContextNode.

  Provide Name: OpptCn.  Select  ValueNode RadioButton.  Continue.

3.  Add Value.  Add AbapDictionaryType  Provide DDIC Structure: ZDemo_Cus_lead.  Continue.

4. Create Links to CustomController->Continue.5. Complete.

Save Details………………STEP2:

1. Go to VIEWS From Component Structure Browser.2. Go to Context->Context Node->select your ContextNode->Right Click On    Context Node( OpptCn) ->Select Create Binding.3. Provide Following Details:            BspApplication           : BT111H_OPPT.            ControllerType            : CustomController.            CustomController       : OpptDetailsCuCo.do            TargetContextNode    : OpptCn.

STEP3:

1. Go To Componet Structure Browser->Views.2. Enhance BT111H_OPPT/OpportunityOVViewSet.3. Double Click on BT111H_OPPT/OpportunityOVViewSet.4. Go to EventHandler.5. Select EH_ONSAVE.6. Right Click EH_ONSAVE and Redefine.

Write the Following Code in EH_ONSAVE

Page 24: EPIC-Web Ui Architecture

method EH_ONSAVE.

CALL METHOD SUPER->EH_ONSAVE  EXPORTING    HTMLB_EVENT    = HTMLB_EVENT    HTMLB_EVENT_EX =  HTMLB_EVENT_EX.

DATA: LR_CUCO TYPE REF TO  ZL_BT111H_O_OPPTDETAILSCU_IMPL,(the above class is whatever we enhanced in CustomContoller….).      LR_COL TYPE REF TO IF_BOL_BO_COL,      LR_ITR TYPE REF TO IF_BOL_BO_COL_ITERATOR,      IT_DATA TYPE STANDARD TABLE OF ZDEMO_CUS_LEAD,      LR_ENTITY TYPE REF TO IF_BOL_BO_PROPERTY_ACCESS,      LR_BTADMINH TYPE REF TO CL_CRM_BOL_ENTITY,      WA_DATA TYPE ZDEMO_CUS_LEAD.

LR_CUCO ?= GET_CUSTOM_CONTROLLER( CONTROLLER_ID = 'BT111H_OPPT/OpptDetailsCuCo' ).LR_BTADMINH ?= TYPED_CONTEXT->BTADMINH->COLLECTION_WRAPPER->GET_CURRENT( ).WA_DATA-LEADGUID = LR_BTADMINH->GET_PROPERTY_AS_STRING( IV_ATTR_NAME = 'GUID' ).

LR_COL ?= LR_CUCO->ZTYPED_CONTEXT->OPPTCN->COLLECTION_WRAPPER.

LR_ITR ?= LR_COL->GET_ITERATOR( ).LR_ENTITY ?= LR_ITR->GET_FIRST( ).

WHILE LR_ENTITY IS BOUND.  LR_ENTITY->GET_PROPERTIES( IMPORTING ES_ATTRIBUTES = WA_DATA ).

  APPEND WA_DATA TO IT_DATA.  LR_ENTITY ?= LR_ITR->GET_NEXT( ).ENDWHILE.

    MODIFY ZDEMO_CUS_LEAD FROM TABLE IT_DATA.Endmethod.

SEARCHING BASED ON LEADTYPE ( EH_ONSEARCH )

STEP1 (Create New Enhancement Set for Search Component).1. Go to Transaction: BSP_WD_CMPWB.2. Provide Component as BT111S_OPPT .

( Because it is the search component for  BT111H_OPPT).Provide Component                : BT111S_OPPTProvide Enhancement Set       : ZSearch.Click On Create.Provide Short Text.

Page 25: EPIC-Web Ui Architecture

3. Click Display for Created Enhancement.4. Click on Enhancement Componenet.5. Provide Enhancement Set: ZSearch.6. Provide Bsp Application: ZSearchBsp ->Enter->yes->Enter.7. Save Enhancement.

Step2.1. Go to Componenet Structure Browser.2. Right Click on BT111S_OPPT/Search->Select Enhance.3. Double Click on BT111S_OPPT.4. Go to ViewStructure->Event Handler->Select EH_ONSEARCH ->Right Click    Select Redefine.5. Double Click on EH_ONSEARCH.6. Go to Change Mode.7. Write the Code.Provide Below Details in Implementation Class

1. Attributes:GT_ORIGINAL_SEARCH_CRITERIA Instance Attribute public Type GENILT_SELECTION_PARAMETER_TAB

2. Methods:      1. SAVE_UI_SEARCH_CRITERIA       Parameters: IR_QS importing Type Ref To CL_CRM_BOL_DQUERY_SERVICE   2. RESTORE_UI_SEARCH_CRITERIA       Parameters: IR_QS importing Type Ref To CL_CRM_BOL_DQUERY_SERVICEmethod EH_ONSEARCH.

  DATA: LR_QS TYPE REF TO CL_CRM_BOL_DQUERY_SERVICE,        LR_SEL_COL TYPE REF TO IF_BOL_BO_COL,        LR_ENTITY TYPE REF TO IF_BOL_BO_PROPERTY_ACCESS,        WA_PARAM TYPE GENILT_SELECTION_PARAMETER,        IT_DATA TYPE STANDARD TABLE OF ZDEMO_CUS_LEAD,        IT_SEL_TYPE TYPE STANDARD TABLE OF SELOPTTAB,        WA_SEL TYPE SELOPTTAB,        WA_DATA TYPE ZDEMO_CUS_LEAD,        LV_LOW TYPE STRING.

      LR_QS ?= TYPED_CONTEXT->SEARCH->COLLECTION_WRAPPER->GET_CURRENT( ).

        SAVE_UI_SEARCH_CRITERIA( IR_QS = LR_QS ).

        LR_SEL_COL ?= LR_QS->GET_SELECTION_PARAMS( ).        LR_ENTITY ?= LR_SEL_COL->GET_FIRST( ).        WHILE LR_ENTITY IS BOUND.          LR_ENTITY->GET_PROPERTIES( IMPORTING ES_ATTRIBUTES = WA_PARAM ).

          IF WA_PARAM-ATTR_NAME = 'LEADTYPE'.

Page 26: EPIC-Web Ui Architecture

            MOVE-CORRESPONDING WA_PARAM TO WA_SEL.            APPEND WA_SEL TO IT_SEL_TYPE.          ENDIF.

          LR_ENTITY ?= LR_SEL_COL->GET_NEXT( ).        ENDWHILE.

          SELECT * FROM ZDEMO_CUS_LEAD INTO TABLE IT_DATA          WHERE LEADTYPE IN IT_SEL_TYPE.

            LOOP AT IT_DATA INTO WA_DATA.              LV_LOW = WA_DATA-LEADID.              CALL METHOD LR_QS->ADD_SELECTION_PARAM                EXPORTING                  IV_ATTR_NAME = 'OBJECT_ID'                  IV_SIGN      = 'I'                  IV_OPTION    = 'EQ'                  IV_LOW       = LV_LOW.

           ENDLOOP.

CALL METHOD SUPER->EH_ONSEARCH  EXPORTING    HTMLB_EVENT    = HTMLB_EVENT    HTMLB_EVENT_EX =  HTMLB_EVENT_EX.

    RESTORE_UI_SEARCH_CRITERIA( EXPORTING IR_QS = LR_QS ).endmethod.

The Code for  Below two Methods SAVE_UI_SEARCH_CRITERIA & RESTORE_UI_SEARCH_CRITERIA available In Repository Information System (SE15).

SAVE_UI_SEARCH_CRITERIA code.

method SAVE_UI_SEARCH_CRITERIA.    DATA: lr_selparam_col TYPE REF TO if_bol_bo_col.

  CALL METHOD ir_qs->get_selection_params    RECEIVING      rv_result = lr_selparam_col.

  DATA: lv_iterator  TYPE REF TO if_bol_bo_col_iterator,        lv_param     TYPE REF TO if_bol_bo_property_access.  DATA: ls_selection TYPE genilt_selection_parameter.

Page 27: EPIC-Web Ui Architecture

  REFRESH gt_original_search_criteria.

  TRY.      lv_iterator = lr_selparam_col->get_iterator( ).      lv_param    = lv_iterator->get_first( ).      WHILE lv_param IS BOUND.*       Get the attributes out       lv_param-> get_properties( IMPORTING es_attributes = ls_selection ).* save in global instance varialbe for later reuse.        APPEND ls_selection TO gt_original_search_criteria.*       Get all the entitys from the collection        lv_param = lv_iterator->get_next( ).      ENDWHILE.    CATCH cx_sy_ref_is_initial.                         "#EC NO_HANDLER  ENDTRY.endmethod.

RESTORE_UI_SEARCH_CRITERIA code.

method RESTORE_UI_SEARCH_CRITERIA.    DATA: col TYPE REF TO if_bol_bo_col.  FIELD-SYMBOLS: <ls_selection_parameters> TYPE genilt_selection_parameter.

  col = ir_qs->get_selection_params( ).

* clear the selection parameter collection....  CALL METHOD col->clear .

  LOOP AT gt_original_search_criteria ASSIGNING <ls_selection_parameters>.

* to have the original UI selection param table for the search    CALL METHOD ir_qs->add_selection_param      EXPORTING        iv_attr_name = <ls_selection_parameters>-attr_name        iv_sign      = <ls_selection_parameters>-sign        iv_option    = <ls_selection_parameters>-option        iv_low       = <ls_selection_parameters>-low        iv_high      = <ls_selection_parameters>-high.ENDLOOP.endmethod.

Page 28: EPIC-Web Ui Architecture

AET (APPLICATION ENHANCEMENT TOOL)-------------------------------------------------

1.      AET is available from version 7.0 onwards2.      Any program is starts with ‘AXT’  means that is belongs to AET3.      AET is used to add the custom field to standard application.

DEMO:---------STEP 1: (ONE TIME ACTIVITY PER CLIENT)--------

1.      TCODE : AXTSYS2.      Provide package for extension :   zvicky3.      provide name space                  :   z

  STEP 2:  --------

1.      Goto webui  (CRM_UI)2.      Click on personalize(user level )3.      under settings,click on personalize settings4.      select Enable configuration mode check box5.      save.(after save one button will appear on screen with some text ‘show configuration area’).6.      In the UI , select Opportunity7.      On the screen, click on show configurable area8.      single click on blue screen where you want add the field in the application.9.      A new window is displayed with configurations10.  under that window select create new field

11.  select one business object (opportunity)12.  select ORDERADM_H from object part(for add a         field to header view.13.  click on ok .14.  Provide field label : TEST ACTION15.  Data type               : Text with capital letter16.  length                     :  2017.  search relavent      :  search and result(f4)18.  Enable the generate check box19.  select translations( for different languages)

      (Note the enhancement id in notepad)             20. click on back,click on enable expert mode button                       (for adding our own field id and data element)              21. click on your enhancement id then we will get one                    Window              22. provide field id : zztest_aet(always starts ‘zz’)                    Provide data element : zoppt_type->enter.              23. click on back              24. click on save and generate button.              25. select choose button request number              26. Goto UI then check ur field added or not.             27. SELECT SHOW CONFIGURABLE AREAS.            28. CLICK ON HEADER AREA.            29. WEB PAGE DIALOG WILL OPEN.

Page 29: EPIC-Web Ui Architecture

            30.IN AVAILABLE FIELDS WE CAN SEE OUR FIELD WHICH IS ADDED BY AET.            31.MAKE IT DISPLAYED FIELD.            32.WE CAN SEE THE FIELD IN STANDARD COMPONENT.

EEWB(EASY ENHANCEMENT WORKBENCH)--------------------------------------------------

  EEWB is used in <7.0 version.  Here we are using project to do enhancement  It is used to add the new field to the standard one

        DEMO :        --------

1.      TCODE:EEWB2.      Enter filter    : project3.      name             : zproject ->enter.4.      create5.      description : my enhancement on eewb6.      package      : zvicky7.      save8.      under create field select change for two fields9.      save

step 2:-------

1.      Right  click on customized project2.      create extension3.      provide the following things

      Name   :           zeewb_vicky      Desription:      my extension     EEWB bus.obj:  Opportunity (using f4 select suitable               Extension type: Opport_h (using f4)

4.      click on ok5.      then we wil get wizard

step 3:-------

1.      click on continue2.      provide extension title : zeewb_extvicky->continu3.      under business transaction types select CRM Opportunity->continue4.      provide field label :  Test EEWBvicky5.      Data type              :   character string6.      field length                        :   20->continue7.      Enable header check box8.      sub object               : adminstration header(use f4)9.      continue10.  Enable search check box->continue11.  complete12.  click on CRM_BTX_ADD_NEW_FIELDS we can see  all the details of customization.

Page 30: EPIC-Web Ui Architecture

step 4:-------

1.      Goto Tcode :SE112.      Provide table name : CRMD_ORDERADM_H3.      Display4.      click on include: CRMT_ORDERADM_H_EXT5.      Here we will check our field added or not, through our description.

                           CUSTOM COMPONENT CREATION

For  Custom Component Creation  we have to follow the below steps

 CUSTOM COMPONENT CREATION

For  Custom Component Creation  we have to follow the below steps

1.create custom component2.create custom model

3.create custom entities

4.create Genil class.

   The Technical name of model is nothing but “Component set”.The component set have set of components.This component set is  different from our workbench component.Note:All the partener related entities put in a componet “BP”.In The  Component set have several components.The component it self have component set.STEP1:MODEL CREATION Goto tcode:sproCustomer relationship managementCrm cross applicationsGeneric interaction layer/object layerBasic settingsUnder dialog structureGoto component definitionSelect change modeClick on new entries

Component name         : zkyrcompDescription                    : component18

Page 31: EPIC-Web Ui Architecture

Implementation class   : Zcl_Demo_GenilObject table                   : Zdemo_objectModel table                    : Zdemo_model                        Save

Goto component set definition                    New entrisComponentset   : ZcompsetDescription        : Componentset

Goto componet Assignment                     New entriesCompnent name   : ZkyrcompDescription            : Component18                       Save.

From component set definition -> select the standard BP component Select the object table :crmc_allobj_buil

CREATE ENTRIES FOR OBJECT TABLE: Goto se11 Database table : crmc_allobj_buil.                        Select copyProvide target table : zdemo_object     Select utilities-> Create entries

Object name          : rootobjOnjectkind             : A (f4)( root object )Attr structure        : zkyr (user defined structure)                            SaveObject name           : searchobjOnjectkind              : G (f4)( dynamic search  object )Attr structure         : zkyr (user defined structure)Root object              : RootobjResult object name : resultobj                          SaveObject name           : ResultobjOnjectkind              : E(f4) (search result objectAttr structure         : zkyr (user defined structure)Rootobject               : Rootobj

                            Save.

Page 32: EPIC-Web Ui Architecture

CREATE ENTRIES IN MODEL TABLE :Copy the table from standard BP component Goto se11 Database table : CRMC_MODEL_BUIL            Copy Target table     : Zdemo_model->enter In the fields Select  field  object_a Select the check table(primary key)  Provide the check table : zdemo_object(primary key table) Select the field object_bSelect the check table(primary key)  Provide the check table : zdemo_object(primary key table)                 Save and activate

Select utilities->create entries   Object A            : resultobj(f4)   Relation name   : result root rel   ObjectB              : rootobj   Card A               :  c(f4)   Card B               : c(f4)   Relation kind     : A (f4)                           save

GENIL CLASS CREATION:                      Goto : se24         Class :Zcl_demo_genil.                      Create         Description : genil class creation                Select  create inheritance          Super class : CL_CRM_BUIL->enter(This super class select from any one genil class super class of standard component)

From the methods  select the method get_object_props and redefine the method                     method IF_GENIL_APPL_MODEL~GET_OBJECT_PROPS.

  select * from zcmpt_object into CORRESPONDING FIELDS OF TABLE RT_OBJ_PROPS.

endmethod.(rt_obj_props it is a returning parameter of the method)

From the methods select the method get_model and redefine the methodmethod IF_GENIL_APPL_MODEL~GET_MODEL.

Page 33: EPIC-Web Ui Architecture

  select * from zcmpt_model into CORRESPONDING FIELDS OF TABLE rt_relation_det.endmethod.Select * from Zdemo_model into corresponding fields of table rt_relation_det.(rt_relation_det is the returning parameter of the method)

To Test Model:

Select tcode : Genil_Model_Browser Provide component set : Zcompset      We can check our attributes under root object,search resut object and dynamic search objects

   Component Creation: Component : Zcus_component18                                  Create  Window name : mainwindow                                    Save   Goto runtime repository editor   Select change mode                  Right click on models     Add model    Component set : Zcompset                                    Save    Right  click on views     Create view                 Continue     Name : searchview                   Continue

       Add model node  Model nodes : searchcn  Bol entity       : searchobj(f4)                   Continue

  Add model attributes           Select required fields->enter                       Continue                       Continue                       Continue Select empty view                  Save

Note: 1.cl_bsp_wd_advsearch_controller.This is the super class of controller

Page 34: EPIC-Web Ui Architecture

          2.cl_bsp_wd_context_node_asp.This is the super class of context node class.          3.cl_bsp_wd_context_node_tv.This is the super class of table view         

Changing the empty view as search view:                                       Double click on component controller class       Change edit mode       Change inherit       Change superclass instead of standard super class       Super class : cl_bsp_wd_advsearch_controller.

       Double click on component context node class       Change edit mode       Change inherit       Change superclass instead of standard super class       Super class : cl_bsp_wd_context_node_asp.

     Goto search.htm      open the any standard search.htm and copy the code and paste the code into our       custom componet  search.htm

    ADDING THE CONFIGURATION TAB TO SEARCH VIEW Goto : se80Select bsp applicationOpen our custom componentSelect the change modeClick on tag browser

Drag and drop the <chtmlb.configAnd drag and drop the xml tag from standard configuration/>Goto our custom componentSelect configurationSelect new configurationMove th fields from available to display fieldsSave

Right click on viewCreate viewContinueName : resultviewContinueAdd modelnode

Model nodes : resultcn

Page 35: EPIC-Web Ui Architecture

Bol entity      : resultobj

Select the required fields->enterContinueContinueSelect configurationContinueContinueSelect configuration and select tableviewMove the field from available to display.Save.ADDING VIEW TO VIEWSET: Right click on viewCreate view setName : searchviewsetLine    : 2Col      : 1Viewarea : searchviewareaRow         : 1Col           : 1Rowspan : 1Colspan   : 1Viewarea  : result viewRow         : 2Col           : 1Rowspan : 1Colspan   : 1ContinueGoto runtime repository editor systemSelect change modeGoto view setRight click on searchview view areaAdd viewView : searchviewSave

Goto view setRight click on searchview view areaAdd viewView : searchviewSaveADDING VIEWSET TO WINDOW :Right click on window                     Add window                     View  : searchviewset                             Save

Page 36: EPIC-Web Ui Architecture

      Test the viewset is available or added or not          Component : zcus_component18                            Test.ADDING BUTTONS TO CUSTOM COMPONENT: Goto se80Open our custom componentUnder viewOpen searchview.htmOpen tagbrowserFrom  thtmlbDrag and drop<thtmlb.buttonId    =   “SEARCH”Onclick   =   “SEARCHBTN”Text        = “search”Enabled   = “TRUE”/>.                                 Drag and drop<thtmlb.buttonId        =   “SEARCH”Onclick    =   “SEARCHBTN”Text          = “search”Enabled    = “TRUE”/>.Save and activate Maintain dropdown in searchview:    Goto controller class of search view          Double click on class           From  methods           Redefine the get_dquery_defiitions( ) method.        method GET_DQUERY_DEFINITIONS.

  CALL METHOD SUPER->GET_DQUERY_DEFINITIONS  RECEIVING    RT_RESULT =  RT_RESULT.

data : wa_result type CRMS_THTMLB_SEARCH_FIELD_INFO,       wa_ddlb type CRMS_THTMLB_SEARCH_DDLB_NVP,       v_index type i.

read table rt_result into wa_result with key field = 'LEADTYPE'.if sy-subrc = 0.  v_index = sy-tabix.  APPEND INITIAL LINE TO wa_result-ddlb_options.

Page 37: EPIC-Web Ui Architecture

  wa_ddlb-key = '11'.  wa_ddlb-value = 'Type1'.  append wa_ddlb to wa_result-ddlb_options.

  wa_ddlb-key = '12'.  wa_ddlb-value = 'Type2'.  append wa_ddlb to wa_result-ddlb_options.

  wa_ddlb-key = '13'.  wa_ddlb-value = 'Type3'.  append wa_ddlb to wa_result-ddlb_options.  modify rt_result from wa_result index v_index.  endif.endmethod.GENIL CLASS IMPLEMENTATION:         In our genil class redefine the method get_dynamic_query_result.UNDO REDEFINE THE GET_DYNAMIC_QUERY_RESULT  IN GENIL CLASS CREATED.THEN WE CAN SEE EMPTY METHOD  GET_DYNAMIC_QUERY_RESULT WITH OUT CODE.AGAIN REDEFINE THE GET_DYNAMIC_QUERY_RESULT.   Becoz when I click on search button to get the data we to implement the above method.method IF_GENIL_APPL_INTLAY~GET_DYNAMIC_QUERY_RESULT.

    data : it_sel_type type STANDARD TABLE OF selopttab,         it_sel_target type STANDARD TABLE OF selopttab,         it_sel_bp type STANDARD TABLE OF selopttab,         it_sel_id type STANDARD TABLE OF selopttab,         it_data type STANDARD TABLE OF ZDEMO_CUS_LEAD,         wa_data type ZDEMO_CUS_LEAD,         wa_sel type selopttab,         wa_param type  GENILT_SELECTION_PARAMETER,         lr_entity type ref to IF_GENIL_CONT_ROOT_OBJECT,         v_key type string.  if iv_query_name = 'SEARCHOBJ'.

    loop at it_selection_parameters into wa_param.      case wa_param-attr_name.        when 'LEADTYPE'.          MOVE-CORRESPONDING wa_param to wa_sel.          append wa_sel to it_sel_type.        when 'LEADTARGET'.          MOVE-CORRESPONDING wa_param to wa_sel.          append wa_sel to it_sel_target.

Page 38: EPIC-Web Ui Architecture

        when 'PARTNER'.          MOVE-CORRESPONDING wa_param to wa_sel.          append wa_sel to it_sel_bp.        when 'LEADID'.          MOVE-CORRESPONDING wa_param to wa_sel.          append wa_sel to it_sel_id.      ENDCASE.    endloop.    select * from ZDEMO_CUS_LEAD into table it_data       UP TO is_query_parameters-max_hits rows       where LEADTYPE in it_sel_type and              LEADTARGET in it_sel_target and              PARTNER in it_sel_bp and               LEADID in it_sel_id.

    loop at it_data into wa_data.      CONCATENATE                  wa_data-LEADID                  wa_data-LEADTYPE                  into v_key.      TRY.          CALL METHOD IV_ROOT_LIST->ADD_OBJECT            EXPORTING              IV_OBJECT_NAME = 'RESULTOBJ'              IS_OBJECT_KEY  = v_key*        IV_ATTR_REQ    = TRUE*        IV_KEY_IS_ID   = FALSE            RECEIVING              RV_RESULT      = lr_entity.

        CATCH CX_CRM_GENIL_DUPLICATE_REL .        CATCH CX_CRM_GENIL_MODEL_ERROR .      ENDTRY.      CALL METHOD LR_ENTITY->SET_ATTRIBUTES        EXPORTING          IS_ATTRIBUTES = wa_data.

    endloop.  endif.endmethod.Note:genil_bol_browser this tcode is used for we can test our search object result view is displayed or not.Custom Controller creation:         After creating the custom controller we have to maintain binding with the result view and acees the instance of cstom controller into search view becoz the data in search

Page 39: EPIC-Web Ui Architecture

view we want to pass the data into result view so we have create custom controller and maintain the binding.            Right click on custom controller            Create            ContinueName : searchresultcuco  ContinueAdd modelnode  Modelnode : resultcuco  Bol entity    : resultobj        ContinueSelect required fields Continue Continue Continue Complete

Bind the result view context node with custom controller node  Goto context node  Right click on resultcn Create bindController type : custom controllerCustom controller : searchresultcucoTarget : resultcucoSEARCH EVENT HANDLER CREATIONCreate SEARCHBTN EVENT HANDLER IN SEARCHVIEWmethod EH_ONSEARCHBTN.

  data : lr_qs type ref to cl_crm_bol_dquery_service,        lr_result_col type ref to IF_BOL_ENTITY_COL,        lr_cuco type ref to ZL_ZCUSTOM__SRCUCO_IMPL  ,        lr_col type ref to if_bol_bo_col.  lr_qs ?= typed_context->searchcn->collection_wrapper->get_current( ).     lr_result_col ?= lr_qs->get_query_result( ).lr_cuco ?= get_custom_controller( controller_id = 'ZCUSTOM_COMP11/SRCUCO' ).*lr_col ?= lr_cuco->typed_context->resultcuco->collection_wrapper.lr_cuco->typed_context->resultcuco->collection_wrapper->clear( ).lr_cuco->typed_context->resultcuco->collection_wrapper->add_collection(  lr_result_col ).endmethod.

ROW LEVEL BUTTONS ADDING

TECHNICALLY WE CAN CALL IT AS ONE CLICK ACTIONS. ROW LEVEL BUTTONS ARE PART OF CONTEXT NODE ATTRIBUTES.

Page 40: EPIC-Web Ui Architecture

IT HAS DIFF. STRUCTURES AND DATA ELEMENTS. IT WILL COME IN SEPERATE COLUMN IN VIEW UNDER ACTIONS. FOR THAT WE NEED SOME ENHACEMENT IN HTML CODE. IT HAS ONLY ONE EVENT FOR ALL THE BUTTONS. THESE BUTTONS ARE ENABLED EVEN WHEN THE VIEW IS IN DISPLAYMODE. THESE ARE LOCAL FOR ROW NOTHING BUT ONE RECORD.

REQUIREMENT: ADDING ROW LEVEL BUTTONS TO CUSTOM VIEW.  CREATE AN ACTION ATTRIBUTE TO CONTEXT NODE ATTRIBUTE.  GO TO OUR CUSTOM VIEW CREATED.  GO TO CONTEXT .  CONTEXT NODES.  ATTRIBUTES->RIGHT CLICK ON ATTRIBUTES.  CREATE.  IT PROMPTS A WIZARD.  CONTINUE.  SELECT ADD VALUE ATTRIBUTE.  CONTINUE.  PROVIDE ATTRIBUTE : THTMLBUTN_OCA.  DDIC : crm_thtmlb_one_click_action.  CONTINUE.  COMPLETE.

  MOVE THE ATTRIBUTE FROM AVAILABLE TO DISPLAY.  GO TO OUR VIEW .  CLICK ON CONFIGURATION TAB.  ACTION FIELD WE CAN SEE IN AVAILABLE FIELDS.  MOVE THE ACTION FIELD TO DISPLAY.  MAKE IT AS FIRST FIELD IN VIEW.  NO NEED TO CONFIGURE WITH YOUR ROLE KEY.  SAVE THE CONFIGURATION.  NOW WE CAN CHECK IN WEB-UI.  WE CAN SEE ACTIONS FIELD ADDED TO VIEW.

  MAKE CHANGES IN GET_P _ATTR METHOD IN ATTRIBUTE.  THIS CODE WE CAN COPY FROM STANDARD COMPONENT GET_P METHOD.  GO TO OUR CUSTOM VIEW CREATED.  GO TO CONTEXT .  CONTEXT NODES.  ATTRIBUTES : THTMLBUTN_OCA.  GO TO GET_P METHOD OF ATTRIBUTE.  DOUBLE CLICK ON THAT.  WRITE THE CODE AS FOLLOWS.

CASE iv_property.

Page 41: EPIC-Web Ui Architecture

 WHEN if_bsp_wd_model_setter_getter=>fp_fieldtype.  rv_value = cl_bsp_dlc_view_descriptor=>field_type_oca.    WHEN if_bsp_wd_model_setter_getter=>fp_onclick.      rv_value = 'one_click_actions'.  ENDCASE.

  ADD BUTTONS IN CONTEXT NODE CLASS.  IN CONTEXNODE WE HAVE A METHOD  GET_OCA_T_TABLE.  DOUBLE CLICK ON THE METHOD AND WRITE A CODE FOR BUTTONS.

method GET_OCA_T_TABLE.CALL METHOD SUPER->GET_OCA_T_TABLE  EXPORTING    IV_COMPONENT = IV_COMPONENT    IV_INDEX     = IV_INDEX  RECEIVING    RT_ACTIONS   = RT_ACTIONS.

    DATA : WA_BUTTON TYPE CRMT_THTMLB_ONE_CLICK_ACTION.

    WA_BUTTON-ID  = 'DELETEOCA'.    WA_BUTTON-ACTIVE = 'X'.    WA_BUTTON-ICON = 'DELETE.GIF'.    APPEND WA_BUTTON TO RT_ACTIONS.

    WA_BUTTON-ID = 'COPYOCA'.    WA_BUTTON-ACTIVE = 'X'.    WA_BUTTON-ICON = 'COPY.GIF'.    APPEND WA_BUTTON TO RT_ACTIONS.

         SAVE AND ACTIVATE THE METHOD .           F3         ACTIVATE THE CONTEXT NODE CLASS.

  CREATE EVENT HANDLER WITH SAMEN NAME AS GIVEN INTHE GET_P_ATTR METHOD.

  GO TO OUR VIEW.  GO TO EVENT HANDLER.  CREATE EVENT FOR 'one_click_actions'

DATA:V_ID TYPE STRING,        V_INDEX TYPE STRING.

  SPLIT HTMLB_EVENT_EX->EVENT_DEFINED AT '.' INTO V_ID V_INDEX.

  CASE V_ID.        WHEN 'DELETEOCA'.

          WHEN 'COPYOCA'.

Page 42: EPIC-Web Ui Architecture

  ENDCASE.

  IN EVENT HANDLER WE HAVE TO WRITE CODE FOR DELETEOCA AND COPYOCA.

UPLOAD MASSCHANGE AND REPORT

HOW TO FIND THE ROOT OBJECTS OF CONTEXT NODES AND THEIR RELATION?WE CAN FIND OUT BY DEBUGGING.DEBUGGING PROCESS:

         PUT THE EXTERNAL BREAK POINT IN DO_PREPARE_OUTPUT.         OPEN CRM UI.         IT PROMPTS DEBUGGING SCREEN.         IF U WANT KNOW THE ROOT NODE OF BTADMINH.         PROVIDE TYPED_CONTEXT->BTADMINH->COLLECTION_WRAPPER IN

OBJECT SPACE .         CLICK ON ENTER THEN WE CAN GET THE INSTANCE.         CLICK ON THAT INSTANCE.         WE GET COLLCTION_REF->CLICK ON THAT.         WE GET COLLECTION.         CLICK ON THAT COLLECTION WE WILL GET ENTITY LIST.         CLICK ON THAT ENTITY LIST.         WE WILL GET ENTITY CLASS.         IN THAT ENTITY CLASS THERE IS AN ATTRIBUTE CONTAINER_PROXY.         IN CONTAINER_ PROXY ,WE WILL HAVE DATA_REF         WE WILL GET DATA_REF AND PARENT.         KEEP ON CLICKING PARENT UNTIL WE GET PARENT AS INITIAL.         THEN CLICK ON DATA REF WE CAN GET ROOT OBJECT.         WE CAN GET RELATION NAME BY THE SAME SCREEN.

MASS UPDATE:

REPORT  ZDEMO_BOL_CHANGE.

data : lr_core type ref to cl_crm_bol_core,       lr_factory type ref to CL_CRM_BOL_ENTITY_FACTORY,       lr_btorder type ref to cl_crm_bol_entity,       lr_btadminh type ref to cl_crm_bol_entity,       lr_btpartnerset type ref to cl_crm_bol_entity,

Page 43: EPIC-Web Ui Architecture

       lr_btpartner type ref to cl_crm_bol_entity,       lr_tx type ref to IF_BOL_TRANSACTION_CONTEXT,       it_param type CRMT_NAME_VALUE_PAIR_TAB,       wa_param type CRMT_NAME_VALUE_PAIR,       v_id type string.

lr_core = cl_crm_bol_core=>get_instance( ).

lr_core->load_component_set( IV_COMPONENT_SET_NAME = 'ONEORDER' ).

*loop at it itab into waTRY.CALL METHOD LR_CORE->GET_ROOT_ENTITY  EXPORTING    IV_OBJECT_NAME = 'BTOrder'    IV_OBJECT_GUID = 'E244DDB061A884F19B5A001517354D1C'  RECEIVING    RV_RESULT      = lr_btorder . CATCH CX_CRM_GENIL_MODEL_ERROR .ENDTRY.TRY.    CALL METHOD LR_BTORDER->GET_RELATED_ENTITY      EXPORTING        IV_RELATION_NAME = 'BTOrderHeader'*    IV_MODE          = NORMAL      RECEIVING        RV_RESULT        = lr_btadminh.  CATCH CX_CRM_GENIL_MODEL_ERROR .ENDTRY.

*if lr_btadminh is not bound.**  endif.

lr_btadminh->set_property_as_string( iv_attr_name = 'DESCRIPTION'                                      iv_value = 'Test BOL Change' ). "wa-descriptionlr_core->modify( ).lr_tx = lr_btorder->get_transaction( ).if lr_tx->save( ) = abap_true.  lr_tx->commit( ).  v_id = lr_btadminh->get_property_as_string( iv_attr_name = 'OBJECT_ID' ).else.  lr_tx->rollback( ).endif.write v_id.ALV REPORT

Page 44: EPIC-Web Ui Architecture

REPORT  ZDEMO_BOL_REPORT.data : lr_core type ref to cl_crm_bol_core,       lr_factory type ref to CL_CRM_BOL_ENTITY_FACTORY,       lr_btorder type ref to cl_crm_bol_entity,       lr_btadminh type ref to cl_crm_bol_entity,       lr_btpartnerset type ref to cl_crm_bol_entity,       lr_btpartner type ref to cl_crm_bol_entity,       lr_tx type ref to IF_BOL_TRANSACTION_CONTEXT,       lr_qs type ref to cl_crm_bol_dquery_service,       it_param type CRMT_NAME_VALUE_PAIR_TAB,       wa_param type CRMT_NAME_VALUE_PAIR,       lr_result_col type ref to if_bol_bo_col,       v_id type string,       v_low type string,       v_high type string.tables : crmd_orderadm_h.SELECT-OPTIONS : s_id for crmd_orderadm_h-object_id.PARAMETERS : p_hits type GENILT_UNSIGNED_INT4.lr_core = cl_crm_bol_core=>get_instance( ).

lr_core->load_component_set( IV_COMPONENT_SET_NAME = 'ONEORDER' ).CALL METHOD CL_CRM_BOL_DQUERY_SERVICE=>GET_INSTANCE  EXPORTING    IV_QUERY_NAME = 'BTQOpp'  RECEIVING    RV_RESULT     = lr_qs.loop at s_id.  v_low = s_id-low.  v_high = s_id-high.CALL METHOD LR_QS->ADD_SELECTION_PARAM  EXPORTING    IV_ATTR_NAME = 'OBJECT_ID'    IV_SIGN      = s_id-sign    IV_OPTION    = s_id-option    IV_LOW       = v_low    IV_HIGH      = v_high. endloop.

v_id = p_hits.lr_qs->set_property_as_string( iv_attr_name = 'MAX_HITS'                                iv_value = v_id ).

*an internal table and wa with all the fields to e displayedlr_result_col ?= lr_qs->get_query_result( ).

lr_entity ?= lr_result_col->get_first( ).

Page 45: EPIC-Web Ui Architecture

while lr_entity is bound.

*  lr_entity->get_properties( es_attributes = wa )  TRY.    CALL METHOD LR_entity->GET_RELATED_ENTITY      EXPORTING        IV_RELATION_NAME = 'BTADVSOpp'*    IV_MODE          = NORMAL      RECEIVING        RV_RESULT        = lr_btorder.

  CATCH CX_CRM_GENIL_MODEL_ERROR .ENDTRY.

*  append wa to itab  lr_entity ?= lr_result_col->get_next( ).  endwhile.*loop at it itab into wa

*TRY.*CALL METHOD LR_CORE->GET_ROOT_ENTITY*  EXPORTING*    IV_OBJECT_NAME = 'BTOrder'*    IV_OBJECT_GUID = 'E244DDB061A884F19B5A001517354D1C'*  RECEIVING*    RV_RESULT      = lr_btorder .** CATCH CX_CRM_GENIL_MODEL_ERROR .*ENDTRY.***TRY.*    CALL METHOD LR_BTORDER->GET_RELATED_ENTITY*      EXPORTING*        IV_RELATION_NAME = 'BTOrderHeader'**    IV_MODE          = NORMAL*      RECEIVING*        RV_RESULT        = lr_btadminh.**  CATCH CX_CRM_GENIL_MODEL_ERROR .*ENDTRY.

*if lr_btadminh is not bound.*

Page 46: EPIC-Web Ui Architecture

*  endif.

*lr_btadminh->set_property_as_string( iv_attr_name = 'DESCRIPTION'*                                      iv_value = 'Test BOL Change' ). "wa-description*lr_core->modify( ).

lr_tx = lr_btorder->get_transaction( ).

if lr_tx->save( ) = abap_true.  lr_tx->commit( ).  v_id = lr_btadminh->get_property_as_string( iv_attr_name = 'OBJECT_ID' ).else.  lr_tx->rollback( ).endif.write v_id.UPLOAD

REPORT  ZDEMO_BOL_UPLOAD.

data : lr_core type ref to cl_crm_bol_core,       lr_factory type ref to CL_CRM_BOL_ENTITY_FACTORY,       lr_btorder type ref to cl_crm_bol_entity,       lr_btadminh type ref to cl_crm_bol_entity,       lr_btpartnerset type ref to cl_crm_bol_entity,       lr_btpartner type ref to cl_crm_bol_entity,       lr_tx type ref to IF_BOL_TRANSACTION_CONTEXT,       it_param type CRMT_NAME_VALUE_PAIR_TAB,       wa_param type CRMT_NAME_VALUE_PAIR,       v_id type string.

lr_core = cl_crm_bol_core=>get_instance( ).

lr_core->load_component_set( IV_COMPONENT_SET_NAME = 'ONEORDER' ).

*loop at it itab into wa

CALL METHOD LR_CORE->GET_ENTITY_FACTORY  EXPORTING    IV_ENTITY_NAME = 'BTOrder'  RECEIVING    RV_RESULT      = lr_factory.

wa_param-name = 'OBJECT_TYPE'.wa_param-value = 'BUS2000111'.append wa_param to it_param.

Page 47: EPIC-Web Ui Architecture

wa_param-name = 'PROCESS_TYPE'.wa_param-value = 'OPFS'.append wa_param to it_param.

CALL METHOD LR_FACTORY->CREATE  EXPORTING    IV_PARAMS = it_param  RECEIVING    RV_RESULT = lr_btorder.

TRY.    CALL METHOD LR_BTORDER->GET_RELATED_ENTITY      EXPORTING        IV_RELATION_NAME = 'BTOrderHeader'*    IV_MODE          = NORMAL      RECEIVING        RV_RESULT        = lr_btadminh.

  CATCH CX_CRM_GENIL_MODEL_ERROR .ENDTRY.

*if lr_btadminh is not bound.**  endif.

lr_btadminh->set_property_as_string( iv_attr_name = 'DESCRIPTION'                                      iv_value = 'Test BOL Upload' ). "wa-descriptionlr_core->modify( ).TRY.    CALL METHOD LR_BTADMINH->CREATE_RELATED_ENTITY      EXPORTING        IV_RELATION_NAME = 'BTHeaderPartnerSet'      RECEIVING        RV_RESULT        = lr_btpartnerset.  CATCH CX_CRM_GENIL_DUPLICATE_REL .  CATCH CX_CRM_GENIL_MODEL_ERROR .ENDTRY.

TRY.    CALL METHOD LR_Btpartnerset->CREATE_RELATED_ENTITY      EXPORTING        IV_RELATION_NAME = 'BTPartner_PFT_0006_MAIN'      RECEIVING        RV_RESULT        = lr_btpartner.

Page 48: EPIC-Web Ui Architecture

  CATCH CX_CRM_GENIL_DUPLICATE_REL .  CATCH CX_CRM_GENIL_MODEL_ERROR .ENDTRY.

lr_btpartner->set_property_as_string( iv_attr_name = 'PARTNER_NO'                                       iv_value = '3274' )."wa-partner

lr_core->modify( ).

lr_tx = lr_btorder->get_transaction( ).

if lr_tx->save( ) = abap_true.  lr_tx->commit( ).  v_id = lr_btadminh->get_property_as_string( iv_attr_name = 'OBJECT_ID' ).else.  lr_tx->rollback( ).endif.

write v_id.

BDOC'S

 Creating a BDoc  

Procedure

...       1.      From the SAP menu, choose Architecture and

Technology  Middleware  Development   Meta Object Modeling  BDoc Modeler.

The CRM BDoc Modeler Personal Filter screen appears.

       2.      Choose Execute.

The CRM BDoc Modeler screen appears.

       3.      Choose BDoc Type  Create BDoc Type.

The BDoc Overview tab appears on the right-hand side of the screen.

       4.      In the BDoc Identity group box in the Name field, type ZGEBDOC01 as the name of the BDoc.

       5.      In the Description field, type a description of the BDoc.

       6.      In the BDoc Class group box, select the Synchronization (Write) field.

       7.      In the Mobile Application Processing Type group box, select the Standard field.

The new BDoc appears in the Business Documents window.

Page 49: EPIC-Web Ui Architecture

Result

You have created a BDoc for the ZGE01 table. You can continue with Adding a Segment to the BDoc.

 Adding a Segment to the BDoc  

Procedure

...       1.      Continuing in the BDoc Modeler, in the BDoc Overview window,

select ZGEBCOC01 the BDoc you created.

       2.      Choose BDoc Type  Create Segment.

The Segment Overview tab appears in the work area.

       3.      In the Segment name field, type ZGESEGO1 as the name for the segment.

       4.      In the Description field, type Geographical information (countries and continents) as a short description for the segment.

       5.      Choose Save.

The Create Object Directory Entry dialog box appears.

       6.      Choose the Local Object pushbutton.

Result

You have added the segment to the BDoc. You can continue with Mapping the BDoc Segment to the Table.

      

      

        Mapping the BDoc Segment to the Table  

      Procedure

      ...             1.      Continuing in the BDoc Segment work area, choose the Mappings tab.

             2.      In the Mapped table field, type or select ZGE01.

             3.      In the Table Alias field, type ZGE01.

             4.      Choose the Segment Overview tab and choose the Direct Map pushbutton.

      The Direct Mapping screen appears.

             5.      In the Mapped Tables list, select the row containing your table, ZGE01.

             6.      Choose Get Fields.

      The fields from the ZGE01 table appear in the Segment Fields table.

             7.      Choose the >> pushbutton to select all fields.

             8.      Choose Execute.

             9.      Choose the Mappings tab and select the Update Map field.

         10.      Choose the Segment Fields tab.

      All fields you selected appear in the Segment Fields screen.

Page 50: EPIC-Web Ui Architecture

         11.      In the same line as the SFAGE01 field appears, select the Key field.

         12.      Choose Save.

      Result

      You have mapped the BDoc segment to the table. You can continue with Adding the BDoc Parameters.

      

      

        Adding the BDoc Parameters  

      Procedure

      ...             1.      In the Business Documents window, double click on the BDoc you created.

             2.      Choose the Parameters tab.

             3.      In the Name field, type SFAGE01 as the parameter.

      

      The parameter matches the information contained in the GUID entry from the Consolidated Database table.

             4.      In the Data Element field, type SMO_GUID.

      

      This matches the information contained in the Field type field of the GUID entry in the Consolidated Database table.

             5.      Choose Save.

      Result

      You have added the BDoc Parameters. You can continue with Adding the Where Clause.

      

 Adding the Where Clause  

Procedure

...       1.      From the BDoc Overview window, double click on the BDoc segment table that you

created, ZGE01.

The Where Clause screen appears.

       2.      Select the Mandatory field.

       3.      Choose the Detail View   pushbutton.

The Where 1 text box appears.

       4.      In the Where 1 text box, type <table alias name>.<fieldname><OP>:<parameter>, and choose Enter.

ZGEO.SFAZCOUNTRIES=:SFAZCOUNTRIES (Make sure there are no spaces.)

Page 51: EPIC-Web Ui Architecture

       5.      Make sure that the Operator column does not contain a value.

       6.      Choose Save.

Result

You have created the Where clause. You can continue with Activating the BDoc.

      

 Activating the BDoc  

Procedure

...       1.      Choose the Check pushbutton to ensure that the BDoc does not contain any errors.

If errors occur, rectify them in the BDoc, and test the changes again. For more information about the BDoc Modeler, see  CRM Business Document Modeler.

       2.      Choose the Activate pushbutton to activate your new BDoc.

Result

You have activated the BDoc. Continue with Mapping the BDoc to the Site Type.

      

 Mapping the BDoc to the Site Type  

Procedure

...       1.      Continuing with the BDoc Modeler, choose Goto  Site Type Mapping.

The Maintain Table Views: Initial Screen appears.

       2.      Choose Maintain.

The Determine Work Area: Entry dialog box appears.

       3.      In the BDOC Type field, type ZGEBDOC01 and choose Enter.

The View for BDoc type/Site type mappings: Overview screen appears.

       4.      Choose New Entries.

       5.      In the Site Type ID field, type or select CDB.

Press F4 to select the site type ID from the list.

       6.      Choose Save.

The Prompt for Workbench Request dialog box appears.

       7.      If you need to create a work order, choose the Create pushbutton, add a description of the transport, and then choose OK.If you have a work order or have created a work order, choose Enter.

Result

You have mapped the BDoc to the Site ID. You can continue with Creating a Query BDoc.

Page 52: EPIC-Web Ui Architecture

 Creating a Query BDoc  

Use

When you create a Query BDoc, you follow the same process as you use to create a BDoc. The significant differences are that you do not add any parameters or where clauses because you need the Query BDoc to find all information for the criteria provided at runtime.

Procedure

If you are continuing from Activating the BDoc, then begin with step 3.

...       1.      From the SAP menu, choose Architecture and

Technology  Middleware  Development Meta Object Modeling BDoc Modeler.

The CRM BDoc Modeler Personal Filter screen appears.

       2.      Choose Execute.

The CRM BDoc Modeler screen appears.

       3.      Choose BDoc Type  Create BDoc Type.

The BDoc Overview tab appears on the right-hand side of the screen.

       4.      In the BDoc Identity group box in the Name field, type ZGEQUERYBDOC01 as the name of the Query BDoc.

       5.      In the Description field, type a description of the BDoc.

       6.      In the BDoc Class group box, select the Synchronization (Write) field.

       7.      In the Mobile Application Processing Type group box, select the Standard field.

The new BDoc appears in the Business Documents window.

Result

You have created a BDoc for the ZGE01 table. You can continue with Adding a Segment to the Query BDoc.

      

      

        Adding a Segment to the Query BDoc  

      Procedure

      ...             1.      In the BDoc Overview window, select the BDoc you created, then choose BDoc

Type  Create Segment.

             2.      In the Segment name field, type ZGEQUERYSEG01 as the name for the segment you want to add.

             3.      In the Description field, type Query for countries and continents as a short description for the segment.

             4.      Clear the Cascaded Delete field.

Page 53: EPIC-Web Ui Architecture

             5.      Choose Save.

      Result

      You have added the segment to the BDoc. You can continue with Mapping the Query BDoc Segment to the Table.

      

 Mapping the Query BDoc Segment to the Table  

Procedure

...       1.      Choose the Mappings tab.

       2.      In the Mapped table field, type or select ZGE01.

       3.      In the Table Alias field, type ZGE01.

       4.      Choose the Segment Overview tab and choose the Direct Map pushbutton.

The Direct Mapping screen appears.

       5.      In the Mapped Tables list, select the row containing your table, ZGE01.

       6.      Choose Get Fields.

The fields from the ZGE01 table appear in the Segment Fields table.

       7.      Choose the >> pushbutton to select all fields.

       8.      Choose Execute.

       9.      Choose the Mappings tab and select the Update Map field.

   10.      Choose the Segment Fields tab.

All fields you selected appear in the Segment Fields screen.

   11.      In the same line as the SFAGE01 field appears, select the Key field.

   12.      Choose Save.

Result

You have mapped the BDoc segment to the table. You can continue with Activating the Query BDoc.

      

      

        Activating the Query BDoc  

      Procedure

      ...             1.      Choose the Check pushbutton to ensure that the BDoc does not contain any errors.

      

      If errors occur, rectify them in the BDoc, and test the changes again. For more information about the BDoc Modeler, see  CRM Business Document Modeler.

             2.      Choose the Activate pushbutton to activate your new BDoc.

Page 54: EPIC-Web Ui Architecture

      Result

      You have activated the BDoc. You can continue with the Replication Modeling process.

      

 Replication Modeling  

Purpose

You need to create a replication object so that the new fields are available for the appropriate end users in the Mobile Sales application. For more information about the Administration Console, see The Administration Console.

Process Flow

The following diagram depicts this process by machine and software. The process steps follow.

...       1.      Create a replication object.

Page 55: EPIC-Web Ui Architecture

       2.      Create a site.

       3.      Create a publication.

       4.      Create a subscription.

       5.      Create an employee.

       6.      Create a logon and password for the employee.

       7.      Assign the employee to the new site.

       8.      Subscribe to a publication.

       9.      Create a table in the IDES database.

Result

You have created a replication object and completed the setup requirements for recipients. Continue with ASCII Adapter Customization and Flow Generation.

      

 Creating a Replication Object  

Procedure

...       1.      Log on to the CRM server, if you do not have it running already.

       2.      Choose Architecture and Technology  Middleware  Administration  Administration Console.

The Administrative Console Object Navigator screen appears.

       3.      In the Object type dropdown box, select Replication objects, then choose Object  Create.

The Replication Object Wizard starts.

       4.      Choose Continue.

       5.      Select the Synchronization BDoc Type field, then choose Continue.

       6.      In the BDoc Type field, type or select ZGEBDOC01_WRITE, the name of the BDoc you created, and then select the Bulk field.

       7.      In the Short ID field, type ZGE as a short identifier for this replication object, and then choose Continue.

       8.      Choose Complete.

Result

You have created a replication object. You can continue with Creating a Site.

      

      

        Creating a Site  

      Procedure

      ...             1.      Log on to the CRM Server, if you do not already have it running.

Page 56: EPIC-Web Ui Architecture

             2.      From the SAP menu screen, choose Architecture and Technology  Middleware  Administration  Administration Console.

      The Administrative Console Object Navigator screen appears.

             3.      In the Object type dropdown box, select Site, then choose the Display Objectspushbutton.

      The Site Types list appears in the Objects window.

             4.      Choose Object  Create.

      The Administration Console Add Site screen appears.

             5.      In the Object Information Site group box in the Name field, type a name for the site you want to create. For example, type Geo Test.

      

      If you choose to do so, you can add a short description for this site.

             6.      In the Type dropdown box, select Mobile Client.

             7.      Choose Site Attributes.

      The Maintenance of Site Attributes dialog box appears.

             8.      In the Connection Group field, select ALREADY CONNECTED.

             9.      In the Transfer Group field, select MESSAGES ONLY TRANSFER GROUP, then choose Continue.

         10.      Choose Save.

      Result

      You have created a site. You can continue with Creating a Publication.

      

 Creating a Publication  

Procedure

...       1.      Continuing with the Administration Console, in the Object type dropdown box,

select Publications, then choose Object  Create.

The Publication Wizard starts.

       2.      Choose Continue.

       3.      In the Publication Name field, type GEOGRAPHYas the name for the Publication.

       4.      Select the Bulk field, and then in the Replication Object table, select the replication object, ZGEBDOC01_WRITE.

       5.      Select the Continent field and choose Continue.

       6.      Choose Complete.

Result

You have created a Publication. You can continue with Creating a Subscription.

      

Page 57: EPIC-Web Ui Architecture

 Creating a Subscription  

Procedure

...       1.      Continuing with the Administration Console, in the Object type dropdown box,

select Subscriptions, then choose Object  Create.

The Subscription Wizard starts.

       2.      Choose Continue.

       3.      In the Subscription Name field, type a name for the Subscription you want to create, for example, GEOGRAPHY BY CONTINENT (EU), then choose Continue.

       4.      Select GEOGRAPHYas the Publication.

       5.      In the CONTINENT segment field, type EUR.

       6.      Choose the Assign pushbutton to assign the Site you just created, Geo Test.

       7.      Choose Complete.

       8.      Return to the SAP Easy Access menu screen.

Result

You have created a subscription and assigned it to a site. You can continue with Creating an Employee.

      

 Creating an Employee  

Procedure

...       1.      Log on to the CRM server, if you do not already have it running.

       2.      From the SAP Easy Access menu, choose Master Data  Business Partner  Maintain Business Partner.

The Process Business Partners screen appears.

       3.      Choose Business Partner  Create  Person.

The Create Person screen appears.

       4.      In the Create in Role field, select Employee.

       5.      In the Language field, enter a language for the employee, then press Enter.

       6.      Choose Create.

The Create Person Role Employee screen appears.

       7.      In the First name field, type the first name of the employee.

       8.      In the Last name field, type the last name of the employee.

       9.      In the Country field, type or select the country code for the employee.

   10.      In the Telephone field, type the telephone number for the employee.

   11.      Choose Save.

   12.      Return to the SAP Easy Access Menu.

Page 58: EPIC-Web Ui Architecture

Result

You have created an employee. You can continue with Creating a Logon and Password for the Employee.

 Creating a Logon and Password for the Employee  

Procedure

...       1.      From the SAP menu screen, choose Architecture and

Technology  Middleware  Administration   Administration Console.

The Administrative Console Object Navigator screen appears.

       2.      In the Object Type dropdown box, select Employee, then choose Display Objects.

       3.      Select the Employee you just created from the list by double clicking on the name.

The employee information appears on the right-hand side of the screen.

       4.      Choose Object  Display <-> Change.

       5.      In the Logon Name field, type the logon name you use on the Mobile Client Application, for example, crmuser.

       6.      In the Password field, type the appropriate password for the user.

       7.      In the Confirmation Password field, type the password again, then choose Save.

...Result

You have completed creating a logon and password for the Employee. You can continue with Assigning an Employee to a Site.

 Assigning an Employee to a Site  

Procedure

...       1.      Continuing with the Administration Console, select the employee you just created, then

choose Object  Display <-> Change.

If the employee that you created does not appear in the list, you must download it using transaction SMOELOAD.

       2.      In the Dependent information group box on the Assigned Sites tab, choose Assign.

       3.      In the Sites list, select GeoTest, then choose Copy.

       4.      Choose Save.

Result

You have assigned the employee to the site. You can continue with Subscribing to a Publication.

Page 59: EPIC-Web Ui Architecture

 Subscribing to a Publication  

Procedure

...       1.      Continuing with the Administration Console, choose Object  Display <-> Change.

       2.      On the Assigned Subscriptions tab in the Dependent information group box, choose Assign.

       3.      In the Subscriptions list, select Geography, then choose Copy.

       4.      Choose Save.

       5.      Return to the SAP Easy Access menu screen.

Result

You have subscribed to a publication. You can continue with Creating a Table in the IDES Database.

      

 Creating a Table in the IDES Database  

Procedure

...       1.      From the path ..\Program Files\SAP\Mobile\bin, choose ClientConsole.exe.

The Client Console application opens.

       2.      In the Client Administration window, choose Generate Table Scripts.

The Table Script Generation - CRM Middleware Connection screen appears.

       3.      In the Server Details group box in the Destination field, type or select the name of the system to which you want to connect.

       4.      In the Application server field, type the system number for the server.

Locate this information using SAPlogon by choosing the Server pushbutton, then selecting the system you want to use in the System Id field. The server number is provided in the Message Server field.

       5.      In the System Number field, type the system number for the server you have identified.

Locate this information in the SAPlogon by choosing the Properties pushbutton. The information is provided in the System Number field of the Properties dialog box.

       6.      In the Client field, add the number of the system client that you want to access.

       7.      In the Language field, type the two-letter code for the appropriate system language. For example, type en.

       8.      In the Login Parameters group box in the Login field, type <youruserid>.

       9.      In the Password field, type <yourpassword>, then choose Connect.

Page 60: EPIC-Web Ui Architecture

The Table Script Generation screen appears.

   10.      Select the ZGE01 table from the list.

   11.      Select the Execute directly on Database IDES field, if it is not selected already, then choose Generate.

The scripts generate. The Message Description window contains the message, Table Script Generation Completed, when the process ends.

      

      

        ASCII Adapter Customization and Flow Generation  

      Purpose

      In order to download the new object, you must customize the ASCII Adapter, carry out the delta download and start the flow process.

      Process Flow

      The following diagram depicts this process by machine and software. The process steps follow.

Page 61: EPIC-Web Ui Architecture

      

      ...             1.      Define the download object for the ASCII Adapter.

             2.      Start the Delta Download.

             3.      Transport Metadata.

             4.      Generate metadata and stored procedures.

             5.      Assign a site to a laptop.

             6.      Starting the flow process.

      Result

      You have downloaded the new object and started the flow process. You can continue with Create the Mobile Sales Application.

       

      

Page 62: EPIC-Web Ui Architecture

 Defining the Download Object for the ASCII Adapter  

Procedure

...       1.      Log on to the CRM server, if you do not already have it running.

       2.      From the SAP User menu, select Architecture and Technology  Middleware  Data Exchange  Object Management  Customizing Objects.

The Adapter Object Overview screen appears.

       3.      Select Table View  Display <-> Change.

       4.      Select Edit  Create Object.

       5.      In the Object Name field, type ZGEBDOC01_DO as the name of the object to be downloaded. The name must be unique.

       6.      In the Linked BDoc field, type or select ZGEBDOC01.

       7.      In the Blocksize field, type 50.

       8.      On the Initial Flow Contents tab in the Source site type field, select R/3.

       9.      Select the Tables/Structures tab.

   10.      In the Table (source site) field, type ZGE01.

   11.      In the Mapped Structure (target site) field, type ZGE01.

   12.      Choose Back.

   13.      Double click on the ZGEBDOC01_DO to return to the screen.

The filter icon in the table activates.

   14.      In the Filter Settings field, choose the Filter pushbutton.

The Filters tab screen appears.

   15.      In the Source Site Name field, select CRM_DEFAULT DESTINATION.

   16.      In the Filter option field, select Filter in source and target database.

   17.      In the Field field, type CONTINENT.

   18.      In the OP field, select Equality (= Low).

   19.      In the Low field, type Europe.

This field is case sensitive.

   20.      In the Incl/Excl field, select Inclusive defined set/array.

   21.      Choose Back, then choose Save.

The Include Download Objects into a transfer request pop up box appears.

   22.      Choose Yes.

The new information generates.

   23.      Return to the main menu.

Page 63: EPIC-Web Ui Architecture

Result

You have defined the download object for the ASCII Adapter. You can continue with Starting the Delta Download.

      

 Starting the Delta Download  

Procedure

...       1.      From the CRM Server menu screen, select Architecture and

Technology  Middleware  Data Exchange  Delta Load from R/3 Back-End  Set Up Delta Load.

The Object Class Activation screen appears.

       2.      Select ZGE01 as the business object you want to prepare for the download, then choose Save.

Result

You have selected the table for download from the R/3 system. Continue with Transporting Metadata.

 Transporting Metadata  

Procedure

...       1.      Select Architecture and Technology  Middleware  Development  Transport Meta-

Data.

The Transport of Industry Specific Objects screen appears.

       2.      In the Available Objects field, type or select ZGE01_DO.

       3.      Choose Execute.

A transport change request is created automatically.

Result

You have transported the Metadata. You can continue with Generating Metadata and Stored Procedures.

 Generating Metadata and Stored Procedures  

Procedure

...       1.      From the path ..\Program Files\SAP\Mobile\bin, choose ClientConsole.exe to start the

Client Console.

       2.      In the Client Administration window, choose Table Script Generation.

Page 64: EPIC-Web Ui Architecture

The Table Script Generation screen appears.

       3.      In the Destination field, select XYZ (the three-character name of your CRM server.)

       4.      Supply the appropriate information for connection in the remaining fields.

       5.      Choose Connect.

A list of tables appears.

       6.      Select ZGE01.

       7.      Make sure that the Execute directly on database IDES field is selected.

       8.      Choose Generate.

The stored procedures generate.

       9.      Choose Metadata Manager.

The Metadata Manager screen appears.

   10.      In the Destination filed, select XYZ (the three-character name of your CRM server.)

   11.      Supply the appropriate information for connection in the remaining fields.

   12.      Choose Connect.

A list of BDocs appears.

   13.      Select ZGEBDOC01. and ZGEQUERY01.

   14.      Choose Generate.

The metadata and stored procedures generate. The Message Description window contains the message, Metadata Generation Completed when the process ends.

Result

You have generated the metadata and stored procedures. You can continue with Assigning a Site to a Laptop (Activating extraction).

      

 Assigning a Site to a Laptop (Activating extraction)  

Procedure

...       1.      Continuing with the Client Console, in the Client Administration window, choose Assign

Site ID.

The Table Script Generation dialog box appears.

       2.      Enter the appropriate information for the communication station connection and the appropriate login and password, then choose Connect.

The Assign Site ID screen appears.

       3.      From the Available free sites list, select Geo Test, then choose Assign.

Result

You have activated the extraction of the new object. You can continue with Starting the Flow Process.

      

Page 65: EPIC-Web Ui Architecture

 Starting the Flow Process  

Procedure

...       1.      From the Start menu, choose Programs  SAP CRM Mobile  Mobile Client

Administration Tools  ConnTrans.

The ConnTrans screen appears.

       2.      On the Transfer Services tab, clear the Send field.

       3.      Choose Synchronize.

Result

You have started the flow. You can continue with the Create the Mobile Sales Application process.

      

      

        Create the Mobile Sales Application  

      Purpose

      Now that you have configured the Middleware, you must create the application using the Mobile Application Studio.

      Prerequisites

      You must reserve a namespace for the customer development repository on the Mobile Repository Server before starting the Mobile Application Studio. For more information, see  Registering the Customer Namespace Y or Z.

      Process Flow

      The following diagram depicts this process by machine. The process steps follow.

Page 66: EPIC-Web Ui Architecture

      

      ...             1.      Configure the Mobile Application Studio.

             2.      Create a business object.

             3.      Create a business query.

Page 67: EPIC-Web Ui Architecture

             4.      Create a detail tile.

             5.      Create a query detail tile.

             6.      Create a tile set.

             7.      Create a business component.

             8.      Create an application.

             9.      Release the changes.

         10.      Generate the application.

      Result

      You can start the application.

       

      

 Configuring the Mobile Application Studio  

Procedure

...

       1.      Choose Start  Programs  SAP CRM Mobile  SAP Mobile Application Studio to start

the Mobile Application Studio.

                                                                              i.       In the DSN field, type ars_db.

                                                                            ii.       In the User field, type arsadmin.

                                                                           iii.       Do not add a password.

                                                                           iv.       Choose Login.

The Select a Changelist dialog box appears.

       2.      If you want to view the development objects, choose OK.

The Mobile Application Studio Workbench screen appears.

If you want to edit development objects, you can either select an existing change list, or

create a new change list.

To create a new change list, use this procedure.

         Choose the New pushbutton.

The Create New Changelist dialog box appears.

         In the Changelist field, type the name for your change list.

         Choose OK.

The Select a Changelist dialog box appears again.

         Choose OK.

The Mobile Application Studio Workbench screen appears.

       3.      Choose Tools  Options.

The Options dialog box appears.

Page 68: EPIC-Web Ui Architecture

       4.      In the Generation settings list box, verify that the paths for generation of runtime

files and access to the BDoc repository are accurate. Use the following table to check the

path data.

Generation option Path

RT Generation (.dat Files) C:\Program Files\sap\Mobile\ars\

BOL VBA Generation C:\Program Files\sap\Mobile\app\vba_dlls_msa\

UI Generation C:\Program Files\sap\Mobile\framework\GenApps\

EXE for BOL VBA Debug <None>

UI Template C:\Program Files\sap\Mobile\framework\Templates\

UI Modeler Layout C:\Program Files\sap\Mobile\framework\uimodeler\

       5.      Select the BDoc Validation option.

                                                                              i.       Select the BDoc Validation using R/3 Repository field.

                                                                            ii.       In the DSN field, type or select trrep.

                                                                           iii.       In the User field, type sa.

       6.      Choose Apply, then choose OK.

Result

You have configured the Mobile Application Studio. You can continue with Creating a Business Object.

      

 Creating a Business Object  

Procedure

...       1.      If the Object Modeler window is not open, choose View  Object Modeler.

-or-If the Object Modeler window is open, continue with step 2.

The Object Modeler window appears.

       2.      Choose File  New  Business Object.

The Business Object Wizard starts.

         If you are working in the baseline version, you will receive a message instructing you to create a change list. Create the change list and continue with step 3.

         If you have turned the wizard function off, then you must create the new business object manually.

       3.      In the Name field, type Z_ROOM3BO.

Page 69: EPIC-Web Ui Architecture

       4.      In the BDoc Support field, select New BDoc Supported.

This allows the business object to be mapped to a Write BDoc, which writes data to the IDES database at runtime.

       5.      In the Read BDoc and Write BDoc fields, select ZGE01, the name of the BDoc you created in the BDoc Modeler.

       6.      In the BDoc Segment field, select ZGE01SEG. the segment you created for the BDoc.

       7.      In the BDoc Parameter field, select the parameter that you specified as the primary key in the BDoc Modeler.

       8.      Choose Next.

       9.      Choose the Segment Field names from the BDoc for which you want to add a property.

   10.      In the Property field, type the name you want for the property.

Use the segment field which you assigned to the business object.

   11.      Choose Next.

   12.      Choose Finish.

The Business Object Wizard creates the business object and closes, then the Business Object screen appears.

Result

You have created the business object. You can continue with Creating a Business Query.

      

Creating a Business Query 

Procedure1.      Choose   File   New   Business Queries  .

The Business Query Wizard starts.

 NOTE

If you have turned the wizard function off, then you must create the new business query

manually.

2.      In the Name field, type Z_ROOM3BQ.

3.      In the Read BDoc field, select ZGE01Q.

4.      In the BDoc Segment field, select the segment you created for the BDoc.

5.      In the Contained BO field, select Z_ROOM3BO, the business object that you created.

6.      Choose Next.

7.      Choose the Segment Field names from the BDoc for which you want to add a property.

8.      In the Property field, type the name you want for the property.

 NOTE

Use the segment field that you assigned to the business object.

Page 70: EPIC-Web Ui Architecture

9.      Choose Next.

10.  Choose Finish.

The Business Query Wizard creates the business object and closes, then the Business

Query screen appears.

ResultYou have created the business query. You can continue with Creating a Detail Tile.

 Creating a Detail Tile  

Procedure

...       1.      Choose File  New  Tile  Detail.

The Tile Wizard screen appears.

       2.      Choose Next.

       3.      Select Detail Tile, if it is not already selected.

       4.      In the Caption field, type the name for the tile which appears in the application.

       5.      In the Name filed, type a new name for the tile, if desired, then choose Next.

       6.      Choose the appropriate Properties for the tile, then choose Next.

       7.      In the Available Data Sources list box, select Z_ROOM3BO, then choose Add.

       8.      Choose Finish.

The Tile Wizard creates the tile object and closes, then the Tile screen appears in the work area.

       9.      In the tile work area, make changes to the appearance of the tile.

   10.      Choose Save.

   11.      Close the tile work area.

Result

You have created the detail tile. You can continue with Creating a Query Detail Tile.

 Creating a Query Detail Tile  

Procedure

...       1.      Choose File  New  Tile  Query Detail.

The Tile Wizard screen appears.

       2.      Choose Next.

       3.      Select Query Detail Tile, if it is not already selected.

       4.      In the Caption field, type the name for the tile which you want to appear in the application.

       5.      In the Name filed, type a new name for the tile, if desired, then choose Next.

       6.      Choose Navigate between records for the tile properties, then choose Next.

Page 71: EPIC-Web Ui Architecture

       7.      In the Available Data Sources list box, select Z_ROOM3BQ, then choose Add.

       8.      Choose Finish.

The Tile Wizard creates the tile object and closes, then the Tile screen appears in the work area.

       9.      In the tile work area, make changes to the appearance of the tile.

   10.      Choose Save.

   11.      Close the tile work area.

Result

You have created the query detail tile. You can continue with Creating a Tile Set.

 Creating a Tile Set  

Procedure

...       1.      Choose File  New  Tile Set  Standard.

The Tile Set Wizard screen appears.

       2.      Choose Next.

       3.      Select Standard Tile Set, if it is not already selected, then choose Next.

       4.      In the Caption field, type the name of the tile set that you want to appear in the application.

       5.      In the Name field, change the name of the tile set, if you want to, then choose Next.

       6.      In the Active tiles list box, expand the Detail Tiles folder.

       7.      In the Available Tiles list box, select and drag the tile you created and drop it in the Free Cell area.

       8.      Expand the tile to fill the entire area, then choose Next.

       9.      Select the appropriate properties for this tile set, then choose Next.

   10.      Establish a connection between the tile and the tile set, then choose Next.

   11.      Review the selections you made for the tile set, then choose Finish.

The Tile Set Wizard creates the tile set and closes, then the Tile Set screen appears in the work area.

   12.      Choose Save.

   13.      Close the tile set work area.

Result

You have created the tile set. You can continue with Creating a Business Component.

Page 72: EPIC-Web Ui Architecture

 Creating a Business Component  

Procedure

...

       1.      Choose File  New  Business Component.

The Business Component screen appears.

       2.      In the Object Browser, expand the Standard Tile Sets folder.

       3.      Select and drag the new tile set and drop it in the Tile Set Containers pane in

the Business Component window.

       4.      In the Business Anchors pane, click the Business Anchors folder with the secondary

mouse button and choose New Anchor.

       5.      In the Business Anchors pane, select the new anchor.

       6.      In the Properties window, select the appropriate information for these fields.

1.                                              a.      In the Data Source field, select the ZGE01BQ.

2.                                              b.      In the Data Source Type field, select Business Query.

       7.      In the Tile Set pane, select and drag the tile set anchor and drop it on to the new

business anchor.

The tile set anchor becomes the child of the business component anchor.

       8.      In the Business Anchors pane, select the child (tile set) anchor.

       9.      In the Properties window, select the appropriate information in these fields.

3.                                              a.      In the Supply Type field, select QueryResult.

4.                                              b.      In the Data Source Type field, select Business Collection.

   10.      In the Tile Set pane, select the Tile Set Container node.

   11.      In the Properties window, select the appropriate information for these fields.

5.                                              a.      In the MainAnchor field, select the ZGE01BQ.

6.                                              b.      In the Enabled field, select True.

12.  Choose Save.

13.  Close the business component work area.

Result

You have created the business component. You can continue with Creating an Application.

 Creating an Application  

Use

For testing purposes, we recommend that you create a new application or to delete all other business components from the existing application you choose. This ensures that the Mobile Application Studio uses only your BDocs and does not depend on whether or not the latest MSA BDocs exist in the Middleware. It also reduces generation times.

Page 73: EPIC-Web Ui Architecture

Procedure

...       1.      From the UI Modeler window, click the Applications folder with the secondary mouse

button, and choose New.

The application work area appears.

       2.      From the UI Modeler window, select and drag the business component you created and drop it in the Business Containers pane.

       3.      Choose Save.

       4.      Close the application work area.

Result

You have created the application. You can continue with Releasing the Changes.

 Releasing the Changes  

Procedure

...

       1.      Choose View  Changelist Browser.

The Changelist Browser window appears on the right side of your screen.

       2.      Expand the My Open Changelists folder.

       3.      Click the change list on which you are working with the secondary mouse button,

and choose Release.

The Workbench dialog box appears.

       4.      Choose Yes to confirm the release.

If the attachment of R/3 transport orders is enabled, the ChangeManagement dialog box

appears. Use this procedure to continue.

7.                                              a.      Choose OK.

8.                                              b.      The Changelist screen appears.

9.                                              c.      In the Transport Order field, select the … (ellipsis) pushbutton.

10.                                          d.      Select the transport ID from the list of available orders.

11.                                          e.      Choose Save.

If you are not able to release the change list, you can continue with the generation of the

application. The Mobile Application Studio uses the active change list as its default.

Result

You have released the changes. You can continue with Generating the Application.

Page 74: EPIC-Web Ui Architecture

 Generating the Application  

Prerequisites

Before you can generate the application, you must generate the runtime file for the business object and business query followed by the user interface development objects. This results in automatic generation of runtime files such as DLLs and the VBA project.

Procedure

...       1.      In the Object Modeler window, click the Business Objects folder with the secondary

mouse button, and choose RTGenerate.

This generates the file ARSREP.DAT for the business object.

       2.      In the Object Modeler window, click the Business Objects folder with the secondary mouse button and choose RTGenerate.

This generates the file ARSREP.DAT again with data of the business query.

       3.      Select Tools  UI Generator to generate the user interface development objects.

The UI Generator screen appears.

       4.      In the Select Interaction Components for Generation group box in the Selected Application field, select the appropriate application.

       5.      In the Select Settings for Generation group box, select the Generate Recursively field.

       6.      In the Project Name field, select the appropriate project to which this application belongs.

       7.      Choose Start Generation.

The application generation begins. If any errors occur during generation, they appear on the screen. You can open the Generation Log file to check the cause for the errors.

Result

You have generated the application. You can continue with Starting the Application.

 Starting the Application  

Prerequisites

When the application generation finishes, you can view the result of your work by starting the Mobile Sales Application.

When the application generation finishes, you can view the result of your work by starting the Mobile Sales Application on the Mobile Client.

Procedure

...       1.      Select Start  Run.

The Run dialog box appears.

       2.      In the Open field, type C:\Program Files\sap\Mobile\bin\UFContainer.exe.

Page 75: EPIC-Web Ui Architecture

This path is the default. If you changed the path, then you will need to adjust these instructions accordingly.

       3.      Choose OK.

The newly generated Mobile Sales Application starts.

       4.      Log on to the Mobile Sales Application to view your results.

Result

You have completed the CRM Mobile Sales table integration.

BDOCS

BDOC IS NOTHING BUT BUSSINESS DOC ,IT IS USED TO TRANSFER THE DATA FROM ECC TO CRM AND VICEVERSA USING MIDDLE WARE TECHNILOGY.

EACH BUSSINESS DOC CONNECTED WITH ADOPTER OBJ.

BUSSINESS DOCUMENTS HAVING SEGMENTS.

SEGMET CONTAINS FIELDS .

IN THOSE FIELDS GUID IS KEY FIELD  IS MANDATORY.

WE CAN ADD MULTIPLE SEGMENTS TO ONE BDOC.

BDOC HAV E CRM STRUCTURE AND ECC STRUCTURE.

IN CRM STRUCTURE DATA IS IN CRM STRUCTURE.

BY ECC STRUCTURE DATA USED FOR COMMUNICATION.

MIDDLE WARE USED FOR DATA VALIDATIONS AND DATA TRANSFORMATION.

FOR DATA UP LOADING WE HAVE TWO TYPES OF LOADS THOSE ARE

INITIAL LOAD,DELTA LOAD

INITIAL LOAD: INITIAL LOAD IS THE FIRST TIME LOAD .INTHAT CASE DATA BASE IS EMPTY.IT IS ONE TIME LOAD.TC ODE FOR INITIAL LOAD - R3AS.

DELTA LOAD : WHEN EVER MODIFYING THE DAT A IN THE DATA BASE WE NEED DELTA LOAD.WHEN WE PERFORM DELTA LOAD OPTION WE SHOULD REMOVE INITIAL LOAD OPTION. BUT WITHOUT INITIAL LOAD WE CANT PERFORM DELTA LOAD.

IF I SEND A BDOC FROM CRM TO ECC THAT BDOC SHOULD NOT A IDOC.

THIS TRANSFORMATION INTHE FORM OF QUEUES.THE QUEUE IS STARTS WITH "CSA"  IS OUT BOUND TO CRM.

THE QUEUE STARTS WITH  R3AD IS IN BOUND TO CRM.

WHEN EVER ERROR OCCURS IN OUTBOUND ,IN THIS CASES WE NEED TO STOP THE QUEUE IN MIDDLE WARE FOR THAT TCODE IS SMQR.

Page 76: EPIC-Web Ui Architecture

BY USING SMQR T CODE DEREGISTER THE QUEUE AND FIND THE ERROR BY DEBUGGING IN SYSTEM GENARATED CODE.IF QUEUE IS RIGISTARD DEBUGGING NOT ALLOWED.SYMBOLS FOR REGISTATION AND DEREGISTRATION :R & U

ONCE WE GOT THE ERROR THEN WE HAVE TO SOLVE THE PROBLAM AND AGAIN REGISTER THE QUEUE.D

TCODE FOR INBOUND QUEUE : SMQ2

TCODE FOR OUTBOUND QUEUE : SMQ1.

SEARCH HELP FOR AET FIELD:

TARGET1: CONVERT THE CONTEXT NODE CLASS IN TO ZCLASS.

GO TO WORK BENCH .

SELECT STANDARAD COMPONENT BT111H_OPPT WITH SELECTED ENHANCEMENT

SET.

GO TO COMPONENT STRUCTURE BROWSER.

VIEWS.

BT11H_OPPT/DETAILS->DOUBLE CLICK ON THAT.

SELECT VIEW STRUCTURE->COPY THE CNTEXT NODE CLASS.

GO TO SE24.

PROVIDE CONTExT NODECLASS NAME AND CHANGE THE NAME OF THE CONTEXT

NODE As ZCLASS(ZL_BT111H_O_DETAILS_CN00)-> CREATE.

SELECT RADIO BUTOON CLASS->ENTER->CLICK ON THE CREATE INHERITANCE

BUTTON->provide superclass as context class.

SAVE AND ACTIVATE CLASS.

AGAIN GO TO WORKBENCH AND SELECT BT11H_OPPT DETAILS VIEW-> SELECT

THE CONTEXT CLASS->CLICK ON THAT.

SELECT METHOD CREATE_BTADMINH AND REDEFINE IT->SAVE.

GO TO SE24->COPY THE CONTEXT CLASS NAME(CL_BT111H_O_DETAILS_CTXT)-

>GO TO METHOD CREATE_BTADMINH.

COPY THE CODE FROM THAT AND PASTE IT IN ZCLASS OF CTXT-> IN THAT CODE

CHANGE THE CLASS_NAME AS ZL------CN00.

SAVE AND ACTIVATE.

STEP:2

CLICK ON CONTEXT NODE CLASS(ZCL-----00).

GO TO CHANGE MODE AND CREATE METHODS   1)GET_P_ZZFLD000006

                                                                                                2)GET_V_ZZFLD000006.

VISIBILITY:PUBLIC FOR BOTH METHODS.

SAVE AND ACTIVATE.

COPY THE PARAMETERS OF(PRESS CTRL+Y AND CTRL+C) GET_P AND GET_V

METHODS OF THAT SAME CONTEXT NODE CLASS.

Page 77: EPIC-Web Ui Architecture

PASTE THE PARAMETERS IN GET_P_ZZFLD000006 AND SAME AS GET_V(MAKE

SURE THE PASS BY VALUE AND OPTIONAL VALUE TO BE CHECKED).

STEP:3

COPY THE CODE FORM CUSTOM VIEW(ZEPIC_APPL/EPIC)->CONTEXTCLASS-

>CONTEXTNODECLASS->ATTRIBUTES-> GET_P METHOD OF

ATTRIBUTES(LEAD_TYPE CODE).

method GET_P_ZZFLD000006.

  CASE IV_PROPERTY.

    WHEN IF_BSP_WD_MODEL_SETTER_GETTER=>FP_FIELDTYPE.

      RV_VALUE = CL_BSP_DLC_VIEW_DESCRIPTOR=>FIELD_TYPE_INPUT.  

  ENDCASE.

endmethod.

SAVE AND ACTIVATE.

SELECT GET_V METHOD WRITE THE CODE IN IT.

method GET_V_ZZFLD000006.

  CREATE OBJECT RV_VALUEHELP_DESCRIPTOR TYPE CL_BSP_WD_VALUEHELP_NAVDES

CR

  EXPORTING

    IV_OUTBOUND_PLUG = 'OP_TOCUSTOM'.(FROM OUTBOUND PLUG)

endmethod.

SAVE AND ACTIVATE.

STEP:3

GO TO WORKBENCH ->ENTER CUSTOM COMPONENTNAME -> WITH NO

ENHANCEMENT SET.

CLICK ON DISPLAY.

 GO TO RUNTIME REPOSITORY EDITOR->CHANGE MODE.

SELECT COMPONENT INTERFACE-> RIGHTCLICK -> ADD INTERFACE

VIEW(MAPPED WINDOW = Z KYRCMP/MAINWINDOW  THROUGH F4).

SAVE RRE.

STEP:4

         GO TO WORKBENCH->ENTER STANDARD COMPONENT-> (BT111H_OPPT) WITH

ENHANCEMENT SET.

         DISPLAY.

         GO TO  RUN TIME REPOSITORY EDITOR->CHANGE MODE->

         COMPONENT USAGE->RIGHTCLICK->ADD COMPONENT USAGE->                       PROVIDE 

ID(OPTIONAL ANY NAME)-> SAVE RRE.

STEP:4(BT111H_OPPT/DETAILS)

CREATE OUTBOUND PLUG: TO CUSTOM.

SELECT VIEW STRUCTURE TAB ->OUTBOUNDPLUG->RIGHTCLICK->CREATE.(TO

CUSTOM).

Page 78: EPIC-Web Ui Architecture

GO TO IMPLEMENTATION CLASS(VIEW CONTROLLER CLASS) OF OP_TO CUSTOM-

>PUBLIC.

GO TO OUTBOUND PLUG->DOUBLE CLICK  ON TO CUSTOM->WRITE THE CODE.

method OP_TOCUSTOM.

                                    * Added by wizard: Outbound plug 'TOCUSTOM'

  CALL METHOD COMP_CONTROLLER->WINDOW_MANAGER->CREATE_POPUP

   EXPORTING

     IV_INTERFACE_VIEW_NAME = 'ZCUSRJ/MainWindow'(ZCUSRJ:INTERFACE VIEW NAME

CLASS).

     IV_USAGE_NAME          = 'cucustomcomp'. ("BT111H_OPPT->RRE->COMPONENT USAGE

NAME: CUCUSTOMCOMP)

     IV_TITLE               = 'SEARCH FOR OPPT_TYPE'

  RECEIVING

     RV_RESULT              = GR_CUSTOM_POPUP.("DOUBLE CLICK ON GR_CUSTOM_POPUP->

CHOOSE PUBLIC->TYPE REF TO->interface:IF_BSP_WD_POPUP )

  CALL METHOD GR_CUSTOM_POPUP->SET_ON_CLOSE_EVENT

        EXPORTING

          IV_VIEW = ME

          IV_EVENT_NAME = 'CUSTOM_POPUP_CLOSED'.

DATA : LR_COL TYPE REF TO CL_BSP_WD_COLLECTION_WRAPPER.

DATA : LR_BTADMINH TYPE REF TO IF_BOL_BO_PROPERTY_ACCESS.

DATA  : LR_BTOPPORTH TYPE REF TO IF_BOL_BO_PROPERTY_ACCESS.

CREATE OBJECT LR_COL.

LR_BTADMINH ?= TYPED_CONTEXT->BTADMINH-> COLLECTION_WRAPPER-

>GET_CURRENT( ).

LR_COL->ADD( LR_BTADMINH ).

LR_BTOPPORTH ?= TYPED_CONTEXT->BTOPPORTH->  COLLECTION_WRAPPER-

>GET_CURRENT( ).

LR_COL->ADD( LR_BTOPPORTH ).

GR_CUSTOM_POPUP->OPEN

         ( IV_INBOUND_PLUG = 'FROMOPPT' IV_COLLECTION = LR_COL ).

endmethod.

STEP:5

Page 79: EPIC-Web Ui Architecture

         GO TO WORKBENCH AND PROVIDE CUSTOM COMPONENT

     (ZKYCOMP)->DISPLAY.

         GO TO COMPONENT STRUCTURE BROWSER.

         DOUBLE CLICK ON COMPONENT CONTROLLER->SELECT CONTEXT NODES->RIGHT

CLICK ->CREATE.

         NOW WIZARD WILL OPEN

           IN THAT STEPS:

  NAME: RESULTCOCO

  PROVIDE BOL ENTITY:RESULT OBJ->CONTINUE

  MODEL ATRRINUTES->SELECT +ICON -> SELECT ID,TYPE,TARGET,BP->CONTINUE.

  CONTINUE->TILL COMPLETE.

         GO TO RRE->CHANGE MODE->EXPAND COMPONENT INTERFACE->EXPAND INTERFACE

CONTROLLER->RIGHT CLICK ON CONTEXT->ADD CONTEXT NODE(CONTEXT NODE =

RESULT COCO)->SAVE.

         GOTO COMPONENT STRUCTURE BROWSER->EXPAND VIEWS->SELECT RESULT VIEW-

>DOUBLE CLICK ON THAT->GO TO EVENT HANDLER->DOUBLE CLICK ON EH_SELECT ->

ADD THE BELOW CODE.

method EH_ONSELECT.

*CALL METHOD SUPER->EH_ONSELECT

*  EXPORTING

*    HTMLB_EVENT    =  HTMLB_EVENT

*    HTMLB_EVENT_EX =  HTMLB_EVENT_EX.

  data: lv_event TYPE REF TO cl_htmlb_event_tableview.

 lv_event ?= htmlb_event.

me->typed_context->resultcn->eh_on_row_selection(

       iv_htmlb_event    = lv_event

       iv_htmlb_event_ex = htmlb_event_ex ).

  data:lr_entity type ref to if_bol_bo_property_access,

        v_index type i,

 lr_coco type ref to ZL_ZCUSRJ_BSPWDCOMPONENT_IMPL, ("COMPONENT CONTROLLER

IMPLEMENTATION CLASS IN CUSTOM COMPONET:ZCUSRJ)

Page 80: EPIC-Web Ui Architecture

 lr_window type ref to ZL_ZCUSRJ_MAINWINDOW_IMPL .("WINDOW CONTROLLER IN

CUSTOM COMPONENT :ZCUSRJ).

  v_index = typed_context->resultcn->selected_index.

  lr_entity ?= typed_context->resultcn->collection_wrapper->find( iv_index = v_index ).

  lr_coco ?= comp_controller.

  lr_coco->typed_context->resultcoco->collection_wrapper->clear( ).

  lr_coco->typed_context->resultcoco->collection_wrapper->add( lr_entity ).

  lr_window ?= view_manager->get_window_controller( ).

  lr_window->op_tooppt( ).

endmethod.

SAVE .

STEP:6

         SELECT CUSTOM COMPONENT:ZCUSRJ

         SELECT COMPONENT STRUCTURE BROWSER->EXPAND WINDOWS-> DOUBLE CLICK ON

MAIN WINDOW.

         SELECT OUTBOUND PLUG->RIGHTCLICK ON THAT->CREATE(PROVIDE:TOOPPT).

         GO TO WINDOW CONTROLLER IMPL CLASS-> CHANGE MODE->UNDO REDEFINITION TO

OPPT METHOD->

      GO TO PROPERTIES->DOUBLE CLICK ON SUPER  CLASS(CL_BSP_WD_WINDOW)-

>SELECT METHODS-> CHANGE MODE-> CHANGE VISISBILITY OF OPPT METHOD FORM

PROTECTED TO PUBLIC->SAVE AND ACTIVATE.

         SELECT PROPERTIES->BACK->AGAIN METHODS->CHECK THE METHOD OPPT METHOD

AND REDEFINE THAT METHOD.

         SAVE AND ACTIVATE.

 code for op_tooppt()                                             fire_outbound_plug( iv_outbound_plug = 'op_tooppt').

SAVE AND ACTIVATE.

NOW GO TO RESULT VIEW->EVENTHANDLER-> EH_ONSELECT-> ACTIVATE.

STEP:7

Page 81: EPIC-Web Ui Architecture

         GO TO STANDARD COMPONENT(BT111H_OPPT)

         GO TO COMPONENT STRUCTURE BROWSER->VIEWS-> SELECT BT111H_OPPT/DETAILS.

         EVENTHANDLER->RIGHT CLICK ->CREATE(FROM OP_CUTOM CODE:PROVIDENAME

HERE:CUSTOM_POPUP_CLOSED )

      method EH_ONCUSTOM_POPUP_CLOSED.

                * Added by wizard: Handler for event 'custom_popup_closed'

  check gr_custom_popup->get_fired_outbound_plug( ) is not initial.

  data:lr_cn type ref to cl_bsp_wd_context_node,

        lr_btadminh type ref to if_bol_bo_property_access,

        lr_entity type ref to if_bol_bo_property_access,

        v_type type string.

  lr_cn ?= gr_custom_popup->get_context_node( iv_cnode_name = 'resultcoco').

  lr_entity ?= lr_cn->collection_wrapper->get_current( ).

  v_type = lr_entity->get_property_as_string( iv_attr_name = 'oppt_type' ).

  lr_btadminh ?= typed_context->btadminh->collection_wrapper->get_current( ).

  lr_btadminh->set_property_as_string( iv_attr_name = 'ZZFLD000006' IV_VALUE = V_TYPE ).

endmethod.

SAVE AND ACTIVATE.

STEP:8

GOTO CUSTOM COMPONET->SELECT WINDOWS->

DOUBLECLICK ON THAT->SELECT INBOUBDPLUG->CREATE(PROVIDE NAME:

FROMOPPT).

method IP_FROMOPPT.

  check iv_collection is BOUND.

  data : lr_entity type ref to cl_crm_bol_entity,

         lr_viewset type ref to ZL_ZCUSRJ_SEARCHRESULTVIE_IMPL ,("VEIWSET CONTROLLER

CLASS)

         lr_search type ref to ZL_ZCUSRJ_SEARCHVIEW_IMPL  ,("SEARCH VIEW CONTROLLER

CLASS).

         lr_qs type ref to cl_crm_bol_dquery_service,

          v_type type string.

  lr_entity ?= iv_collection->get_first( ).

  while lr_entity is bound.

Page 82: EPIC-Web Ui Architecture

    if lr_entity->get_name( ) = 'BTAdminH'.

      v_type = lr_entity->get_property_as_string( iv_attr_name = 'ZZFLD000006' ).("AET FIELD

ATRRIBUTE NAME).

      endif.

    lr_entity ?= iv_collection->get_next( ).

    endwhile.

lr_viewset ?= get_subcontroller_by_viewname( iv_viewname = 'ZCUSRJ/searchresultviewset' ).

("ZCUSRJ:VIEWS->COPY THE VIEWSET NAME)

lr_search ?= lr_viewset->get_subcontroller_by_viewname( iv_viewname = 'ZCUSRJ/searchview' ).

("ZCUSRJ:VIEWS->COPY THE SEEARCH VIEW NAME).

lr_qs ?= lr_search->typed_context->searchcn->collection_wrapper->get_current( ).("CHANGE

TYPED_CONTEXT VISIBILITY TO PUBLIC FROM PROTECTED IN SUPER CLASS). 

CALL METHOD LR_QS->ADD_SELECTION_PARAM

  EXPORTING

    IV_ATTR_NAME = 'OPPT_TYPE'

    IV_SIGN      = 'I'

    IV_OPTION    = 'EQ'

    IV_LOW       = v_type.

endmethod.

SAVE AND ACTIVATE.

SEE THE RESULT WITH ENHANCEMENTSET  IN SM30. CHECK IN WEBUI.PRESS F4 ON THE

AET FIELD.