There are many methods to do this.It depends on the way and the action required to launch the pop up and the info to be shown in the pop up.There are many standard methods to create a pop up in this interface IF_BSP_WD_WINDOW_MANAGER.
A sample snippet...to show a decision pop up.
CALL METHOD comp_controller->window_manager->create_popup_2_confirm
iv_title = lv_title
iv_text = lv_text
iv_btncombination = if_bsp_wd_window_manager=>co_btncomb_okcancel
rv_result = confirm_popup.
confirm_popup->set_on_close_event( iv_event_name = 'POPUP_CLOSED' iv_view = me ). ENDIF.
Masood Imrani S.
Hi Masood Imrani ,
Thanks for ur quick reply. Can you tell me one thing also where should i write this code . and how to handle this popup .want to create any custom component for that or simply write in standard component.I want handle this popup by action
Thanks in advance.
This code is used to open a pop up on a button click.No need to create a custom component again.
Add a button on whichever standard component you want to display this pop up.
The buttons will be available in either DO_PREPARE_OUTPUT or IF_BSP_WD_TOOLBAR_CALLBACK~GET_BUTTONS depending on the type of view.In the event handler for the button,write this code. All the coding is using TCODE BSP_WD_CMPWB.
Now, in the code I earlier mentioned if you pass
iv_btncombination = 0 and
lv_text = 'Hello', you will get the required thing.
It is good if you debug any standard components and find out what is happening.
This way you will get lot of info.
Masood Imrani S.
First you need to identify the component and the view to be enhanced by doing an F2 on the UI.
Then you need the enhance the component.
Before doing that an enhancement set needs to be in place. To do that ...
1. Use TCODE SM34 and give view cluster-BSPWDVC_CMP_EXT and create an EHSET.
2. Assign a Client in TCODE SM30 using view - BSPWDV_EHSET_ASG.
Once you do this, use TCODE BSP_WD_CMPWB, open the component you want to enhance and click display by keying in the EHSET. Now, on the top right corner click the ENHANCE COMPONENT button,
specify a BSP application and enhance(say yes when it asks to create the BSP application).
Now come out of the Transaction and open it again. Now you cannot see the ENHANCE COMPONENT button anymore. Right click on the view where the button needs to be added and enhance it.The view text(name) will be in grey colour earlier, once enhanced they will become black and the Z IMPL and CTXT classes get created.
There are mant threads in this forum on similar topics like adding new fields etc.,the initial steps to enhance the component and view are same.
finelly i wantto ask one more thing we can create a method "eh_ on_click" in the implemenation class, right ? for instance if i want to create a pop up in the Ibase , i will create a button , when the user press the button the method will be called .this is right.
The button gets created if you write this code on the method I mentioned earlier.(DO_PREPARE_OUTPUT or TOOLBAR Get Buttons).
ls_button-page_id = me->component_id.
ls_button-id = 'NEW'.
ls_button-text = 'NEW'.
ls_button-tooltip = 'NEW'.
ls_button-on_click = 'PUSHNEW'.
ls_button-type = cl_thtmlb_util=>gc_icon_new.
ls_button-enabled = abap_true.
APPEND ls_button TO rt_buttons.
Whatever value you pass in ls_button-on_click, you need to create an event handler with this name
like EH_ONPUSHNEW and write code there. This gets called when the button is clicked.
Actually this event handler is called from method DO_HANDLE_EVENT in IMPL class which is like PAI in dialog programs.
I have created one implemetatiob for one Z component , now this compnent is a drop down box , Can you please tell me which event should i reaise\triggrred if a user slects an entry from the drop down box so that GET/SET gets triggered.
Presently when i hit entere by keeping a cursor on any field the GET SET methods are getting called otherwise not.
Thanks in advance,
Can any one tell me how to identify the confimation. I could not find any kind of data to identify the option selected by user (Ok/Cancel) in the close event embedded object when i placed the debug point in DO_HANDLE_EVENT for pop-up close event.
Edited by: Karthik Vishwamurthy on Jan 11, 2010 10:57 AM