Skip to Content

When we display a transaction in CRM WebUI, there is a CRM ‘Print Page’ function. For example, open an interaction record detail screen from webui, click the print icon(or Ctrl+P):

1. transaction detail screen.PNG

a new window will be opened with the printed information:

2. print the transaction out.PNG

 

When the ‘Print Page’ icon is clicked, JavaScript codes in BSP Application BSPWD_BASICS->print.htm is executed. For some requirement, I recently enhanced the print.htm page. Due to the specific position in framework, it is not possible to enhance view BSPWD_BASICS/print simply as we do for other components and views. In this article, I will note down how I enhanced it and make system call the enhanced print.htm page. It is an Ehp3 system where I made the test.

 

System Logics:

  1. Print.do under BSPWD_BASICS is specified in WorkAreaHostContent.htm file under BSPWD_BASICS->Page Fragments->WorkAreaHostContent.htm.
    3. workareahostcontent.htm.png
  2. WorkAreaHostContent.htm is specified in BSPWD_BASICS/WorkAreaHostViewSet.htm.
    4. workareahostviewset.PNG
  3. BSPWD_BASICS/WorkAreaHostViewSet is embedded in CRM_UI_FRAME.
    5. crm_ui_frame.PNG

Steps for enhancement:

  1. Execute BSP_WD_CMPWB, enhance BSPWD_BASICS. I named enhanced bsp application ZBWD_BASICSGW.
    7. Enhance BSPWD_BASICS.PNG
  2. Enhance ‘Print’ view.
    8. Enhance print view.PNG
  3. Even though it shows error, just click ‘Ok’ button to ignore it.
    8-1. Enhance print view error.PNG
  4. It will also show information ‘View BSPWD_BASICS/print is not defined in the runtime repository that was loaded’.
    8-2. Enhance print view error.PNG
  5. But the enhanced print view is now under my bsp application ZBWD_BASICSGW.
    8-3 print view in Z bsp app..PNG
  6. Now enhance BSPWD_CMPWB/WorkAreaHostViewSet.
    9-1 enhance WorkAreaHostViewSet.PNG
  7. Name controller class ZLBSPWD_BASICS_WA_HOSTVS when required.
    9-2 give a name to object.PNG
  8. Give name to context attribute type ZLBSPWD_CONTEXT.
    9-2-2 give a name to object.PNG
  9. Don’t forget to change method and active it.
    9-2-3 redefine method.PNG
  10. Now copy WorkAreaHostContent.htm.
    9-3 copy WorkAreaHostContent.PNG
  11. Input the bsp application name you created just now. Please notice, give a new page name.
    9-3-2 copy WorkAreaHostContent.PNG
  12. This ZWorkAreaHostContent.htm will appear under ZBWD_BASICSGW. Edit this file, change the codes as highlighted: BSPWD_BASICS is replaced by your own new Z bsp application. Here it is ZBWD_BASICSGW. After the change, save and active.
    9-3-3 WorkAreaHostContent will appear under Z BSP.PNG
  13. In order to bring the ZWorkAreaHostContent.htm in, now we should edit the enhanced BSPWD_BASICS/WorkAreaHostViewSet.htm file. Double click on WorkAreaHostViewSet.htm.
    9-3-4 edit workareahostviewset.PNG
  14. Change, save and active.
    9-3-5 change, save and active.PNG
  15. In order to make the framework call the above enhanced views, we need to enhance CRM_UI_FRAME also.
    6. Enhance crm_ui_frame.PNG
  16. There is no ‘Enhance’ function for BSPWD_BASICS/WorkAreaHostViewSet under CRM_UI_FRAME. We need to use another way to bring the enhanced view in. Please see the next step.
    6 -2 . view no enhance.PNG
  17. Execute T-code SM34, maintain view BSPWDVC_CMP_EXT. Select CRM_UI_FRAME for enhancement set ZENH_GW_NEW, double click ‘Controller Substitutes’.
    6 -3 add entry 1.PNG
  18. Add an entry manually.
    6 -4 add entry 2.PNG
  19. Now we come back to CRM_UI_FRAME, the enhanced view is visible.
    6 -5 add entry 3.PNG
  20. Now set breakpoint in print.htm file under ZBWD_BASICSGW.
    9-4 set breakpoint.PNG
  21. Open CRM webui, display a transaction, click ‘Print’.
    9-4-2 diplay and click print.PNG
  22. We can see the print.htm file under customer bsp application ZBWD_BASICSGW is executed. Now we can add our own codes in the print.htm file:
    9-4-3 breakpoint stops.PNG
To report this post you need to login first.

Be the first to leave a comment

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

Leave a Reply