Quantcast
Channel: SCN : Document List - SAP CRM: Webclient UI - Framework
Viewing all 189 articles
Browse latest View live

Determination of view configurations

$
0
0

View configurations are determined according to a special search sequence. Sometimes it seems that the framework has not found the correct configuration. The following table describes the search logic of view configurations.

 

 

Role Key

Component Usage

Object Type

Object Sub Type

1

X

X

X

X

2

X

X

X


3

X


X

X

4


X

X

X

5



X

X

6

X


X


7



X


8

X

X



9


X



10

X




11





 

This means, the framework first looks for a matching configuration with all four attributes. The second search uses <DEFAULT> as Object Sub Type. The third search uses <DEFAULT> as Component Usage. Etc. - The first found configuration will be used.

 

Background information: The search is implemented in class: CL_BSP_DLC_XML_STORAGE2 methods PROC_ACC_SEQ_FOR_SEARCH_KEY/CHOOSE_CONFIG_BY_AC_SEQ_NEW.

 

Hint: With enhancement BSP_DLC_ACCESS_ENHANCEMENT you can add your own determination.


Enhancing BP Search without using AET

$
0
0

Sometimes there is a requirement to enable BP search for some already existing standard BP Fields which are not present in the standard search query structure of BP. AET is not a solution in this case as the field to be searched for already exists in the standard tables and has to be handled in a more specific manner than the code generated by AET.

 

The standard dynamic query object of BP is – BuilHeaderAdvancedSearch and the underlying query structure is - CRMT_BUPA_IL_HEADER_SEARCH.

Let’s define a problem statement to elucidate the steps needed for such a BP Search Enhancement.

 

Problem Statement:

 

Enhance the BP Search for enabling search on “Middle Name”.

Solution:

 

“Middle Name” is a standard BP Field present in BUT000 table, but the standard BP Search doesn’t have this field. Following steps will help fulfill this requirement:

 

  1. Append the additional field to the BP Search structure - CRMT_BUPA_IL_HEADER_SEARCH

 

1.png

1.png

Once the field is added in the search structure, it will start reflecting in the corresponding search query object as well:

1.png

 

  2.    After step 1, it would be possible to expose the search field – “Middle Name” on the UI by displaying it in the UI config of the search view from the available fields of the search context node. However, the system is not yet ready to search on this field as there is no logic written in the backend that instructs the system on what to do when a search is made on this field.

 

To enhance the search query for searching for this field, the enhancement spot CRM_BUPA_IL_SEARCH should be enhanced for BAdI - BADI_CRM_BUPA_IL_SEARCH_EXT

 

1.png

 

1.png

1.png

 

1.png

 

The method IF_EX_CRM_BUPA_IL_SEARCH_EXT~SEARCH_CRITERIA_INITIAL should be implemented to check if any of the three added fields are searched for. If they have been searched for, then the Badi is not initial.

 

DATA : ls_search_criteria    TYPE crmt_bupa_il_header_search.

 

  MOVE-CORRESPONDING is_parameters TO ls_search_criteria.
* Check if the search is made on middlename field
* If any of the additional fields are searched, the BAdI implementation will be called.
  IF  ls_search_criteria-zzmiddlename    IS NOT INITIAL .
    cv_is_not_initial = abap_true.
  ELSE.
    cv_is_not_initial = abap_false.
  ENDIF.

 

In the method - IF_EX_CRM_BUPA_IL_SEARCH_EXT~SEARCH_PARTNERS, write the search query for each of the added fields.

 

*Search for the parameter "Middlename"
  IF ls_search_criteria-zzmiddlename IS NOT INITIAL.
    DESCRIBE TABLE ct_partner_keys LINES lv_lines.
    READ TABLE it_selection_parameters INTO ls_selection_params  WITH KEY attr_name = ‘ZZMIDDLENAME’.
    IF  lv_lines = 0.
      SELECT partner partner_guid FROM but000 INTO TABLE ct_partner_keys UP TO iv_max_hit ROWS
      WHERE MIDDLENAME = ls_selection_params-low.
    ELSE.
      SELECT partner partner_guid FROM but000 INTO TABLE ct_partner_keys FOR ALL ENTRIES IN ct_partner_keys
      WHERE partner = ct_partner_keys-partner AND MIDDLENAME = ls_selection_params-low.
    ENDIF.
  ENDIF.

……………………………………………………………………………………………

 

This concludes the steps for enhancing BP search for standard fields not available in the BP Search structure. These steps are applicable for not just BuilHeaderAdvancedSearch query object but other BP Query objects that use the same query structure and call stack as BuilHeaderAdvancedSearch.

 

Additionally, in this particular example, “Middle Name” was made searchable, but the same steps can be used to make any BP related field searchable, not necessarily belonging to BUT000. Appropriate query (using Joins if needed) can be written in the BADI method – search_partners to accomplish this.

Saved Search in Custom BSP Component

$
0
0

Hello,

 

This document will help you to create a Saved Search in your custom BSP Component.

 

Scenario:

I have a View Set (CompanySearchVS) with three view areas. First ViewArea (search) contains SearchView, second ViewArea (savedsearch) is empty and third ViewArea (result) contains Table View (ResultView) to display result. Second ViewArea will be used to display Saved Search textbox and save button.

 

0.jpg

 

Steps to Implement Saved Search:

 

1. Create Component Usage

          ID: SavedSearchRegistration

          Used Component: CRM_SAVEDSEARCH

          Interface View: RegistrationWindow

 

1.png

  Note: Step 1 will make the following new view available to use into your component SavedSearchRegistration.RegistrationWindow.

 

 

2. Add SavedSearchRegistration.RegistrationWindow in view sets view area savedsearch

 

2.png

 

3. Create three context nodes in component controller as shown below

     a.  Name: SEARCH

          Node Type: Model Node

          BOL Entity: Dynamic Search Component Name (in my scenario COMPANY_DSEARCH)

 

 

     b.  Name: UI

          Node Type: Value Node

          Attributes:  Add one attribute

                         SEARCHCOLLAPSED                    TYPE          ABAP_BOOL

 

 

     c.  Name: NAVIGATIONDESCRIPTOR

          Node Type: Value Node

          Attribute: Add single attribute

                         UI_OBJECT_TYPE                     TYPE           BSP_DLC_OBJECT_TYPE

 

     In method IF_BSP_MODEL~INIT()of NAVIGATIONDESCRIPTOR node set property UI_OBJECT_TYPE as a correspondent UI object. As shown below

 

 

method IF_BSP_MODEL~INIT.

    TYPES: BEGIN OF ltype_attr_struct,

           UI_OBJECT_TYPE TYPE BSP_DLC_OBJECT_TYPE,

           END OF ltype_attr_struct.

    super->if_bsp_model~init( id    = id

                              owner = owner ).

    DATA: lv_struct_ref TYPE REF TO ltype_attr_struct,

          lv_value_node TYPE REF TO cl_bsp_wd_value_node,

          lv_bo_coll    TYPE REF TO if_bol_bo_col.

 

 

    CREATE DATA lv_struct_ref.

    CREATE OBJECT lv_value_node

      EXPORTING

        iv_data_ref = lv_struct_ref.

    CREATE OBJECT lv_bo_coll TYPE cl_crm_bol_bo_col.

 

 

* ZSM_INSUR_OBJ_TYPE replace with your object type

    lv_value_node->if_bol_bo_property_access~set_property_as_string(

iv_attr_name = 'UI_OBJECT_TYPE' iv_value = 'ZSM_INSUR_OBJ_TYPE' ).

 

 

    lv_bo_coll->add( lv_value_node ).

    set_collection( lv_bo_coll ).

endmethod.

 

     Note: Object Type Creation will be explained in Step 13.

 

     Context Nodes will look like this.

3.png

 

4. Redefine WD_USAGE_INITIALIZE method.

     Bind SEARCH and NAVIGATIONDESCRIPTOR nodes of Component Controller with ADVANCEDSEARCH and NAVIGATIONDESCRIPTOR nodes of                  SavedSearchRegistration view respectively.

 

 

     To do this write following code in WD_USAGE_INITIALIZE

 

METHOD wd_usage_initialize.

* Bind context nodes to embedded components

  CASE iv_usage->usage_name.

    WHEN 'SavedSearchRegistration'.

      TRY.

* Bind advanced search context node

        CALL METHOD iv_usage->bind_context_node

          EXPORTING

            iv_controller_type  = cl_bsp_wd_controller=>co_type_component

            iv_target_node_name = 'SEARCH'

            iv_node_2_bind      = 'ADVANCEDSEARCH'.

 

