on 07-27-2014 10:32 PM
HI,
I'm creating a pop-up where the select mode is lineedit. Now I want to be able to the the changed values, but I've been failing to do so. The pop put does allow me to edit but when I click choose somehow values aren't transferred or changed in the table I used for creating the pop-up. Can anyone help me with this? Below is my code:
ls_col_def-columnname = 'SERIAL_NO'.
ls_col_def-title = 'Serial No'.
ls_col_def-edit = abap_true.
APPEND ls_col_def TO lt_col_def.
CLEAR ls_col_def.
ls_col_def-columnname = 'MATERIAL'.
ls_col_def-title = 'Material'.
ls_col_def-edit = abap_true.
APPEND ls_col_def TO lt_col_def.
CLEAR ls_col_def.
ls_col_def-columnname = 'ENGINE_NO'.
ls_col_def-title = 'Engine No'.
ls_col_def-edit = abap_true.
APPEND ls_col_def TO lt_col_def.
CLEAR ls_col_def.
ls_col_def-columnname = 'SMR'.
ls_col_def-title = 'SMR'.
ls_col_def-edit = abap_true.
APPEND ls_col_def TO lt_col_def.
CLEAR ls_col_def.
ls_col_def-columnname = 'KM'.
ls_col_def-title = 'KM'.
ls_col_def-edit = abap_true.
APPEND ls_col_def TO lt_col_def.
CLEAR ls_col_def.
ls_col_def-columnname = 'POSTING_DATE'.
ls_col_def-title = 'DATE'.
APPEND ls_col_def TO lt_col_def.
gt_proctype_bo_popup = comp_controller->window_manager->create_decision_popup(
iv_title = 'Equipment'
iv_description = 'Edit Equipment'
iv_selection_mode = 'LINEEDIT'
iv_visible_row_count = 1
iv_display_table = gt_equipment_edit
iv_visible_columns = lt_col_def
iv_create_table_copy = abap_false ).
gt_proctype_bo_popup->set_on_close_event( iv_event_name = 'DEC_POPUP_CLOSED' iv_view = me ).
gt_proctype_bo_popup->open( ).
lv_output_node ?= gt_proctype_bo_popup->get_context_node( 'OUTPUTNODE' ).
Thank you,
Kaya
You want to edit the selected value from popup, so first populate the selected row in table and then edit in the table.
Open the popup using :
CALL METHOD me->comp_controller->window_manager->create_decision_popup
EXPORTING
iv_title = 'Route'
iv_description = 'Route'
iv_selection_mode = 'SINGLE'
iv_visible_row_count = '10'
iv_display_table = gt_route
iv_visible_columns = lt_table
RECEIVING
rv_result = gr_popup.
gr_popup->set_on_close_event( iv_event_name = 'DEC_POPUP_CLOSED' iv_view = me ).
gr_popup->open( ).
Now on close event i.e. DEC_POPUP_CLOSED write the code to transfer the selected row into the table.
lv_outputnode ?= gr_popup->get_context_node( 'OUTPUTNODE' ).
lv_index = lv_outputnode->get_selectedrowindex( ).
IF lv_index IS NOT INITIAL.
READ TABLE gt_route INTO ls_route INDEX lv_index.
lr_col ?= me->typed_context->zroute->collection_wrapper.
CREATE DATA lr_tab_data.
CREATE OBJECT lr_valuenode
EXPORTING
iv_data_ref = lr_tab_data.
lr_valuenode->set_properties( is_attributes = ls_route ).
lr_col->add( EXPORTING iv_entity = lr_valuenode ).
REFRESH: gt_route.
CLEAR: gr_popup.
endif.
Now you can see the selected row in your table view and the popup will be closed.
To make the row editable go to htm page on which table view is created, and then modify
editMode = "ALL"
in <chtmlb:configCellerator>
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Khaya Nxumalo,
Please try below code in event handler method for your event DEC_POPUP_CLOSED.
data: lt_selection_idx type int4_table.
* Get popup results
lv_outputnode ?= link_popup->get_context_node( 'OUTPUTNODE' ).
lt_selection_idx = lv_outputnode->get_selectedrowindex_t( ).
loop at lt_selection_idx assigning <selection_idx>.
* User pressed ok, store the link in the cuco
if <selection_idx> gt 0.
*===Get the selected entry
read table gt_equipment_edit assigning <wa_area> index <selection_idx>.
endloop.
Regards,
Arjun
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Khaya Nxumalo ,
Looks you are designing editable popup,, instead of decision popup ( Yes or No , select one of option ) is that correct?.
In case of editable popup, you need to make sure that data is refreshed in "popup output node" with change made by user, at event when user click close or closes the window or click on button if any.
Hope this help for your scenario.
Regards,
Arjun
User | Count |
---|---|
5 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.