Skip to Content

In the new SAP CRM: Webclient UI – Framework, Brant Berg  asked the question “PCUI Has anyone used HTML viewer to call a custom BSP?“? Here are step-by-step instructions to show how we used the HTML  viewer to call a custom URL. In our case we’ve integrated an R/3 Transaction using WinGUI via the Portal Application  Integrator. The result will be:

image

Our Setup

  • SAP CRM 4.0 PL 7 System
  • SAP Enterprise Portal 6.0 SP 7

Create Package

All our own DDIC structures and the class implemented is created in a package called “ZCRM_ANGEBOT”.

Dictionary Structures

ZCRMT_BSP_ACC_QUOTATION

 

     

   

 

 

     

   

 

 

     

   

 

Component Component type
OBJECT_KEY CRMT_BSP_OBJECTKEY
URL CRMT_BSP_URL
HEIGHT CRMT_BSP_HEIGHT

ZCRMT_BSP_ACC_ORDER just includes ZCRMT_BSP_ACC_QUOTATION because it has the    same structure. The package now has the following content:

Class which implements IF_CRM_BSP_MODEL_ACCESS_IL

Create a new class ZCL_ANGEBOT_ABSPRUNG which implements the interface IF_CRM_BSP_MODEL_ACCESS_IL. The method read has to be implemented

  method if_crm_bsp_model_access_il~read.
    data :
      lv_account type bu_partner,
      lv_submi   type crmt_object_id,
      lv_guid    type crmt_object_guid,
      ls_screen_structure type zcrmt_bsp_acc_quotation,
      lt_screen_structure type table of zcrmt_bsp_acc_quotation,
      wa_portal type char32.
  
  *
  * Call Transaction ZSDSL_400 via WinGUI
  *
  wa_portal = 'eep04.siteco.net'.
  *
  * Create URL WinGUI Call via Portal Application integrator
  *
  concatenate 'http://' wa_portal
    '/irj/servlet/prt/portal/prtroot/'
    'com.sap.portal.appintegrator.sap.Transaction'
    '?System=SAP_R3&Technique=SSD&'
    'TCode=ZSDSLS_400&OkCode=ONLI&'
    'GuiType=WinGUI&ApplicationParameter='
   into ls_screen_structure-url.
  
  
    case iv_screen_structure_name.
  * Quotations for Customer
      when 'ZCRMT_BSP_ACC_QUOTATION'.
        read table it_object_key index 1 into lv_account.
  * Portal
        concatenate
          ls_screen_structure-url 'P_KUNNR%3d' lv_account
          ';P_AUF%3d;P_ANG%3dX'
         into ls_screen_structure-url.
  * Orders for Customer
      when 'ZCRMT_BSP_ACC_ORDER'.
        read table it_object_key index 1 into lv_account.
  * Portal
        concatenate ls_screen_structure-url
          'P_KUNNR%3d' lv_account
          ';P_AUF%3dX;P_ANG%3d'
         into ls_screen_structure-url.
    endcase.
    ls_screen_structure-height = '800'.
    insert ls_screen_structure into table lt_screen_structure.
  
    et_screen_structure = lt_screen_structure.
  
  endmethod.

You also have to implement the MODIFY method because you will get an error when you open another tab if it is not implemented. A empty implementation is enough:

method IF_CRM_BSP_MODEL_ACCESS_IL~MODIFY.
endmethod.

PC-UI Customizing

All PC-UI Customizing is done in Transaction CRMC_BLUEPRINT_C.

Create Field Group

Navigate to Application Element, Field Group, Field Group. We add two new field    groups:

 

     

   

   

 

 

     

   

   

 

 

     

   

   

 

Field Group Description Structure Name
Z_ACC_ORDER Orders ZCRMT_BSP_ACC_ORDER
Z_ACC_QUOTATION Quotations ZCRMT_BSP_ACC_QUOTATION

Create Field Group Structure

Navigate to Application Element, Field Group, Field Group Structure. Enter the field group name:

 

     

   

   

   

 

 

     

   

   

   

 

 

     

   

   

   

 

Field Group Screenposition Field Name Fieldtype
Z_ACC_ORDER 10 URL Inputfield
Z_ACC_QUOTATION 10 URL Inputfield