* Bind navigation descriptor

        CALL METHOD iv_usage->bind_context_node

          EXPORTING

            iv_controller_type  = cl_bsp_wd_controller=>co_type_component

            iv_target_node_name = 'NAVIGATIONDESCRIPTOR'

            iv_node_2_bind      = 'NAVIGATIONDESCRIPTOR'.

 

        CATCH cx_root.

      ENDTRY.

  ENDCASE.

ENDMETHOD.

 

 

5. Create Context Node in your search view.

     The structure should be similar to UI Node as shown in the previous step.

     Name: UI

     Node Type: Value Node

     Attributes:  Add one attribute

                      SEARCHCOLLAPSED                    TYPE          ABAP_BOOL

 

 

6. Bind SEARCH and UI Nodes of SearchView to the SEARCH and UI Nodes of Component Controller.

 

6.png

 

7. Create inbound plug savedsearchgo in MainWindow. Write following code

METHOD ip_savedsearchgo.

  me->view_manager->navigate( source_rep_view = me->rep_view

                              data_collection = iv_collection

                              outbound_plug   = 'SavedSearchGo' ).

ENDMETHOD.

 

 

8. Create inbound plug savedsearchedit in MainWindow. Write following code

METHOD ip_savedsearchedit.

  me->view_manager->navigate( source_rep_view = me->rep_view

                              data_collection = iv_collection

                              outbound_plug   = 'SavedSearchEdit' ).

ENDMETHOD.

 

 

9. Create an inbound plug SavedSearchGo in Search view with the following code.

METHOD ip_savedsearchgo.

  DATA: lr_ex              TYPE REF TO cx_root,

        lr_advanced_search TYPE REF TO cl_crm_bol_dquery_service,

        lr_bol_collection  TYPE REF TO cl_crm_bol_entity_col,

        lv_collapsed       TYPE        string.

 

* check if saved search has been received

  TRY.

      lr_advanced_search ?= iv_collection->get_first( ).

    CATCH cx_root INTO lr_ex.

      RETURN.

  ENDTRY.

 

* register search passed

  CREATE OBJECT lr_bol_collection.

  lr_bol_collection->if_bol_bo_col~add( iv_entity = lr_advanced_search ).

  typed_context->search->set_collection( lr_bol_collection ).

 

* execute search

  me->eh_onsearch( ).

 

* collapse selection criteria

  lv_collapsed = abap_true.

  me->typed_context->ui->set_searchcollapsed( attribute_path = ''

                                       value          = lv_collapsed ).

ENDMETHOD.

 

 

10. Create an inbound plug SavedSearchGo in Search view with the following code.

METHOD ip_savedsearchedit.

  DATA: lr_ex              TYPE REF TO cx_root,

        lr_advanced_search TYPE REF TO cl_crm_bol_dquery_service,

        lr_bol_collection  TYPE REF TO cl_crm_bol_entity_col,

        lv_collapsed       TYPE        string.

 

* check if saved search has been received

  TRY.

      lr_advanced_search ?= iv_collection->get_first( ).

    CATCH cx_root INTO lr_ex.

      RETURN.

  ENDTRY.

 

* register search passed

  CREATE OBJECT lr_bol_collection.

  lr_bol_collection->if_bol_bo_col~add( iv_entity = lr_advanced_search ).

  typed_context->search->set_collection( lr_bol_collection ).

 

* execute search

  me->eh_onsearch( ).

 

* collapse selection criteria

  lv_collapsed = abap_true.

  me->typed_context->ui->set_searchcollapsed( attribute_path = ''

                                        value          = lv_collapsed ).

ENDMETHOD.

 

11. Create Navigation links SavedSearchGo and SavedSearchEdit between MainWindow to SearchView.

 

11.png

 

12. Expose MainWindow as shown below

12.png

 

13. Create Object Type:

     Go to transaction SPRO: CRM -> UI Framework -> UI Framework Definition -> Define Object Type

 

13.png

 

14. Create New Entry for the object type

 

14.png

 

Note:- Now add your component to Navigation Bar. Refer following link

 

Add your custom BSP component as a link in a Work Center

 

15. Define Work Area for your component repository.

 

15.png

 

16. Define your component with exposed window.

 

16.png

 

17. Select created an entry and go to inbound plug.

 

17.png

 

18. Go to Navigation Bar Profile

     In Define Profile select SLS-PRO profile and add two entries in Define Generic OP Mapping as shown below

 

18.png

Test your component in CRM_UI.

 

Hope this document is helpful.....

 

ITAB_DUPLICATE_ENTRY DUMP

$
0
0

ITAB_DUPLICATE_KEY DUMP

Hi Everyone,

 

ITAB_DUPLICATE_ENTRY DUMP was a dump, we were getting more often, when I started working with CRM. When tried to resolve it, I Couldn't find proper guidance to solve the problem. So decided to resolve it and prepare a document so others can resolve it easily.

 

The dump ITAB_DUPLICATE_KEY occurs in situations like 2 views/windows have same name or assigning a same view/viewset/overview page more than once.

Example


Cause: img1.JPG

Result Dump:

img2.JPG

This leads to creation of a duplicate key in the Repository.xml, which is generated by a BSP Application for each component set.

Solution:

This can be resolved by deleting the duplicate data created in the repository.xml manually. Steps to be followed are as follows.

Step 1:

Use the T-Code SE80 to go to Object Navigator.


img3.JPG

 

Step 2:

From the first drop down on the left side, select the "BSP Application" option.


img4.JPG

Step 3:

Enter your application component set name in which you have the dump, in the textbox next to the where you selected BSP Application and press enter.

This will display all the classes that the CRM framework has generated for the particular component along with the Repository.xml file.

img5.JPG

Step 4:

  • Double click on Repository.xml file and check for the duplicate entry.
  • Change the mode of file to Edit mode.
  • Now delete the appropriate duplicate entry as per your requirement and activate the Repository.xml.
  • This will resolve the problem of ITAB_DUPLICATE_KEY Dump and restore component to its normal working.

 

img6.JPG

Business Partner Change history for Custom Table

$
0
0

This document describes how to show custom table changes in the Business partner change history assignment block.

 

Assumptions :

 

1. Change documents are created for the custom table which you want to show.

2. Custom table data is linked with business partner.

 

Please follow the below steps to show change history :

 

1.  Make the New entry for the object in SM30 view  : V_TBZ0A for application object BUPA.

Example Entry :

Application : ZCUS

Description : Customer Object Change Documents

Active = X

 

2. Create the New function module as follows and put code as shown.

 

Z_BUPA_EVENT_CHG1_CUSTOM

 

Importing Parameters :

 

NameTypeData ElementDefaultOptional
I_XGLOBALTYPECHAR1                   X
I_XDIALOGTYPECHAR1                   X
I_XCHDOCLIKEBOOLE-BOOLE'X'X





 

Tables Parameters:

 

NameTypeStructureOptional
T_VALUE_OBJECTIDLIKEBUS0RANGEX                                                                             
T_OBJECTIDLIKEBUS0AENDX                                                                             

 

Put Below Code :

 

data:   ls_cdobjectid type bus0aend.

 

GET THE PARTNER NUMBER FROM TABLE : T_VALUE_OBJECTID[]

 

GET ALL THE ENTRIES FROM CDHDR FOR YOUR CUSTOM OBJECT. - See assumption no 1 for further information.

 

LOOP AT CDHDR.

 

ls_cdobjectid-objectclas = 'CUSTOM CHANGE DOCUMENT NUMBER'.


ls_cdobjectid-objectid   = ENTRY FROM THE CDHDR TABLE FOR YOUR OBJECT.

 

append ls_cdobjectid to t_objectid.

 

ENDLOOP.

 

3.Make following customizing entry

 

TCode: SM34 -> View Cluster : BUPATBZ1AR -> Maintain

 

Select EVENT = CHGD1

 

EVENT->FUNCTION MODULES : Application Object : BUPA

 

Make New Entry :

Item = 9999999

Function Module Name : Z_BUPA_EVENT_CHG1_CUSTOM - As above created in Step 2

Call = 'X'

Appl. = ZCUS - As Above created in Step 1

 

Now you can test it.

New Skin Management/Adjustment from CRM7.0 Ehp1

$
0
0

Overview:

 

We had to copy and adjust skins in network folder, bsp application or skin workbench before which is inconvenient.  As of SAP enhancement package 1 for SAP CRM 7.0, business function UI_FRW_1, we can adjust skins such as icon personalization and configuration, SAP logo change on WebClient UI in a much easier way.

 

This documents includes the exact steps in order to achieve skin adjustment. For example:

 

1.change logo and logo text

 

change before:

1%20Capture.PNG

 

