ALV grid, prevent return to line 1 column 1 after using filter button
How can I prevent the ALV grid display from returning to line 1, column 1, after a user has modified the display using the filter or sort button ? I know this is possible using the is_stable field when control is passed to my ALV code, but when the automatic on-screen buttons are used I can't find a way of controlling how the screen is displayed.
Max,
Thanks, the AFTER_USER_COMMAND event allows me access after the filter or sort button has bee npressed, but I am unable to prevent the grid from reverting to column1 line1. By using the method GET_CURRENT_CELL I can find out the column, but it does not return me the row. I have tried putting this column id into SET_CURRENT_CELL_VIA_ID, as suggested by Naimesh above, and calling this from the AFTER_USER_COMMAND method, but it does not effect how the grid displays.
Any further advice would be very welcome.
Similar Messages
-
Return all the column values using the F4IF_INT_TABLE_VALUE_REQUEST
Hi,
How to return all the column values using the F4IF_INT_TABLE_VALUE_REQUEST?
For example : if the row has 3 columns then after selecting the particular row, the RETURN_TAB internal table should contain all the three column values.
Regards,
RaghuHi,
Try the following...
DATA : it_fields like help_value occurs 1 with header line.
data: begin of w_vbap,
vbeln like vbap-vbeln,
posnr like vbap-posnr,
werks like vbap-werks,
end of w_vbap.
data: i_vbap like w_vbap occurs 0 with header line,
w_fields type help_value,
i_dfies type table of dfies,
i_return_tab type table of ddshretval with header line,
i_field type dfies.
select vbeln posnr werks
from vbap into table i_vbap up to 5 rows.
if sy-subrc = 0.
sort i_vbap by vbeln.
endif.
clear it_fields[] , it_fields.
it_fields-tabname = c_vbap.
it_fields-fieldname = 'VBELN'.
it_fields-selectflag = c_on.
append it_fields.
it_fields-tabname = c_vbap.
it_fields-fieldname = 'POSNR'.
it_fields-selectflag = space.
append it_fields.
it_fields-tabname = c_vbap.
it_fields-fieldname = 'WERKS'.
it_fields-selectflag = space.
append it_fields.
loop at it_fields into w_fields.
i_field-tabname = w_fields-tabname.
i_field-fieldname = w_fields-fieldname.
i_field-keyflag = w_fields-selectflag.
append i_field to i_dfies.
endloop.
call function 'F4IF_INT_TABLE_VALUE_REQUEST'
exporting
retfield = 'VBELN'
window_title = 'Select'
tables
value_tab = i_vbap
field_tab = i_dfies
return_tab = i_return_tab
exceptions
parameter_error = 1
no_values_found = 2
others = 3
read table i_return_tab into w_return_tab index 1.
if sy-subrc = 0.
endif.
Regards,
Srini. -
ALV Grid and return to selection screen
Hello
I have an ALV Grid and when I push a buttom that I program appears another ALV Grid. In this second ALV I try to program different buttoms. When I program the BACK buttom I want to go to selection screen.
I try with CALL SELECTION SCREEN but when I stay in selection screen and push the execute buttom the ALV that I see is the second, not the first. It seems that we don't catch the news selections.
I put rs_selfied-refresh = 'X' after the CALL SELECTION SCREEN but is wrong again.
What can I do????Hello Silvia
There is a simple trick to return from the second ALV list directly back to the selection screen:
*& Report ZUS_SDN_REUSE_ALV_GRID_DISPLAY
REPORT zus_sdn_reuse_alv_grid_display.
TYPE-POOLS: slis.
DATA:
gt_t001 TYPE STANDARD TABLE OF t001,
gt_knb1 TYPE STANDARD TABLE OF knb1.
DATA:
gs_fcat TYPE slis_fieldcat_alv,
gt_fcat_t001 TYPE slis_t_fieldcat_alv,
gt_fcat_knb1 TYPE slis_t_fieldcat_alv.
PARAMETERS:
p_bukrs TYPE bukrs DEFAULT '1000'.
START-OF-SELECTION.
SELECT * FROM t001 INTO TABLE gt_t001.
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
* I_PROGRAM_NAME =
* I_INTERNAL_TABNAME =
i_structure_name = 'T001'
* I_CLIENT_NEVER_DISPLAY = 'X'
* I_INCLNAME =
* I_BYPASSING_BUFFER =
* I_BUFFER_ACTIVE =
CHANGING
ct_fieldcat = gt_fcat_t001
EXCEPTIONS
inconsistent_interface = 1
program_error = 2
OTHERS = 3.
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
* I_INTERFACE_CHECK = ' '
* I_BYPASSING_BUFFER = ' '
* I_BUFFER_ACTIVE = ' '
i_callback_program = syst-cprog
i_callback_pf_status_set = 'ALV_SET_PF_STATUS'
i_callback_user_command = 'ALV_USER_COMMAND'
* I_CALLBACK_TOP_OF_PAGE = ' '
* I_CALLBACK_HTML_TOP_OF_PAGE = ' '
* I_CALLBACK_HTML_END_OF_LIST = ' '
* I_STRUCTURE_NAME = ' '
* I_BACKGROUND_ID = ' '
* I_GRID_TITLE =
* I_GRID_SETTINGS =
* IS_LAYOUT =
it_fieldcat = gt_fcat_t001
* IMPORTING
* E_EXIT_CAUSED_BY_CALLER =
* ES_EXIT_CAUSED_BY_USER =
TABLES
t_outtab = gt_t001
* EXCEPTIONS
* PROGRAM_ERROR = 1
* OTHERS = 2
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
END-OF-SELECTION.
*& Form set_pf_status
* text
* -->RT_EXTAB text
FORM alv_set_pf_status USING rt_extab TYPE slis_t_extab.
* NOTE: identical to STANDARD_FULLSCREEN with additional button
* for detail list ('DETAILLIST')
SET PF-STATUS 'STANDARD_FULLSCREEN'.
ENDFORM. "set_pf_status
*& Form alv_user_command
* text
* -->R_UCOMM text
* -->RS_SELFIELDtext
FORM alv_user_command USING r_ucomm LIKE sy-ucomm
rs_selfield TYPE slis_selfield.
CASE r_ucomm.
* Display detail list: all customers for selected company code
WHEN 'DETAILLIST'.
IF ( rs_selfield-fieldname = 'BUKRS' ).
SELECT * FROM knb1 INTO TABLE gt_knb1
WHERE bukrs = rs_selfield-value.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
* I_INTERFACE_CHECK = ' '
* I_BYPASSING_BUFFER = ' '
* I_BUFFER_ACTIVE = ' '
i_callback_program = syst-cprog
i_callback_pf_status_set = 'ALV_SET_PF_STATUS'
i_callback_user_command = 'ALV_USER_COMMAND'
* I_CALLBACK_TOP_OF_PAGE = ' '
* I_CALLBACK_HTML_TOP_OF_PAGE = ' '
* I_CALLBACK_HTML_END_OF_LIST = ' '
i_structure_name = 'KNB1'
* IMPORTING
* E_EXIT_CAUSED_BY_CALLER =
* ES_EXIT_CAUSED_BY_USER =
TABLES
t_outtab = gt_knb1
EXCEPTIONS
program_error = 1
OTHERS = 2.
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
<b>* NOTE: when the program logic returns from the 2nd ALV list
* and exit = 'X' then the program leaves the
* 1st ALV list, too, and returns to the selection screen.</b>
rs_selfield-exit = 'X'.
ENDIF.
WHEN OTHERS.
ENDCASE.
ENDFORM. "alv_user_command
Regards
Uwe -
To display Title In ALV Grid Display on first line of table
Hi SAP Experts,
Here is one Issue..
I have some check boxes on selection screens,
When i have selected one,
The related title should be display on the first line of Itab[]...
and if once collect is used to suppress the data
with the same itab can we print normal itab and how...
Waiting for Your Reply.....
Thanks In AdvanceHi Krishna,
I can't imagine what you want.
In ALV grid object, you can change the title text for each column displayed. This is done via field catalog or, in SALV, column object methods.
In ALV fullscreen, you can define a TOP-OF-PAGE area where you may have what ever you want independent from the grid table content. I think you can not use this because you have the grid in a container.
You may define it as a docking or splitter container and place the grid in lower and the title in upper area. But this will need some experience with container controls and a certain level of coding abilities.
Regards,
Clemens -
ALV Grid- GET_SELECTED_ROWS returns empty table in edit mode
Hi all,
I saw similar threads on this forum, but didn't find the answer. Do you know if that is possible to force grid to return selected rows when is in edit mode? When I switch to display mode everything works just fine.
regards,
MarcinIt is necessary to enforce the ALV to transport data from the frontend to the backend. Therefore register the event
Register 'Enter' event
CALL METHOD go_alv->register_edit_event
EXPORTING
i_event_id = cl_gui_alv_grid=>mc_evt_enter.
After then clicking 'ENTER', the data should be available in the ABAP program. Without any user interaction it is not possible (as far as I know).
Best regards,
Thomas -
ALV Grid and a Drop-Down column
Hi All,
Currently I'm working on a Web Dynpro ABAP component where I'm display several columns of data within an ALV Grid.
I have made two of the columns input fields so the User can update the back-end tables. I want to made these two columns not only input fields, but I want them to have "Drop Down" capability (Value and Text) so that the User can pick only standard values.
Does anyone have any sample code I could use.
Thank you in Advance.
PaulHi Paul,
I dont think that you can provide the capability of both the input field & dropdown to the same columns. (Coz using input fields you should be able to enter any value you wish whereas using a dropdown you can enter a value from within the value set specified.) If you want to create a dropdown within your ALV columns then just go through the code snippet below:
I have a context node by name NODE with the attributes from SFLIGHT. I have 2 additional attributes TEMP & TEMP_NEW under the same node. I have typed them with my custom data element so that they can use the value range defined at the domain level. My task is to display these 2 columns TEMP & TEMP_NEW as dropdowns with the permissible values coming from their associated domains.
Regards,
Uday
METHOD build_alv .
DATA:
lr_alv_usage TYPE REF TO if_wd_component_usage,
lr_if_controller TYPE REF TO iwci_salv_wd_table,
lr_config TYPE REF TO cl_salv_wd_config_table,
lr_column_settings TYPE REF TO if_salv_wd_column_settings,
lt_columns TYPE salv_wd_t_column_ref,
lr_link TYPE REF TO cl_salv_wd_uie_link_to_action,
lr_checkbox TYPE REF TO cl_salv_wd_uie_checkbox,
lr_image TYPE REF TO cl_salv_wd_uie_image,
lr_dropdown TYPE REF TO CL_SALV_WD_UIE_DROPDOWN_BY_KEY.
FIELD-SYMBOLS
<fs_column> LIKE LINE OF lt_columns.
Instantiate the ALV Component
lr_alv_usage = wd_this->wd_cpuse_alv( ).
IF lr_alv_usage->has_active_component( ) IS INITIAL.
lr_alv_usage->create_component( ).
ENDIF.
Get reference to model
lr_if_controller = wd_this->wd_cpifc_alv( ).
lr_config = lr_if_controller->get_model( ).
To get the dropdowns displayed you need to set the table to editable by using below statement
lr_config->if_salv_wd_table_settings~set_read_only( abap_false ).
Set the UI elements.
lr_column_settings ?= lr_config.
lt_columns = lr_column_settings->get_columns( ).
You can use the below commented approach to fill the dropdowns instead of using a custom domain
data: lr_node_info type ref to if_wd_context_node_info,
lr_node type ref to if_wd_context_node,
wa_value_set type wdr_context_attr_value,
lt_value_set type table of wdr_context_attr_value.
lr_node = wd_context->get_child_node( name = 'NODE' ).
lr_node_info = lr_node->get_node_info( ).
wa_value_set-value = '1'.
wa_value_set-text = 'One'.
insert wa_value_set into table lt_value_set.
wa_value_set-value = '2'.
wa_value_set-text = 'Two'.
insert wa_value_set into table lt_value_set.
wa_value_set-value = '3'.
wa_value_set-text = 'Three'.
insert wa_value_set into table lt_value_set.
lr_node_info->set_attribute_value_set( name = 'TEMP'
value_set = lt_value_set ).
LOOP AT lt_columns ASSIGNING <fs_column>.
IF <fs_column>-id = 'CARRID'.
CREATE OBJECT lr_link.
lr_link->set_text_fieldname( <fs_column>-id ).
<fs_column>-r_column->set_cell_editor( lr_link ).
ENDIF.
IF <fs_column>-id = 'TEMP'.
CREATE OBJECT lr_dropdown
EXPORTING
selected_key_fieldname = 'TEMP'.
<fs_column>-r_column->set_cell_editor( lr_dropdown ).
ENDIF.
IF <fs_column>-id = 'TEMP_NEW'.
CREATE OBJECT lr_dropdown
EXPORTING
selected_key_fieldname = 'TEMP_NEW'.
<fs_column>-r_column->set_cell_editor( lr_dropdown ).
ENDIF.
ENDLOOP.
ENDMETHOD. -
ALV Grid Report spool problem with column with no data
Hello All,
I have created a simple alv grid report the report has a description field of 40 ch for which I have made the display length as 20 ch . This works fine in the foreground but when I run the report in background when there is no data in this column this being overwritten with the next column. Which is causing a mismatch between the header and the data below it.
Also when I try to download the report in foreground into excel the columns are not matching with the headers this again happens for columns when there is no data.
Kindly please suggest what is going wrong.
Thanks,
ranjanHi,
For checking the output from background job, check the job and enter JDBG in the command bar and execute.
Check the field catalog and the table contents in debugging just before display.
Edited by: Jayanthi Jayaraman on Dec 2, 2010 4:09 AM -
Move sign to left of quantity on alv grid with & stil total quantity column
Hi Guys,
Here is my problem.. I have a column on my alv grid that is signed. I want the sign to appear to the left of the number.
This column needs to be totalled so I can't use the function module CLOI_PUT_SIGN_IN_FRONT. I've also tried (as per forum thread) having the field type as TABHIST-DELRATE but this rounds the values and the sign is still on the wrong side.
Any ideas would be gratefully received..
Regards,
Liz.I think first you need to read
1. USR01-DCPFM for user default decimals values, by giving user sy-uname then go to
2. DDVAL giving USR01 & DCPFM you will get domain values
if domain values X or Y or space arrange the EDIT_MASK accordingly and pass to field catalog.
( Here you can also use fm DOMAIN_VALUE_GET)
May this will you out.
a® -
Alv Grid download to xl sheet: Column position mismatching
Hi All,
As we know that while downloading the alv grid report data into xl sheet the date cloumn and might some other column positon get shifted to extreme right.
My problem is with five columns in my grid report that got shifted to extreme right while downloading to the xl sheet. They have the data type CURR and DEC. As both the types are basically packed.
I tried to convert one of them into character, but had short dumpfor this conversion.I
Please suggest me to resolve this issue. I shall be greatful to the valuable answer.
Note: My internal table fields order and fields order in fieldcatalog are same.
Thnaks in advance.Answer is to convert it to CHAR .
Conversion error could you post..
Might be the size was not enough to accomodate the DEC/CURR value .
Or the field was not able to recognise the negative/positive signs .
Other option is to play with excel and manually convert all fields to Text by formatting the column in excel. -
OO ALV grid with a header line is this possible?
Howdy!
I have a requirement where I need to produce an ALV grid with the following format:
<b>Text 1 Text 2 Text 3 Text 4
Text 6
Col_1 Col_2 Col_3 Col_4 Col_5 Col_6 Col_7 Col_8 Col_9
Cell conents -
Cell conents -
Cell conents -
Cell conents -
Cell conents -
</b>
Anyone got any idea on how to get the 'TEXT' fields into the ALV grid? These are dynamic texts that would basically display details of data entered in the selection screen.
The ALV title line is limited to 70 characters and I can't think of another way of doing this.
The texts need to appear on the ALV grid becasue the user would like to download them to Excel in addition to the ALV cell contents using the standard ALV functionality.
Any ideas would be appreciated!
Message was edited by: RobertI'm thinking that this may not work because it is not a full screen grid and the grid container does not care about the container on top of it so, it most likely would not print it. Implement this example program, you can see how this would work for you if you were using the FM.
report zrich_0001
no standard page heading.
* Global ALV Data Declarations
type-pools slis.
data: begin of i_alv occurs 0,
matnr type mara-matnr,
end of i_alv.
* Miscellanous Data Declarations
data: fieldcat type slis_t_fieldcat_alv,
events type slis_t_event,
list_top_of_page type slis_t_listheader,
top_of_page type slis_formname value 'TOP_OF_PAGE'.
start-of-selection.
perform initialization.
perform get_data.
perform call_alv.
end-of-selection.
* Form Initialization
form initialization.
clear i_alv. refresh i_alv.
perform eventtab_build using events[].
endform.
* Form Get_Data
form get_data.
select matnr into table i_alv
from mara up to 100 rows.
endform.
* CALL_ALV
form call_alv.
data: variant type disvariant.
data: repid type sy-repid.
repid = sy-repid.
variant-report = sy-repid.
variant-username = sy-uname.
perform build_field_catalog.
perform comment_build using list_top_of_page[].
* Call ABAP List Viewer (ALV)
call function 'REUSE_ALV_GRID_DISPLAY'
exporting
it_fieldcat = fieldcat
i_callback_program = repid
is_variant = variant
it_events = events[]
i_save = 'U'
tables
t_outtab = i_alv.
endform.
* EVENTTAB_BUILD
form eventtab_build using events type slis_t_event.
* Registration of events to happen during list display
data: tmp_event type slis_alv_event.
call function 'REUSE_ALV_EVENTS_GET'
exporting
i_list_type = 0
importing
et_events = events.
read table events with key name = slis_ev_top_of_page
into tmp_event.
if sy-subrc = 0.
move top_of_page to tmp_event-form.
append tmp_event to events.
endif.
endform.
* BUILD_FIELD_CATALOG
form build_field_catalog.
clear: fieldcat. refresh: fieldcat.
data: tmp_fc type slis_fieldcat_alv.
tmp_fc-reptext_ddic = 'Material'.
tmp_fc-fieldname = 'MATNR'.
tmp_fc-tabname = 'I_ALV'.
tmp_fc-outputlen = 18.
append tmp_fc to fieldcat.
endform.
* COMMENT_BUILD
form comment_build using list_top_of_page type
slis_t_listheader.
data: tmp_line type slis_listheader.
clear tmp_line.
tmp_line-typ = 'H'.
tmp_line-info = 'Here is a line of text'.
append tmp_line to list_top_of_page.
clear tmp_line.
tmp_line-typ = 'S'.
tmp_line-key = 'Key1'.
tmp_line-info = 'Here is a value'.
append tmp_line to list_top_of_page.
clear tmp_line.
tmp_line-typ = 'S'.
tmp_line-key = 'Key2'.
tmp_line-info = 'Here is another value'.
append tmp_line to list_top_of_page.
endform.
* TOP_OF_PAGE
form top_of_page.
call function 'REUSE_ALV_COMMENTARY_WRITE'
exporting
i_logo = 'ENJOYSAP_LOGO'
it_list_commentary = list_top_of_page.
endform.
Regards,
Rich Heilman -
Hi,
I'm trying to build the dax query to determine the distinct count for a column returned by the application of a Filter function.
evaluate(
row("counter",
countrows(
filter(order_summary,
year(order_summary[change_date]) = 2013) )
I need to count the distinct values for an id returned by the Filter function.
Any helps, please? ThanksHi pscorca,
According to your description, you want to calculate the distinct values for records where change_date is 2013. Right?
In this scenario, we can use the DISTINCT() function within COUNTROWS(). Please try the expression below:
=calculate(
countrows(distinct(order_summary[column])),
Filter('order_summary', year(order_summary[change_date])=2013)
Reference:
Distinct Count Measure in PowerPivot using DAX
Related Distinct Count
Best Regards,
Simon Hou
TechNet Community Support -
ALV issue - capturing user changes in editable fields using custom button?
Hi,
I created a custom button in ALV tool bar. And also in my ALV grid I have couple of fields Editable option. User can change values for these 2 fields.
My question is -
After changing values for these editable fields(more than 1 record) , user will click on custom button and then I have to update all the user changed values in to my internal table(lt_tab) and then I have to process logic.
Problem is when user click on Custom button in ALV tool bar it is not having the changed values in lt_tab table.
Only when user clicks some thing on ALV grid records or fields then it is getting all the changed values in to lt_tab.
Can any one tell me how I can get changed values when user clicks on custom button?
1. Can we place custom button in ALV Grid? instead of ALV tool bar?
or
How I can capture user changes when they click on custom button?
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
TABLES
T_OUTTAB = lt_tab
Please check this logic-
CASE r_ucomm.
WHEN '&IC1'.
- It_tab having all changed field values
WHEN 'custom button'.
lt_tab - not having any changed values - showing all initial lt_tab values.
I highly appreciate your answers on this.
Thanks.
Rajesh.Hi,
Use this code, its working:-
*& Form ALV_DISPLAY
* SUB-ROUTINE ALV_DISPLAY IS USED TO SET THE PARAMETERS
* FOR THE FUNCTION MODULE REUSE_ALV_GRID_DISPLAY
* AND PASS THE INTERNAL TABLE EXISTING THE RECORDS TO BE
* DISPLAYED IN THE GRID FORMAT
FORM alv_display .
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
* I_INTERFACE_CHECK = ' '
* I_BYPASSING_BUFFER = ' '
* I_BUFFER_ACTIVE = ' '
i_callback_program = v_rep_id " report id
i_callback_pf_status_set = 'PF' " for PF-STATUS
i_callback_user_command = 'USER_COMMAND' " for User-Command
* I_CALLBACK_TOP_OF_PAGE = ' '
* I_CALLBACK_HTML_TOP_OF_PAGE = ' '
* I_CALLBACK_HTML_END_OF_LIST = ' '
* I_STRUCTURE_NAME =
* I_BACKGROUND_ID = ' '
* I_GRID_TITLE =
* I_GRID_SETTINGS =
is_layout = wa_layout " for layout
it_fieldcat = it_field " field catalog
* IT_EXCLUDING =
* IT_SPECIAL_GROUPS =
it_sort = it_sort " sort info
* IT_FILTER =
* IS_SEL_HIDE =
* I_DEFAULT = 'X'
i_save = 'A'
is_variant = wa_variant " variant name
* IT_EVENTS =
* IT_EVENT_EXIT =
* IS_PRINT =
* IS_REPREP_ID =
* I_SCREEN_START_COLUMN = 0
* I_SCREEN_START_LINE = 0
* I_SCREEN_END_COLUMN = 0
* I_SCREEN_END_LINE = 0
* I_HTML_HEIGHT_TOP = 0
* I_HTML_HEIGHT_END = 0
* IT_ALV_GRAPHICS =
* IT_HYPERLINK =
* IT_ADD_FIELDCAT =
* IT_EXCEPT_QINFO =
* IR_SALV_FULLSCREEN_ADAPTER =
* IMPORTING
* E_EXIT_CAUSED_BY_CALLER =
* ES_EXIT_CAUSED_BY_USER =
TABLES
t_outtab = it_final " internal table
EXCEPTIONS
program_error = 1
OTHERS = 2.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
ENDFORM. " ALV_DISPLAY
*& Form USER_COMMAND
* SUB-ROUTINE USER_COMMAND IS USED TO HANDLE THE USER ACTION
* AND EXECUTE THE APPROPIATE CODE
* -->LV_OKCODE used to capture the function code
* of the user-defined push-buttons
* -->L_SELFIELD text
FORM user_command USING lv_okcode LIKE sy-ucomm l_selfield TYPE slis_selfield.
* assign the function code to variable v_okcode
lv_okcode = sy-ucomm.
* handle the code execution based on the function code encountered
CASE lv_okcode.
* when the function code is EXECUTE then process the selected records
WHEN 'EXECUTE'. "user-defined button
* to reflect the data changed into internal table
DATA : ref_grid TYPE REF TO cl_gui_alv_grid. "new
IF ref_grid IS INITIAL.
CALL FUNCTION 'GET_GLOBALS_FROM_SLVC_FULLSCR'
IMPORTING
e_grid = ref_grid.
ENDIF.
IF NOT ref_grid IS INITIAL.
CALL METHOD ref_grid->check_changed_data.
ENDIF.
* refresh the ALV Grid output from internal table
l_selfield-refresh = c_check.
ENDCASE.
ENDFORM.
This will reflect all the changes in the internal table. Now you can include your logic as per your requirement.
Hope this solves your problem.
Thanks & Regards,
Tarun Gambhir -
Cursor becomes invisible in JTextField after using default button
In my application there is an update screen (JPanel). I am using default button in that panel. The input field is a normal JTextField. When the update is over the cursor goes back to the input JTextField.
Now my problem is that when I carry out update with mouse, the cursor is correctly placed into the input JTextField and is visible after the update is over. On the other hand, if I carry out the same update operation using default button (using keyboard), the cursor gets placed correctly in the input JTextfield column, but becomes invisible. If I minimize and then again maximize the window, the cursor appears back. What am I missing ? Note that I am using component.requestFocusInWindow() to get focus back to the input JTextField.
regards,
nirvanWhile trying to reproduce the behaviour for SSCCE, I found that it is the JOptionPane.showMessageDialog() that is causing the problem. Here is the SSCCE.
package com.ns;
import java.awt.BorderLayout;
import java.awt.Dimension;
import java.awt.Toolkit;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JButton;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JTextField;
import javax.swing.WindowConstants;
public class TestFocus extends javax.swing.JFrame {
// Variables declaration - do not modify
private JTextField field1;
private JTextField field2;
private JPanel jPanel1;
private JButton reset;
private JButton update;
// End of variables declaration
public TestFocus() {
initComponents();
setDefaultButton();
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">
private void initComponents() {
jPanel1 = new JPanel();
field1 = new JTextField();
field2 = new JTextField();
update = new JButton();
reset = new JButton();
setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
field1.setPreferredSize(new Dimension(40, 20));
jPanel1.add(field1);
field2.setPreferredSize(new Dimension(40, 20));
jPanel1.add(field2);
update.setText("Update");
update.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent evt) {
updateActionPerformed(evt);
jPanel1.add(update);
reset.setText("Reset");
reset.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent evt) {
resetActionPerformed(evt);
jPanel1.add(reset);
getContentPane().add(jPanel1, BorderLayout.CENTER);
Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
setBounds((screenSize.width-385)/2, (screenSize.height-258)/2, 385, 258);
}// </editor-fold>
public void setDefaultButton(){
this.getRootPane().setDefaultButton(update);
private void updateActionPerformed(ActionEvent evt) {
// TODO add your handling code here:
JOptionPane.showMessageDialog(this,"Activity Updated Succesfully in Database.",
"Information",
JOptionPane.INFORMATION_MESSAGE);
update.setEnabled(false);
field1.setEditable(false);
reset.setEnabled(true);
this.getRootPane().setDefaultButton(reset);
private void resetActionPerformed(ActionEvent evt) {
// TODO add your handling code here:
field1.requestFocusInWindow();
field1.setText("");
field1.setEditable(true);
reset.setEnabled(false);
update.setEnabled(true);
this.getRootPane().setDefaultButton(update);
public static void main(String args[]) {
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new TestFocus().setVisible(true);
}If I remove the JOptionPane.showMessageDialog() method, everything works fine with mouse as well as keyboard.
regards,
nirvan. -
ME57 ALV Grid adding some custom fields (columns)
Hi all,
does anyone know if it is possible to add some custom col's to the ALV where i see the Overview of PO Requests in ME57 ?
seems to me that i have to find a possibilty to expand the structure MEREQ3214 .
can i do this with the exit MEREQ001 ? if yes, which component should i use ?
Thanks for some ideas.
TonyHi Tony,
I am facing the same issue. Did you ever get to any solution regarding it ?
Thanks,
Gaurav -
How can i return to getting sound after pressing panic button?
I pressed the panic button after setting up my layout, and I had everything set up the way I wanted it (volume included). The volume then disappeared and no sound appears after I pressed the panic button. I've tried remapping everything but I had no luck. Please help me.
Unfortunately it does happen sometimes. I'm still trying to solve the same problem. Panic is assigned to a button on my controller and it usually works correctly, but sometimes during a live performance when I get a stuck note, the panic button kills the plugin completely. It happens mainly with Vintage B3 and E. Piano, but it has also happened with Ivory II. This never happened with MS 2. Panic is supposed to reset MDI and the audio engine, according to MS 3 help. Maybe it's a bug, or maybe my older machine isn't fast enough. I'm using a mid-2010 Mac Mini 2.6 with 16GB RAM and two 500GB 7200 rpm drives running the OSX 10.9.2 and MS 3.0.3. Any ideas, CCTM or Blueberry?
Maybe you are looking for
-
Hi, for audit reasons we need to run a report again. Therefore a changed the where-clause of the report. Since the report needs to run on our production system and the prodcution-version of the report can not be changed, I need to run the report from
-
CRM_ORDER_MAINTAIN, CRM_ORDER_READ
AS I am new to CRM I have simple doubt CRM_ORDER_MAINTAIN, CRM_ORDER_READ are function modules or BAPI's. I know all BAPI 's are REMOTE enabled Function Modules. In which situations we will use RFC and in which situation we will use BAPI's Thanks,
-
Converting text in Draw document to editable Text in Word Processing
I have created a Draw document consisting of photographs and text. I now want to send the text only to a colleague for sub-editing. How do I convert the one to the other, please?
-
Single pixel formation in Intensity graph
I needed to capture a image using CCD camera. Though it has 16 bit resolution, i need to focus on ONE PIXEL. The process goes like this. Save the image information in a spread sheet array and then find the max value of the array. Till this step, i am
-
Hi - I've been out of programming for 2 years and am just climbing back in. I just found out that my site is now on a CF 8 server and I'm trying to find out what's new in CF since MX7. I see that CF 9 is all the chatter here. Is there a page that sum