Registration

Dear SAP Community Member,
In order to fully benefit from what the SAP Community has to offer, please register at:
http://scn.sap.com
Thank you,
The SAP Community team.
Skip to end of metadata
Go to start of metadata

Creating Enhancement set:

To call a custom component as a popup, the standard WEB UI component needs to be enhanced. To do this, a enhancement set should be created.  
Go to transaction SM34, Enter BSPWDVC_CMP_EXT and Click maintain. Give your own name with the corresponding name space with the description and save. 
Go to Transaction SM30, enter BSPWDV_COMP_EXT and select the value from the F4 values and save. 
The enhancement set is created.

In the first part after the creation of the custom component, an Inbound plug OpenUrl is created under the Main window.
Go to the run time repository and create a navigation link between the main window and the view as follows.





Save the runtime repository.

Go to the component work bench BSP_WD_CMPWB and enter the standard component which needs to be enhanced. 

In the component in our example BT115IT_SLSO, the view BTITEMS is selected and press the Enhance component button on the application tool bar.

Give the enhancement name created above(ZMULTIOFFER in this example) .

Enter the Application name. This application name should be starting with Z name space

Follow the rest steps and Save the component. In the resultant view the name of the implementation class will be starting with Z.

Double click the implementation class of the view BTITEMS and redefine the method PREPARE_TOOLBAR. In this example, a new button is added at the item level in the sales order. By clicking this button, the popup will be launched. In the redefined method, the additional code to create the button is written as below.


Create a component usage in the runtime repository of the standard component and include the created custom component in it.  




and save the runtime repository.

Create an event NEW from the event handler of the implememtation class. This will create a method EH_ONNEW in the implementation class. Create a variable lv_popup of type ref to if_bsp_wd_popup should be declared in the attributes of the implementation class.

Enter the below coding in the EH_ONNEW method.

 IF lv_popup IS NOT BOUND.
    lv_popup = me->comp_controller->window_manager->create_popup(
                          iv_interface_view_name = 'Z_POPUP/MainWindow'
                          iv_usage_name          = 'CUPopup'
                          iv_title               = 'Popup' ).

    lv_popup->set_window_width( iv_width = 600 ).

 ENDIF.

  lv_popup->set_on_close_event( iv_view = me iv_event_name = 'EH_ONRETURN').

   lv_popup->open( 'OPENURL' ). 

Open the sales order scree in the WEB UI. The new button will be appearing in the item tab. Click the new button to see the popup.

In this example an URL is launched as a popup. This can be improved to create a table view or any structure in the popup and some selection also can be done in the popup.

To come back to the original screen, an additional event will be required in the custom component(e.g .a button ) and an outbound plug.

Please let me know you valuable comments. Thanks!

  • No labels

7 Comments

  1. Guest

    The first one is working fine and well explained.

  2. Guest

    Hi Solai,

    I have a requirement to add the custom button (copy button) on CRM webGUI rebates  header screen.

    Once i click on this "copy button", a popup should open to enter the fields (like, copy to rebates number and target rebate number with sales org data. Save button should be on the pop up screen.

    Can you please suggest some views on creating the custom button and custom popup screen on CRM REBATES webGUI.

    Appreciate your help!

    Thanks

    Ashu

  3. Guest

    Hi,

    I am trying to use above solution with little modification as suggested in Part - 1 >

    ----------

    In the view controller redefine the DO_REQUEST() method and insert the following coding:
    runtime->server->response->redirect( url = 'http://www.syskoplan.de' ).
    navigation->response_complete( ).

    -----------

    I have written this code in DO_CONFIG_DETERMINATION.

    Now the website google.co.uk is not opening in new pop up window but instead replaces the current window.

    Any idea why it is happening and how to fix it.

    Thanks and Regards,

  4. A navigation link is not needed to open a component in a popup. Just usage will do.

  5. Guest

    Thanks Shiromani for response.

    I tried to use code > " lv_popup->open( ). " to open the pop up but still no change in output. Is it what you suggested or I understood wrong?

    Thanks and Regards,

  6. Guest

    Hi everybody,

    I wish to call a standard component ICCMP_BP_CP  in the BP_HEAD_SEARCH on the click of a button which i have added in the search result view.

    i used this blog to this  and did not create a new navigation link or inbound plug but used a standard one, already in the component.

    But the pop up is not coming, dump is coming of 'deferencing a null variable', when it executes the command lv_openup->open().

    Kindly help me.