change after:

2%20Capture.PNG

 

2.change color in webui based on css files adjustment.

 

change before:

1 Capture.PNG

 

change after:

2Capture.PNG

 

3.change the image above workcenter

 

change before:

31 Capture.PNG

change after:

 

32 Capture.PNG

 

The exact steps to achieve above:

 

1.change logo and logo text

 

Please follow the steps mentioned in below KBA.


1849835 - how to exchange logo in WebUI without skin copy by using customize node "Define Icons"

1713658 - Missing customize node "Define Icons" at IMG


2.change color in webui based on css files adjustment.

 

Please follow the steps mentioned in below Wiki Page:

 

New Skin Management Part 2 - An easy way for CSS files adjustment from CRM7.0 Ehp1

 

3.change the image above workcenter

 

New Skin Management Part 3 - Example about how to change the image above WorkCentre from CRM7.0 Ehp1

 

By the way if you want to know more about how to use css file, please check following Wiki link. 

 

How-to Guide: Copy and Adjust Skins (SAP CRM 7.0)

 

Wish you like configure skin on webui.

 

Bruce

To restrict the copy functionality of text from description text type to vendor text type on UI

$
0
0

Requirement - to restrict the copy text from description to vendor text type if all mandatory fields are not entered on UI

 

In TCODE – BSP_WD_CMPWB

 

Please see image 1 of attachments.

 

GO inside the selected class –

 

Please see image 2 of attachments.

 

Select the EH_ONSAVE method,

 

Code written for the requirement mentioned above –

 

***code logic to retrict the copy text from desc to vendor text type if all mandatory fields are not entered on UI
    lr_controller ?= comp_controller->m_parent.
    lr_msg_srv ?= me->view_manager->get_message_service( ).
* If the mandatory fields check is already performed
* in the redefined child method,´it need not run again.

    IF cl_crm_uiu_bt_tools=>mandatory_flds_no_save_allowed( ir_controller = lr_controller
                                                           ir_msg_srv    = lr_msg_srv ) = abap_true.
      EXIT.
    ENDIF.
***code logic to retrict the copy text from desc to vendor text type if all mandatory fields are not entered on UI

Error Message raise Validation in CRM UI

$
0
0

Requirement:If an incident is edited by another user (apart from the one who created the incident) then CRM displays the message ‘Transaction 800007XXXXX is being processed by user T_BSUPP”. Project requirement would like to display the user’s first name and last name instead of the user id T_BSUPP. 

It should come like the message highlighted below,

 

 

Please see image 1 of attachments.

 

Pseudo code –

A pre exit is required to be created in SE24 Class - CL_CHTMLB_CONFIG_UTILITY for method – CREATE_MESSAGE_AREA.

 

Please see image 2 of attachments.

 

Code inside the Pre exit –

 

Please see image 5 of attachments.

 

 

 


Saved Search in Custom BSP Component

$
0
0

Hello,

 

This document will help you to create a Saved Search in your custom BSP Component.

 

Scenario:

I have a View Set (CompanySearchVS) with three view areas. First ViewArea (search) contains SearchView, second ViewArea (savedsearch) is empty and third ViewArea (result) contains Table View (ResultView) to display result. Second ViewArea will be used to display Saved Search textbox and save button.

 

0.jpg

 

Steps to Implement Saved Search:

 

1. Create Component Usage

          ID: SavedSearchRegistration

          Used Component: CRM_SAVEDSEARCH

          Interface View: RegistrationWindow

 

1.png

  Note: Step 1 will make the following new view available to use into your component SavedSearchRegistration.RegistrationWindow.

 

 

2. Add SavedSearchRegistration.RegistrationWindow in view sets view area savedsearch

 

2.png

 

3. Create three context nodes in component controller as shown below

     a.  Name: SEARCH

          Node Type: Model Node

          BOL Entity: Dynamic Search Component Name (in my scenario COMPANY_DSEARCH)

 

 

     b.  Name: UI

          Node Type: Value Node

          Attributes:  Add one attribute

                         SEARCHCOLLAPSED                    TYPE          ABAP_BOOL

 

 

     c.  Name: NAVIGATIONDESCRIPTOR

          Node Type: Value Node

          Attribute: Add single attribute

                         UI_OBJECT_TYPE                     TYPE           BSP_DLC_OBJECT_TYPE

 

     In method IF_BSP_MODEL~INIT()of NAVIGATIONDESCRIPTOR node set property UI_OBJECT_TYPE as a correspondent UI object. As shown below

 

 

method IF_BSP_MODEL~INIT.

    TYPES: BEGIN OF ltype_attr_struct,

           UI_OBJECT_TYPE TYPE BSP_DLC_OBJECT_TYPE,

           END OF ltype_attr_struct.

    super->if_bsp_model~init( id    = id

                              owner = owner ).

    DATA: lv_struct_ref TYPE REF TO ltype_attr_struct,

          lv_value_node TYPE REF TO cl_bsp_wd_value_node,

          lv_bo_coll    TYPE REF TO if_bol_bo_col.

 

 

    CREATE DATA lv_struct_ref.

    CREATE OBJECT lv_value_node

      EXPORTING

        iv_data_ref = lv_struct_ref.

    CREATE OBJECT lv_bo_coll TYPE cl_crm_bol_bo_col.

 

 

* ZSM_INSUR_OBJ_TYPE replace with your object type

    lv_value_node->if_bol_bo_property_access~set_property_as_string(

iv_attr_name = 'UI_OBJECT_TYPE' iv_value = 'ZSM_INSUR_OBJ_TYPE' ).

 

 

    lv_bo_coll->add( lv_value_node ).

    set_collection( lv_bo_coll ).

endmethod.

 

     Note: Object Type Creation will be explained in Step 13.

 

     Context Nodes will look like this.

3.png

 

4. Redefine WD_USAGE_INITIALIZE method.

     Bind SEARCH and NAVIGATIONDESCRIPTOR nodes of Component Controller with ADVANCEDSEARCH and NAVIGATIONDESCRIPTOR nodes of                  SavedSearchRegistration view respectively.

 

 

     To do this write following code in WD_USAGE_INITIALIZE

 

METHOD wd_usage_initialize.

* Bind context nodes to embedded components

  CASE iv_usage->usage_name.

    WHEN 'SavedSearchRegistration'.

      TRY.

* Bind advanced search context node

        CALL METHOD iv_usage->bind_context_node

          EXPORTING

            iv_controller_type  = cl_bsp_wd_controller=>co_type_component

            iv_target_node_name = 'SEARCH'

            iv_node_2_bind      = 'ADVANCEDSEARCH'.

 

* Bind navigation descriptor

        CALL METHOD iv_usage->bind_context_node

          EXPORTING

            iv_controller_type  = cl_bsp_wd_controller=>co_type_component

            iv_target_node_name = 'NAVIGATIONDESCRIPTOR'

            iv_node_2_bind      = 'NAVIGATIONDESCRIPTOR'.

 

        CATCH cx_root.

      ENDTRY.

  ENDCASE.

ENDMETHOD.

 

 

5. Create Context Node in your search view.

     The structure should be similar to UI Node as shown in the previous step.

     Name: UI

     Node Type: Value Node

     Attributes:  Add one attribute

                      SEARCHCOLLAPSED                    TYPE          ABAP_BOOL

 

 

6. Bind SEARCH and UI Nodes of SearchView to the SEARCH and UI Nodes of Component Controller.

 

6.png

 

7. Create inbound plug savedsearchgo in MainWindow. Write following code

METHOD ip_savedsearchgo.

  me->view_manager->navigate( source_rep_view = me->rep_view

                              data_collection = iv_collection

                              outbound_plug   = 'SavedSearchGo' ).

ENDMETHOD.

 

 

8. Create inbound plug savedsearchedit in MainWindow. Write following code

METHOD ip_savedsearchedit.

  me->view_manager->navigate( source_rep_view = me->rep_view

                              data_collection = iv_collection

                              outbound_plug   = 'SavedSearchEdit' ).

ENDMETHOD.

 

 

9. Create an inbound plug SavedSearchGo in Search view with the following code.

METHOD ip_savedsearchgo.

  DATA: lr_ex              TYPE REF TO cx_root,

        lr_advanced_search TYPE REF TO cl_crm_bol_dquery_service,

        lr_bol_collection  TYPE REF TO cl_crm_bol_entity_col,

        lv_collapsed       TYPE        string.

 

* check if saved search has been received

  TRY.

      lr_advanced_search ?= iv_collection->get_first( ).

    CATCH cx_root INTO lr_ex.

      RETURN.

  ENDTRY.

 