Don’t forget to create the Field Group. Navigate to Application Element, Field Group, Layout Generation. Enter the Field Group name and uncheck “Only Check Field Groups”.

Create Events

Navigate to Application Element, Event. Add our own two events:

 

     

   

   

   

 

 

     

   

   

   

 

 

     

   

   

   

 

Event Usage Unlock Text
ZACC_ORDER A Layout-Relevant No Data Loss Popup Order
ZACC_QUOTATION A Layout-Relevant No Data Loss Popup Quotation

Add Events to Tab Page Group ACC_01

Navigate to Application Element, Tab Page Group, Tab Page Group Structure.

We had our own view defined which is called SITECOSALE which we use for the    Sales Representative role. To this view we add the previously created events:

 

     

   

   

 

 

     

   

   

 

 

     

   

   

 

View Sequence Event
SITECOSALE 30 ZACC_QUOTATION
SITECOSALE 35 ZACC_ORDER

Define Application Layout

Navigate to Application Layout, Define Application Layout. Add events to application    CRMM_ACCOUNT.

 

     

   

   

 

 

     

   

   

 

 

     

   

   

 

 

     

   

   

 

 

     

   

   

 

 

   

   

   

 

Event ZACC_ORDER ZACC_QUOTATION
Position Detail Area 1 Detail Area 1
Screen Element Type HTML HTML
Field Group Z_ACC_ORDER Z_ACC_QUOTATION
Tab Page Group ACC_01 ACC_01
Structure Name ZCRMT_BSP_ACC_ORDER ZCRMT_BSP_ACC_QUOTATION

Define Application Set

Navigate to Application Element, Application Set. Choose the application set:    COMM_BUPA and choose Model Access. Add these two entries:

 

     

   

   

 

 

     

   

   

 

 

     

   

   

 

 

     

   

   

 

 

     

   

   

 

Application Set COMM_BUPA COMM_BUPA
Structure Name ZCRMT_BSP_ACC_ORDER ZCRMT_BSP_ACC_QUOTATION
Access Class ZCL_ANGEBOT_ABSPRUNG ZCL_ANGEBOT_ABSPRUNG
Structure Type Dependent Structure Dependent Structure
Parent Name BUP_MAIN BUP_MAIN

Summary

In principle, adding a new tab within a CRM People Centric UI application consists    of two main steps. In the first the model access class is written. Thereafter    the customization transaction is used to configure the new tabs into an existing    application.

 

Credits

Thanks to Paul Walmsley who implemented this functionality for us. And a special    thank to Brian    McKellar for reviewing this Weblog.

To report this post you need to login first.

7 Comments

You must be Logged on to comment or reply to a post.

  1. Former Member
    I’m adding this tip from Paul Walmsley to generate a BSP URL instead of using ITS that he provided in thread PCUI Has anyone used HTML viewer to call a custom BSP?

    See Pauls’ comment below for the solution.
    ——————-
    Hi,

    as an addition to Gregors excellent Blog, if you want to call a BSP instead of an ITS transaction you can use the following code to generate the url.

    CALL METHOD CL_BSP_RUNTIME=>IF_BSP_RUNTIME~CONSTRUCT_BSP_URL
    EXPORTING
    IN_APPLICATION = ‘z_my_custom_bsp’
    IN_PAGE = ‘default.htm’
    IMPORTING
    OUT_ABS_URL = ls_screen_structure-url .

    Regards, Paul (Walmsley)
    ——————-

    Thanks Paul!

    Brant

    (0) 
  2. Hello Gregor,

    We implemented the same to get a new tab in the account application making a link to a webdynpro.

    This is working fine if we stay in the account application but if we want to jump to the opportunity application for example, we get a javascript error : çan’t execute code from a freed script’.

    Did you get this problem?
    Thanks
    Frederic

    (0) 
  3. Former Member
    I am creating something similiar but im using a message to pop up a BSP, but my read method of the zclass tied to the zstructure never gets called to pass the url, but i see that constructor of my zclass gets called.

    Is there an specific step to have the read method called?

    (0) 

Leave a Reply