* register search passed

  CREATE OBJECT lr_bol_collection.

  lr_bol_collection->if_bol_bo_col~add( iv_entity = lr_advanced_search ).

  typed_context->search->set_collection( lr_bol_collection ).

 

* execute search

  me->eh_onsearch( ).

 

* collapse selection criteria

  lv_collapsed = abap_true.

  me->typed_context->ui->set_searchcollapsed( attribute_path = ''

                                       value          = lv_collapsed ).

ENDMETHOD.

 

 

10. Create an inbound plug SavedSearchGo in Search view with the following code.

METHOD ip_savedsearchedit.

  DATA: lr_ex              TYPE REF TO cx_root,

        lr_advanced_search TYPE REF TO cl_crm_bol_dquery_service,

        lr_bol_collection  TYPE REF TO cl_crm_bol_entity_col,

        lv_collapsed       TYPE        string.

 

* check if saved search has been received

  TRY.

      lr_advanced_search ?= iv_collection->get_first( ).

    CATCH cx_root INTO lr_ex.

      RETURN.

  ENDTRY.

 

* register search passed

  CREATE OBJECT lr_bol_collection.

  lr_bol_collection->if_bol_bo_col~add( iv_entity = lr_advanced_search ).

  typed_context->search->set_collection( lr_bol_collection ).

 

* execute search

  me->eh_onsearch( ).

 

* collapse selection criteria

  lv_collapsed = abap_true.

  me->typed_context->ui->set_searchcollapsed( attribute_path = ''

                                        value          = lv_collapsed ).

ENDMETHOD.

 

11. Create Navigation links SavedSearchGo and SavedSearchEdit between MainWindow to SearchView.

 

11.png

 

12. Expose MainWindow as shown below

12.png

 

13. Create Object Type:

     Go to transaction SPRO: CRM -> UI Framework -> UI Framework Definition -> Define Object Type

 

13.png

 

14. Create New Entry for the object type

 

14.png

 

Note:- Now add your component to Navigation Bar. Refer following link

 

Add your custom BSP component as a link in a Work Center

 

15. Define Work Area for your component repository.

 

15.png

 

16. Define your component with exposed window.

 

16.png

 

17. Select created an entry and go to inbound plug.

 

17.png

 

18. Go to Navigation Bar Profile

     In Define Profile select SLS-PRO profile and add two entries in Define Generic OP Mapping as shown below

 

18.png

Test your component in CRM_UI.

 

Hope this document is helpful.....

 

Creating a Search Page in SAP CRM 7.0 EHP 1

$
0
0
  • With the SAP CRM 7.0 EHP1 (Enhancement Pack 1), new wizard for Search Page is available which enable the creation of Search pages in a simpler and standard manner.

 

 

  • Search Page is a view set that hosts a search query view and result view

 

  1. Creating and Defining a Model

  • Open a Component Workbench  BSP_WD_CMPWB  and enter the component name. e.g. ZSEARCH_PAGE
  • Click on Create.
  • New Abap objects created one by one needs to assigned and stored in a single package and transport request.

 

Once you click on Save all the classes are generated automatically.

 

Window will have its own IMPL class  ZL_ZSEARCH__MAINWINDOW_IMPL  and controller  MainWindow.do

Window Context IMPL class as  ZL_ZSEARCH__MAINWINDOW_CTXT .

Component Controller BSPWDComponent.do  with its IMPL Class ZL_ZSEARCH__BSPWDCOMPONEN_IMPL

Component Controller context IMPL class  ZL_ZSEARCH__BSPWDCOMPONEN_CTXT is created.

 

  2. Add Model

 

   Click to RUNTIME REPOSITORY EDITOR -> Switch to edit mode -> Right click on Model ->

   ADD MODEL.

 

 

 

3. Create Custom Controller

 

  • Custom Controller is used to share the data between two views.We will used later
  • Step-> Define Name as ZCuCo -> Add Model Node  as BuilHeader -> Continue  till Last step.

 

 

 

4. Creating a Search Page

 

  • Next Step is Creating a Search Page -> Right Click on View-> Create Search Page as Shown below

 

    

 

  • It  will create a New Search Page , Window , Search View and Result view, View Set  automatically  -> Continue .

 

   

 

  • As we are creating an Advanced search ,  Select BOL object  for

        Search Query node , Once you selected wizard will automatically fetch corresponding Result node.


 

 

 

  • You can define options – as Saved Search Creation , Navigation Links , Result View Selections etc.
  • Here we are creating a Navigation Link as BP_NUMBER .
  • You can define Buttons as well by default.

 

 

  • So 3 Views are created using that Search View Page
  • Search Page as View Set
  • SearchQueryView as AdvancedSearchView
  • SearchResultView as Display View

 

 

  • you can can see in Runtime repository how the viewsets , viewarea and views are bounded together.

 

   5.Search Query Config

 

  Click on Configuration tab -> click on edit mode ->Create new Configuration and Accept Default values

  - > Show available fields->Drag or Drop on Selected search criteria list.

 

 

  6. SearchResultConfig

 

 

 

Testing Component

 

 

Change Color of the Label and Input field in UI for Form View - Part 1

$
0
0

     In CRM UI it is possible to customize the fields and labels so that the properties of fields or labels can be adjusted as we want. It is able to change the following properties of a field or label:

  • Color.
  • Border of text field.
  • Type of input text field (Password).
  • Alignment, etc.


     To set the properties you should have a little knowledge of html tags. The iterator class should be created for changing the property. The iterator class is triggered for each of the label and field that has to be displayed in the UI. Ex: Assume you have two fields ID and Name, iterator class is called twice for each of the fields, i.e., one for label and input field. So iterator is called 4 times.

 

 

Procedure:

Step 1: Assume we have a BSP Application. Create a form view with a value node called ‘COUNTRY’, with four attributes.

Color.png

 

Step 2: Create a Z Class in SE24, say ZL_THTMLB_FORM_ITERATOR_SAMPLE. Add an interface IF_CHTMLB_FORM_ITERATOR.

 

 

Step 3: Implement the method RENDER_CELL_START of interface IF_CHTMLB_FORM_ITERATOR.

 

METHOD if_chtmlb_form_iterator~render_cell_start.
DATA: lv_bee     TYPE REF TO cl_bsp_bee_table.
DATA: lv_html    TYPE string.

* Create the replacement element
CREATE OBJECT lv_bee.

* Check whether this class is called for label or input field
IF iv_element_name   = 'label'.
*   Set the color of the label to red using the style tag
" Here 'C1_W1_V2_V5_thtmlb_label_4' is the ID for the label 'Name'
lv_html
= '<style> label#C1_W1_V2_V5_thtmlb_label_4{ color:#FF0000; } </style>'.
ELSEIF iv_element_name   = 'inputfield'.
*   Set the color of input field to red
" Here 'C1_W1_V2_V5_country_countryname' is the ID for input field
lv_html
= '<style> input#C1_W1_V2_V5_country_countryname{ border-color:red;} </style>'.
ENDIF.

* Add the new html code
lv_bee
->add_html( html = lv_html level = 1 ).
lv_bee
->add_bee( bee = iv_element_bee  level = 2 ).
* Return the new html
ev_replacement_bee
= lv_bee.
ENDMETHOD.

 

Here I am changing the color of attribute country name. Now the question is how to get ID’s of label and input field. Follow the next step.

 

 

Step 4: Open the standard method IF_BSP_ELEMENT~DO_AT_BEGINNING of class CL_THTMLB_LABEL. This method gets called for each of the labels that is going to be displayed in the UI.

Put breakpoint at this method at line 16 (right after the method me->resolve_model_binding( ).). Watch the values of me->for andme->id variables.

In my UI I have four fields, so this method gets called for four times.

For attribute Country ID

Color.jpg

For attribute Country Code

Color.jpg

For attribute Country Name

Color.jpg

For attribute Country Language

Color.jpg

ME->ID holds the label ID. This ID should be used in RENDER_CELL_START method.

 

 

Note: In the same way to find the ID for the input fields, debug the method IF_BSP_ELEMENT~DO_AT_BEGINNING of class CL_THTMLB_INPUTFIELD. Check the field ME->ID. Even this method gets called for each of the field.

Color.jpg

 

Step 5: Change the HTM file of form view to set the iterator.

Make the change as shown in the snap.

Color.jpg

Line 6 -> Define a reference variable of the class which you created earlier.

Line 9 -> Create object.

Line 11 -> Set the iterator.

 

For Changing other properties of the input field or label: Change Property of the Label and Input field in UI for Form View - Part 2


Snapshot:

Color.jpg

Change Property of the Label and Input field in UI for Form View - Part 2

$
0
0

In the previous tutorial Change Color of the Label and Input field in UI for Form View - Part 1 I have shown how to change the color property of the fields or labels.

 

In this tutorial I am going to show how to change the properties of an input field and labels.

 

Step 1: I have created a BSP Application with a value node which has four attributes.color1.jpg


Step 2: Create a Z Class in SE24, say ZL_THTMLB_FORM_ITERATOR_SAMPLE. Add an interface IF_CHTMLB_FORM_ITERATOR.

 


Step 3: Implement the method RENDER_CELL_START of interface IF_CHTMLB_FORM_ITERATOR.

METHOD if_chtmlb_form_iterator~render_cell_start.
DATA: lr_bee        TYPE REF TO cl_bsp_bee_table,
lr_label     
TYPE REF TO cl_thtmlb_label,      " Label Properties
lr_inputfield
TYPE REF TO cl_thtmlb_inputfield, " Input field Properties
lv_html      
TYPE        string.

CREATE OBJECT lr_bee.

CASE iv_binding_string.
WHEN '//COUNTRY/COUNTRYNAME'.         " Check the current processing field is for countryname
IF iv_element_name = 'label'.
lr_label ?= iv_element_bee
.
lr_label
->design = 'HEADER1'.     " Style of label (font property)
lr_label
->textdirection = 'LTR'" Label Direction (Left)
lr_label
->required = abap_true.   " Creates required mark on label
ENDIF.

WHEN '//COUNTRY/COUNTRYCODE'.         " Check the current processing field is for countrycode
IF iv_element_name = 'inputfield'.
lr_inputfield ?= iv_element_bee
.
lr_inputfield
->password = abap_true" Makes field as password field
lr_inputfield
->tooltip = 'Enter Password'. " Tool tip for the field
ENDIF.
ENDCASE.

lr_bee
->add_bee( bee = iv_element_bee level = 2 ).
ev_replacement_bee
= lr_bee.
ENDMETHOD.

 

 

Note: //COUNTRY/COUNTRYNAME - Here COUNTRY is the value node and COUNTRYNAME is the attribute of that node.

 

 

Step 4: Change the HTM file of form view to set the iterator.

color.JPG

 

Snapshot:

color.JPG

The label “Name” is bold, left aligned, and size is increased with mandatory indication.

Differentiate Between Logical Links in WEBUI

$
0
0

In some case we will have same logical link ID or different logical link ID pointing to same Target ID. But we need to differentiate between them based on the name or type of the links in Web UI screen. In this kind of situation we can make use of the option parameter class while creating the logical link ID.

Step1: Create the new customized class and implement the interface IF_UI_LINK_PARAMETER_CLASS in it and assign this class to logical link ID.


Step2: The following methods will be available in the customized class,

IF_UI_LINK_PARAMETER_CLASS~CREATE_PARAMETER_OBJECT
IF_UI_LINK_PARAMETER_CLASS~PROCESS_DATA_COLLECTION
IF_UI_LINK_PARAMETER_CLASS~GET_AUTHORIZATION

Whenever the link is clicked these above methods will be hit, so make the custom logic inside it.

Step3: Also we can create some static methods or attributes in this class and we can make use of that wherever needed.

Note: If you create any global or static variables, clear those things after usage.

 

 

Example Scenarios:

1) Need to find which sales order transaction type( PROCESS_TYPE ) user have selected while creation, generally sales order create link will have one common target ID. Target ID: IC_UIU_SLO  Class : CL_CRM_IC_UIU_NAV_HELPER

 

2) Account create is available in standard. Requirement to create a custom logical links to add the create prospect  link in web-UI along with addition of prospect role by default. Here both links will have a common Target ID.

 

3) Transaction Launcher to load different transaction from CRM / ERP Class: CL_CRM_UI_LTX_NAVBAR_PARAM

 

4) To get BI Reports from BI System: Logical Link: UTL-SSP-RE  Class: CL_CRM_GEN_UI_BI_UTIL

How to make input fields mandatory in CRM WEB UI

$
0
0

Brief

You want to make an input field mandatory so that a user is unable to save changes unless the required field is not empty.

If you created the BSP component from scratch you're probably well aware of how to do this. But this example is based on making a field in a standard SAP component mandatory.

Here I wanted to make my change to the Service Request details page. A user should not be allowed to save a service request they edited if they do not have level 1 or level 2 categories specified.

 

Actions

  • Discover UI component and view used via pressing F2 on the field in the WEB UI
    • For my example the Component is BTCATEGORIES and the view is BTCATEGORIES/Categories
  • Go to UI Component Workbench (transaction BSP_WD_CMPWB)
  • Open the View, navigate to the UI Configuration Tool tab, copy the configuration currently used and specify Role Key, Component Usage, Object Type and Object Subtype.
    • If you're unsure of what parameters to use, hitting F2 on the field in the WEB UI will show you what parameters are being searched for.
    • I advise you to read more about what these mean as you could be changing the configuration for more than just your intended scenario.
  • In new configuration scenario, select the field you're after, click ‘Show Field Properties’, check the Mandatory check-box.
  • Apply and Save. Restart Web UI browser to view the change.

 

End Result

When a user clicks ‘Save’, the eh_onsave() method checks all mandatory fields in the screen for any that are blank. If one is encountered it cancels the save and highlights the blank fields with a red border.

Standard field as search field

$
0
0
Purpose:
The purpose of the document is to reduce the technical effort required in developing similar requirement.
Introduction:
This document is a reference work for the technical developers to add a standard attribute to the search criteria. I worked in a SAP CRM implementation project wherein we had similar requirement for activities.
Requirement:

Activity Search functionality provides the user with a tool to search for all Activities created in the system. Customer requires the ability to use Reason (Appointment Reason) field as a search criteria while searching for Activities in the system. The Reason search criteria would have a value field containing all FS related Appointment reasons. On using this search criterion, Users can select reasons in value field and search which provided in the results all Activities which contain that particular reason / reasons selected in search value. There are various search criteria provided by the SAP. Reason field is not provided by standard SAP and we will enhance functionality to provide the same.

Solution:
  • To achieve this functionality, go to transaction code se11 and open the data type CRMST_QUERY_ACT_BTIL and add a custom field ZCONC_KEY. Below screenshots gives the details

           Datatype.png
               Click on append structure

            ZCONC_KEY field.png
             ZCONC_KEY field2.png
             ZCONC_KEY field3.png

  • Launch transaction code sm34 and enter cluster view name as 'CRMVC_DQ' and click on 'Maintain'.     
  • Select DQuery Object Name as 'BTQAct' and click on 'exceptions per attribute'.
  • Click on 'New entries' and add the Attribute CONC_KEY.
  • Select the option 'X Indicates Options that are available'.
  • Check the desired checkboxes for 'EQ', 'BT', 'LT' and 'GT'.

          Below screenshots gives the details

 

            Cluster1.png

 

             Cluster2.png

             Cluster3.png

             Cluster4.png

 

 

  • Launch transaction BSP_WD_CMPWB and open the component BT126S_APPT.
  • Enhance the component and the view BT126S_APPT/ApptSQ.
  • Enhance the context node BTQACT and generate getter and setter method for z field STRUCT.ZCONC_KEY.

 

             Cluster5.png

 

                  

 

  • Implement GET_P and GET_V methods of the attribute to make the attribute as drop down and provide drop down values.

 

                    Method GET_P_ZCONC_KEY

                   

                    CASE IV_PROPERTY
                     WHEN IF_BSP_WD_MODEL_SETTER_GETTER=>FP_FIELDTYPE.
                     RV_VALUE = CL_BSP_DLC_VIEW_DESCRIPTOR=>FIELD_TYPE_PICKLIST.

                     ENDCASE

                     ENDMETHOD

 

                    METHOD GET_P_ZCONC_KEY

                    DATA: LT_DDLB TYPE BSP_WD_DROPDOWN_TABLE,
                    LS_DDLB LIKE LINE OF LT_DDLB.

 

                   IF NOT GR_DDLB IS BOUND.
                   CREATE OBJECT GR_DDLB
                     EXPORTING
                       IV_SOURCE_TYPE = 'T'.
                   ENDIF

 

                  LS_DDLB-KEY   = ‘1’.
                  LS_DDLB-VALUE = VALUE1.
                  INSERT LS_DDLB INTO TABLE LT_DDLB.

                  LS_DDLB-KEY   = ‘2’.
                  LS_DDLB-VALUE = VALUE2.
                  INSERT LS_DDLB INTO TABLE LT_DDLB.

 

                 GR_DDLB->SET_SELECTION_TABLE (IT_SELECTION_TABLE = LT_DDLB).

 


                 RV_VALUEHELP_DESCRIPTOR = GR_DDLB.

                 ENDMETHOD

 

  • Launch transaction code se19 and create an implementation for the BADI CRM_BADI_RF_Q1O_SEARCH and write the following code.
  • Loop at the importing parameter IT_MULTIVALUES of the BADI and check whether a field named ZCONC_KEY is there or not. If so, pass the value of the attribute to a local variable LV_REASON.

 

               

                 LS_SELECTION_PARAMETERS-SIGN = 'I'.
                 LS_SELECTION_PARAMETERS-OPTION =
'EQ'.
                
FIELD-SYMBOLS: <LS_SEARCH_TAB> LIKELINEOF IT_SEARCH_TAB.


                
DATA LS_RFW_MULTIVALUES TYPE CRMT_REPORT_SEARCH_MULTI_VAL.
                
LOOPAT IT_SEARCH_TAB ASSIGNING<LS_SEARCH_TAB>.
                 LS_SELECTION_PARAMETERS-ATTR_NAME = <LS_SEARCH_TAB>-NAME.
                 LS_SELECTION_PARAMETERS-LOW = <LS_SEARCH_TAB>-
VALUE.
                
INSERT LS_SELECTION_PARAMETERS INTOTABLE LT_SELECTION_PARAMETERS.
                
ENDLOOP.


                
FIELD-SYMBOLS: <LS_MULTIVALUES> LIKELINEOF IT_MULTIVALUES.
                
LOOPAT IT_MULTIVALUES ASSIGNING<LS_MULTIVALUES>.
                 LS_SELECTION_PARAMETERS-ATTR_NAME = <LS_MULTIVALUES>-FIELDNAME.
                
IF    <LS_MULTIVALUES>-FIELDNAME EQ'ZCONC_KEY'.
                 LV_REASON =
'X'.
                
ELSE.
                 LS_MULTIVALUES = <LS_MULTIVALUES>.
                
APPEND LS_MULTIVALUES TO LT_MULTIVALUES.
                
IF<LS_MULTIVALUES>-FIELDNAME EQ'OBJECT_ID'.
                  LV_OBJECT =
'X'.
                
ENDIF.
                
CLEAR LV_AUTO
                
ENDIF.


                
FIELD-SYMBOLS: <LS_SEARCHVALUES> LIKELINEOF<LS_MULTIVALUES>-SEARCHVALUES.
                
LOOPAT<LS_MULTIVALUES>-SEARCHVALUES ASSIGNING<LS_SEARCHVALUES>


                
IF LV_REASON = 'X'.
                  LV_STATREASON = <LS_SEARCHVALUES>-LOW.
                 
CLEAR LV_REASON.
                
ENDIF.

                
MOVE-CORRESPONDING <LS_SEARCHVALUES> TO LS_SELECTION_PARAMETERS
                
INSERT LS_SELECTION_PARAMETERS INTOTABLE LT_SELECTION_PARAMETERS
                
ENDLOOP.
                
ENDLOOP.

 

  • Based on reason field availability in the search criteria filter the records as below

 

      

          **CHECK IF THE SELECTION CRITERIA HAS A VALUE IN REASON CODE
                
IF LV_REASON ISINITIAL.
                
CALLFUNCTION'CRM_BSP_OIC_1O_SEARCH_FROM_RF'
                    
EXPORTING
                            IT_SEARCH_TAB             = IT_SEARCH_TAB
                            IV_NUMBER                 = IV_NUMBER
                            IT_MULTIVALUES            = LT_MULTIVALUES
                            IV_EXTERN_CALL            =
'X'
                            IV_SELECT_FOR_HEADERLEVEL =
'X'
                            IV_CALL_AUTHORITY_BADI    =
'X'
                   
IMPORTING
                           ET_GUIDLIST               = LT_GUIDLIST
                           ET_RETURN                 = ET_RETURN.
                   ET_GUIDLIST = LT_GUIDLIST.
                
ELSE
                  
DESCRIBETABLE LT_MULTIVALUES LINESLV_COUNT.
                
IF LV_COUNT >= 1OR LV_OBJID ISNOTINITIAL.
               
CALLFUNCTION'CRM_BSP_OIC_1O_SEARCH_FROM_RF'
                      
EXPORTING
                              IT_SEARCH_TAB             = IT_SEARCH_TAB
                              IT_MULTIVALUES            = LT_MULTIVALUES
                              IV_EXTERN_CALL            =
'X'
                              IV_SELECT_FOR_HEADERLEVEL =
'X'
                              IV_CALL_AUTHORITY_BADI    =
'X'
                      
IMPORTING
                              ET_GUIDLIST               = LT_GUIDLIST
                              ET_RETURN                 = ET_RETURN.


                     LT_GUID = LT_GUIDLIST.
                    
IF LV_STATREASON ISNOTINITIALAND LT_GUID ISNOTINITIAL.**********
                       STR1 =
'A1'.
                       STR2 =
'Z0000003'.
                      
CASE LV_STATREASON
                       
WHEN'DROPDOWNVALUE1'.
                         STR3 =
'Z001'.
                      
WHEN' DROPDOWNVALUE2'.
                         STR3 =
'Z002'.
                     
WHEN' DROPDOWNVALUE3'.
                         STR3 =
'Z003'.
                     
WHEN' DROPDOWNVALUE4.
                          STR3 =
'Z004'.
                   
ENDCASE.*
                   
SELECT CRMD_ORDERADM_H~GUID FROMCRMD_ORDERADM_H INNER JOIN CRMD_LINK AS LINKON LINK~GUID_HI = CRMD_ORDERADM_H~GUID
                    INNER
JOIN  CRMD_SRV_OSSET ASSET
                         
ONSET~GUID_SET = LINK~GUID_SET
                    INNER
JOIN CRMD_SRV_SUBJECT AS SUBJECT
                         
ON SUBJECT~GUID_REF = SET~GUID
                    
INTOTABLE LT_GUIDS FORALL ENTRIES IN LT_GUID
                  
WHERE
                    CRMD_ORDERADM_H~GUID = LT_GUID-TABLE_LINE
                    
AND LINK~OBJTYPE_SET = '29'
                   
AND SUBJECT~KATALOGART = STR1 AND SUBJECT~CODEGRUPPE = STR2
                  
AND SUBJECT~CODE =  STR3.


                  LT_GUID = LT_GUIDS.
                 
IF IV_NUMBER ISNOTINITIAL
                  LV_NUM = IV_NUMBER.
                 
APPENDLINESOF LT_GUID FROM1TO IV_NUMBER TO ET_GUIDLIST.
                 
ELSE
                   LV_NUM =
100.
                 
APPENDLINESOF LT_GUID FROM1TO LV_NUM TO ET_GUIDLIST.
                 
ENDIF
                 
ELSE
                  LT_GUID = LT_GUIDLIST.


                 
IF IV_NUMBER ISNOT INITIAL
                  LV_NUM = IV_NUMBER.
                 
APPENDLINESOF LT_GUID FROM1TO IV_NUMBER TO ET_GUIDLIST.
                
ELSE
                 LV_NUM =
100.
                
APPENDLINESOF LT_GUID FROM1TO LV_NUM TO ET_GUIDLIST.
               
ENDIF
              
ENDIF.


              

             ENDMETHOD.

DESCRIBETABLE LT_GUID LINES LV_LINES.
              
IF LV_LINES > LV_NUM.
              
MOVE LV_NUM TO LV_HELP_PAR1.
             
MOVE LV_HELP_PAR1 TO LV_PAR1.
             
CALLFUNCTION'BALW_BAPIRETURN_GET2'
                   
EXPORTING
                           
TYPE   = 'S'
                               CL     =
'CRM_BSP_FRAME'
                        
NUMBER = '017'
                              PAR1   = LV_PAR1
                    
IMPORTING
                            
RETURN = LS_RETURN.
             
APPEND LS_RETURN TO ET_RETURN.

             
ENDIF.
            
ENDIF.
            
ENDIF.

 

Result:

              

                    Result1.png

                    Result2.png

 

Note: The above process can be followed with any standard attribute to make it as search field. What all needed is just adding the custom attribute to the standard search structure and the corresponding cluster followed by BADI implementation relevant to the object.

 

    

 

 

 

                                                                                                                                   


To send document as fax from SAP systems via the Retarus service

$
0
0

Purpose:

The purpose of the document is to reduce the effort of new Retarus service users.

 

Introduction:

This document is a reference work for SAP users wishing to transmit document as fax from SAP systems via the Retarus service. It contains description of each necessary step in SAP.

 

Prerequisites:

A SAP RFC connection should be in place between the SAP system and Retarus system permanently.

 

Below screenshots reveals the typical technical structure and settings made by the BASIS team to enable the service.

 

               Picture1.png

 

                Picture2.png

 

Document sending process:

Post all the required settings were made. Process of sending from SAP CRM system goes as below.

From the project I worked in requirement we had like when capturing an order, there are several steps like entering the sold– to-party, selecting products, entering discounts for products, changing the status to release and saving the order. Once the order status is set, an order confirmation should go to sold-to-party automatically as FAX using Retarus system.

Configuration at CRM end:

In CRM system an action definition with processing type as Method call is configured.  Below screenshots gives the details.

 

                Screenshot1.png

 

                 Screenshot2.png

 

                 Screenshot3.png

 

A SAP SMARTFORM has been designed and developed for this. The following is the sample layout we developed.

 

                untitled.JPG

 

As the processing type is chosen as Method Call, an implementation automatically gets created in the BADI EXEC_METHODCALL_PPF with ID Z0EXECUTE. Write the following logic in the method ‘EXECUTE’ to send the document.

 

Retrieve the function module name of the SMARTFORM by calling the function module SSF_FUNCTION_MODULE_NAME and call the SMARTFORM with all the required importing and exporting parameter.

 

              

                   Screenshot5.png

                   Screenshot6.png

                    Screenshot7.png

 

  • Call the function module CONVERT_OTF as below to convert the SMARTFORM output OTF data to PDF format.

 

Exporting

Value

FORMAT

‘PDF’

Importing

Value

BIN-FILE

L_OUTPUT

TABLES

 

OTF

ES_JOB_OUTPUT_INFO-OTFDATA[]

LINES

I_PDF_DATA

 

 

                    Screenshot8.png

 

  • Call the method CREATE_DOCUMENT of class CL_DOCUMENT_BCS as below to create document.

     

Exporting

Value

I_TYPE

‘RAW’

I_SUBJECT

FAX SUBJECT

Receiving

Value

RESULT

LR_DOCUMENT

 

  • Call the method XSTRING_TO_SOLIX of class CL_DOCUMENT_BCS as below to convert SMARTFORM into SOLIX table.

 

Exporting

Value

IP_XSTRING

L_OUTPUT

Receiving

Value

RT_SOLIX

I_SOLIX

 

  • Call the method ADD_ATTACHMENT of document LR_DOCUMENT of type CL_DOCUMENT_BCS to add the content to the document.
  Exporting

Value

I_ATTACHMENT_TYPE

‘PDF’

I_ATTACHMENT_SUBJECT

‘Order Confirmation’

I_ATT_CONTENT_HEX

I_SOLIX

 

  • Call the method CREATE_PERSISTENT of class CL_BCS as below to create a send request.

 

Receiving

Value

RESULT

LR_BCS

 

  • Call the method SET_DOCUMENT of above created request LR_BCS as below to set the document LR_DOCUMENT

     

Exporting

Value

I_DOCUMENT

LR_DOCUMENT

 

  • Call the method CREATE of class CL_SAPUSER_BCS as below

 

Exporting

Value

I_USER

SY-UNAME

Receiving

Value

RESULT

L_SENDER

 

  • Set sender to the request LR_BCS by calling the method SET_SENDER as below.

     

Exporting

Value

I_SENDER

L_SENDER

 

  • Create recipient by call the method CREATE_FAX_ADDRESS of class CL_CAM_ADDRESS_BCS as below.

 

Exporting

Value

I_COUNTRY

I_FAX-COUNTRY

I_NUMBER

I_FAX-FAXNO

Receiving

Value

RESULT

L_RECIPIENT

 

  • Set recipient to the request LR_BCS by calling the method ADD_RECIPIENT as below.

     

Exporting

Value

I_RECIPIENT

L_RECIPIENT

 

  • Send fax request LR_BCS by calling the method SEND.

 

               Screenshot9.png

               Screenshot10.png

 

               Screenshot11.png

 

 

From the above section of coding, the recipient address or recipient can be identified based on the fax number and country maintained at master data level of business partner. This maintenance is a must to identify the recipient. Sender is someone who is using the system else can be set default by providing the SAP user id.

On successful document sent the request to send the document reaches outbox. Go to transaction code SOST. Below screenshot gives the same.

 

               what1.JPG

 

Complete details of the request including the document can be viewed on selecting the relevant options available under ‘Send Request’ in the workplace.

 

                what2.JPG

 

The status is indicated by a colored box in the first column and the relevant description is provided in the last column.

         

In Overview page header level, if user checked the check box flag corresponding two field should be editable and non editable mode.

$
0
0
  1. For eg : In business role sales pro à sales cycle à campaign à under new field tabà ( if user checked flag check box make’ name’ field is editable and if user unchecked flag check box means ‘custom name’ field is no editable)

STEPS:-

  • ü Go to standard component ‘CPGOE_DETAILS’ and select the specific view where you want to do operation ‘CPGOE_DETAILS/OVEFDetails’.
  • ü Add attribute flag 4 type as char 1 in the content node campaign implementation class level.
  • ü Create get_p method for zz_flag3 attribute in campaign context node level.
  • ü Copy and paste ‘IF_BSP_WD_MODEL_SETTER_GETTER~_GET_P_XYZ’ and rename it as get_p_zz_flag3 in the content node campaign implementation class level.
  • ü Inside get_p_zz_flag3 method write below code for check box pick list and trigger corresponding event handler ‘ onmyevent’.

Code:-

method GET_P_ZZ_FLAG3.
CASE iv_property.
WHEN if_bsp_wd_model_setter_getter=>fp_fieldtype.
rv_value = cl_bsp_dlc_view_descriptor=>field_type_checkbox.
WHEN if_bsp_wd_model_setter_getter=>fp_onclick.
rv_value =
'MYEVENT'.                                 "#EC NOTEXT
*    WHEN if_bsp_wd_model_setter_getter=>fp_tooltip.
*      rv_value = text-001.
endcase.
endmethod.

  • When user click zz_flag3 attribute ‘onmyevent’ handler will trigger here we are passing flag4 = x if user check that zz_flag3 is checked or else flag4 = space.

METHOD eh_onmyevent.
* Added by wizard: Handler for event 'MYEVENT'
DATA  : lr_entity TYPEREFTO cl_crm_bol_entity,
lr_msg
TYPEREFTO cl_bsp_wd_message_service,
wa
TYPE crms_mktpl_ib_cpg.

lr_entity ?= me->ztyped_context->campaign->collection_wrapper->get_current( ).

CALLMETHOD lr_entity->if_bol_bo_property_access~get_properties
IMPORTING
es_attributes = wa.

IF wa-zz_flag3 ISINITIAL.
me->ztyped_context->zcampaign->flag4 =
'X'.
ELSE.
me->ztyped_context->zcampaign->flag4 =
''.
ENDIF.

ENDMETHOD.

 

  • ü Inside context implementation class level , inside ‘create campaign’ method we assign model to zcampaign.

 

  • ü Create get_i method for zz_name attribute in campaign context node level.
  • ü Copy and paste ‘IF_BSP_WD_MODEL_SETTER_GETTER~_GET_i_XYZ’ and rename it as get_i_zz_name in the content node campaign implementation class level.
  • ü Inside get_p_zz_name method write below code for make the name field as editable if flag is checked.

Code:-

 

METHOD get_i_zz_name.
DATA: current TYPEREFTO if_bol_bo_property_access.
rv_disabled =
'TRUE'.
if iterator isbound.
current = iterator->get_current( ).
else.
current = collection_wrapper->get_current( ).
endif.
IF flag4 ISNOTINITIAL.

TRY.

IF current->is_property_readonly(
'ACTUALSTART' ) = abap_false. "#EC NOTEXT
rv_disabled =
'TRUE'.
ENDIF.

CATCH cx_sy_ref_is_initial cx_sy_move_cast_error
cx_crm_genil_model_error.
RETURN.
ENDTRY.
else.
TRY.

IF current->is_property_readonly(
'ACTUALSTART' ) = abap_false. "#EC NOTEXT
rv_disabled =
'FALSE'.
ENDIF.

CATCH cx_sy_ref_is_initial cx_sy_move_cast_error
cx_crm_genil_model_error.
RETURN.
ENDTRY.

endif.

ENDMETHOD.

  • ü Create get_i method for zz_custname attribute in campaign context node level.
  • ü Copy and paste ‘IF_BSP_WD_MODEL_SETTER_GETTER~_GET_i_XYZ’ and rename it as get_i_zz_custname in the content node campaign implementation class level.
  • ü Inside get_p_zz_custname method write below code for make the name field as non editable if flag is  un checked.

Code:-

method GET_I_ZZ_CUSTNAME.
DATA: current TYPEREFTO if_bol_bo_property_access.
rv_disabled =
'TRUE'.
if iterator isbound.
current = iterator->get_current( ).
else.
current = collection_wrapper->get_current( ).
endif.
IF flag4 ISINITIAL.

TRY.

IF current->is_property_readonly(
'ACTUALSTART' ) = abap_false. "#EC NOTEXT
rv_disabled =
'FALSE'.
ENDIF.

CATCH cx_sy_ref_is_initial cx_sy_move_cast_error
cx_crm_genil_model_error.
RETURN.
ENDTRY.
else.
TRY.

IF current->is_property_readonly(
'ACTUALSTART' ) = abap_false. "#EC NOTEXT
rv_disabled =
'TRUE'.
ENDIF.

CATCH cx_sy_ref_is_initial cx_sy_move_cast_error
cx_crm_genil_model_error.
RETURN.
ENDTRY.

endif.
endmethod.

Check the o/p in web ui:-

How to add link to SAP CRM Navigation Bar via SPRO

$
0
0

The process of adding link to navigation bar in SAP CRM WebUI may seems trivial, but in fact it's a complete set of steps in a huge forest of SPRO-transaction that you have to perform in order to make your link be visible in navigation bar.

 

Here is a step-by-step manual in SPRO-transaction:

 

  1. Open UI Framework, Define Navigation Bar Profile
  2. Select Navigation Bar Profile
  3. Define Logical Link, new entry
  4. Define Direct Link Groups, take Group ID
  5. Assign links to Direct Link Group, add Logical Link ID& Position Level
  6. Open UI Framework → Business Roles, Define Business Role
  7. Chose Business Role
  8. Adjust Direct Links Groups, select Group ID from step #4
  9. Adjust Direct Links, enable Logical Link (visible: v)
  10. Save

 

After completing all these steps your link will be added to navigation bar profile.

 

Thanks.

CRM Web UI - Use of object and subobject for configuration determination

$
0
0

In this blog, we are going to explore the use of OBJECT_TYPE and SUBOBJECT in configuration determination (As method DO_CONFIG_DETERMINATION also plays key role to change screen layout determination).

Although, use of the object_type and subobject_type is not recommended, because it apparently is hard coded. This is true for some objects, not for all. So let's take a look at what it does and how we can use it.

Basic concept how web UI Screen Customizing works: The CRM webclient UI is very flexible when it comes to moving and renaming fields in the user interface. This is due to the platform. At runtime, an XML containing the screen definition is retrieved from the database, and is used to build up the HTML.


When retrieving the screen definition XML, the system uses a few parameters to determine the right XML. One of the parameters of course is the name of the view itself, so, for instance, BP_HEAD/AccountDetails is the view for the account details screen.
S1.png
Now depending on the view, some other parameters are added to the XML retrieval process, which are:

    • Role key
    • Component Usage
    • Object Type
    • Subobject Type


    1. Role key : The role key is automatically added by the system, and represents the business role. This enables you to differentiate the configurations for different business roles.
    2. Component Usage : The component usage is a constraint-free field. You can use this to for instance differentiate based on the context (as described here).
    3. Object Type : The Object Type should describe the object from the object model (so should be available in BSP_DLC_OBJ_TYP or BSPC_DLC_OBJ_TYP), customizable in: SPRO --> SAP Customizing Implementation Guide--> Customer Relationship Management --> UI Framework --> UI Framework Definition --> Define UI Object Types
    4. Subobject Type: The subobject type is a further differentiated type of the object type. Standard SAP uses this for instance to differentiate configurations per customer type (CORPORATE, INDIVIDUAL, GROUP) or per transaction type.

      As much as you might want this, it is not recommended to actually influence the screen layout itself using coding. It is allowed to influence the retrieval though, using the do_config_determination method of the controller class of the view.

      As a screen (or view actually) usually is created to show one particular object type (so either business partners, transactions, campaigns etc), the object type would usually be the same for every instance shown in the screen.

      The subobject type is where we can make the split. In order to set different subobject types, there are a few constraints though:
        • The object type must be set.
        • The value for the subobject type must be selectable in the config screen.

     

    Both are not standard in some cases. We need three steps:

    •   To Set the object_type and sub object_type in do_config_determination : We need to redefine the do_config_determination in our view, and implement calling the super class.

      *Call logic in super class(Standard)

      CALL METHOD super->do_config_determination

         EXPORTING

           iv_first_time = iv_first_time.


      Then we set the object_type and subobject_type:

      DATA: lr_config_desc TYPE REF TO cl_bsp_dlc_configuration2.

       

      TRY.

          lr_config_desc ?= me->configuration_descr.

          lr_config_desc->if_bsp_dlc_config_appl~set_object_type( <your object> ).

          lr_config_desc->if_bsp_dlc_config_appl~set_object_sub_type( <your subobject> ).

        CATCH cx_sy_ref_is_initial.

      ENDTRY.

    Note: You will need to add values to the parameters <your object> and <your subobject> in above mentioned code

    The <your object> parameter can usually be hardcoded, because we are coding in the particular view anyway.

    However the <your subobject> parameter should come from  the context nodes, so you will also need something like:

    lr_access = me->typed_context->paonline->collection_wrapper->get_current( ).

     

     

    • Allow the subobject_type in the config screen: Sometimes when trying to add a new configuration for a newly created subobject, you might have come across error's like this: "Subobject type CUSTOMER is not valid for object type BP_ACCOUNT"


    In such case, you need to do configuration change and in the customizing of BSP_DLC_OBJ_TYP table, there is a field called Callback Class.

    s3.png

    This class is primarily used to determine the subobject types. For BP_ACCOUNT for instance, this is dealt in class CL_BP_HEAD_SUBTYPE_CALLBACK. If we want to adjust this, we can either implement a subclass of the standard class, or implement a new class with an interface to IF_BSP_DLC_OBJ_TYPE_CALLBACK and implement the method GET_OBJECT_SUB_TYPES. Access via  as SPRO --> SAP Customizing Implementation Guide--> Customer Relationship Management --> UI Framework --> UI Framework Definition --> Define UI Object Types (SM30 View : BSPDLCVC_OBJ_TYP).

    S2.png

    Note : - Here we either select data from a domain, from a table or hardcode the possible subobject types. Make sure you enter your custom callback class in the customizing.

    • Create specific screen customizing : Now that this has been done, you will notice that the new subobject types are selectable, so you can create your new configurations using them. You will also notice that they will be correctly determined if you have done the do_config_determination correctly.

    Enabling BI reports IN CRM Web UI

    $
    0
    0

    1. Prerequisites

    The corresponding BW reports should be built on BW system before they can be used as links in CRM Portal.

    2. Configuration Rationale

    This configuration is required as part of BI report access from the CRM portal. It includes addition of BI report links for respective queries and applicable roles on the CRM portal.

    3. Configuration Procedure

    3.1 Development of the BI Reports

     

    The BI Queries should be already developed using Query Designer

     

    3.2 Defining the BI Reports

     

    We take the path specified below:

     

    1.  CRM-> UI Frame work-> UI Frame work Definition -> Display SAP netweaver BW Reports

     

    Click on New entries and maintain the values as shown in figure below:

    1.png

    2.png

     

    3.3 Defining the Logical Links

     

    We take the path specified below:

     

    CRM-> UI Frame work-> Technical role Definition -> Define Navigation Bar profile.

     

    1. Double click on “Define Logical link” and create logical links for all Queries as shown in below figure:

    3.png

     

    2.  Go back and click on “Define work center Link Group” link.

     

    3.  Select standard link group “ANA-RPT-SR” on left Navigation Pane double click on “Assign Links to work center Link Group”.

    4.png

     

    4.   Assign the logical links pertaining to BI reports to this work center link group.

     

    5.png

    5. Select the required Navigation Profile Bar and assign the SLS-REPORT work center link to it as shown below.

    6.png

    7.png

     

    CRM-> UI Frame work-> Business Roles -> Define Business Role

     

    1. Select the required business role and double click on “Adjust work center Group Links” on left pane.
    2. Click on “position” For displaying the Reports related to opportunities enter the following Values

              Work center Id = SLS-REPORT

              Group ID= ANA-RPT-SR

      3.   Once you are in the Overview page check the box “Visible” for all the reports to be displayed in UI as shown in figure below.

     

    WEB UI Output:

     

    9.png

    10.png

     

     

    Authors:

    Apoorv Dhawan

    Neha Manikumar

    Viewing all 189 articles
    Browse latest View live


    <script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>