Updating Row in a Grid
Hi All
I m extracting data from SQL table onto xMII Dashboard using Grid template.I have one column named comments.
I need that the supervisor using the Dashboard can change the comments as required and it should be reflected on the dashboard as well as It is updated in the database.
Can anyone tell me how can I achieve this ? I am concerned whether I would be able to change an xMII Grid row ....
Regards
Amit
Hi Amit,
Add a cell selection event in your iGrid template definition
e.g.
<APPLET NAME="appDashBoard" WIDTH="100%" HEIGHT="250" CODE="iGrid" CODEBASE="/Illuminator/Classes" ARCHIVE="illum8.zip" MAYSCRIPT>
<PARAM NAME="QueryTemplate" VALUE="/your/query/template">
<PARAM NAME="DisplayTemplate" VALUE="/your/display/template">
<PARAM NAME="InitialUpdate" VALUE="true">
<PARAM NAME="CellSelectionEvent" VALUE="JavaScriptFunctionName">
</APPLET>
Create a query template to update new comment in database
<APPLET NAME="appUpdateComment" WIDTH="1" HEIGHT="1" CODE="iCommand" CODEBASE="/Illuminator/Classes" ARCHIVE="illum8.zip" MAYSCRIPT>
<PARAM NAME="QueryTemplate" VALUE="/update/comment">
</APPLET>
In your Java script function check whether the selected cell is part of the comment's column
if (appDashBoard,getSelectedCellColumn() == 'Comment'){
//capture new user comment
var comment = prompt('Enter comment', '');
//get record id from igrid for the selected comment
var cellRow = appDashBoard.getSelectedCellRow();
var rID = getCellValue(cellRow, columNumberOfID);
var appUpdateCommentQry= appUpdateComment.getQueryObject();
appUpdateCommentQry.setParam(1, rID);
appUpdateCommentQry.setParam(2, comment );
if(appUpdateComment.executeCommand()) {
} else {
appDashBoard.updateGrid(true);
Similar Messages
-
Single Click on a Row in ALV Grid
Hello,
I am using 'CL_GUI_ALV_GRID' class for displaying an ALV grid.
The requirement is when an user clicks on a row of the grid, a popup should be displayed with the details of that line, the user can edit/enter some fields there and when clicks on the save button, the updated values should get saved in database.
Which event needs to be used for this? A sample code will be very useful.
Thanks
Indrajit.Hello Indrajit
The same behaviour you see in the IDoc Monitor (transaction WE02, report RSEIDOC2). The event you need to handle is DELAYED_CHANGED_SEL_CALLBACK.
Coding copied from RSEIDOC_ALV_CL:
***INCLUDE CLASS_ALV .
* LOCAL CLASSES: Definition für ALV Ereignisse
CLASS lcl_event_receiver DEFINITION.
PUBLIC SECTION.
METHODS:
handle_delayed_changed_sel_cb
FOR EVENT delayed_changed_sel_callback OF cl_gui_alv_grid,
METHOD handle_delayed_changed_sel_cb.
data: lt_rows TYPE lvc_t_row.
data: l_row TYPE lvc_s_row.
CALL METHOD grid->get_selected_rows
IMPORTING et_index_rows = lt_rows.
CALL METHOD cl_gui_cfw=>flush.
read table lt_rows index 1 transporting no fields.
if sy-subrc ne 0.
exit.
endif.
perform fill_special_values tables lt_rows.
need_refresh = 'N'.
set screen 100.
leave screen.
ENDMETHOD.
Regards
Uwe -
There was an error while updating row count for "SH".."SH".CHANNELS
Hi All,
Am new to OBIEE.Pls help in this regard.
Am building the physical layer as per Repository guide.When am importing the data in to this,am getting the below error.
*"There was an error while updating row count for "SH".."SH".CHANNELS" :"*
channles is the table name and having 5 rows.
but am able to see the data in the sql prompt. like SELECT * FROM SH.CHANNELS then 5 rows data would be displaying..
pls help in this regard and where is the excat problem?
Thanks,what is the error?
Make sure that your connection pool settings are okay..
Make sure that, you are using correct driver in case of if you are using ODBC dsn..
Also make sure that, your oracle server is running... TNS and Oracle server services -
Deactivate the double click/ hot spot for a particular row in alv grid.
Hello,
As per a certain condition how to deactivate the double click/ hot spot for a particular row in alv grid.
Regards,
Sarojwhere u define layout there is a field hotspot.like
data: var.
if con is true
var = 'X'. (show hotspot)
else.
var = ' '. (deactive hotspot)
elseif ws_fieldcat-fieldname = 'DMBTR'
AND ws_fieldcat-tabname = 'T_MTAB'.
ws_fieldcat-do_sum = C_X.
<b>ws_fieldcat-hotsopts = var.</b>
MODIFY Wt_fieldcat FROM ws_fieldcat
TRANSPORTING DO_SUM.
It is helpful for u. if any problen send me ur coding i will change it.
Regards
Manish Kumar -
How to print a report without row numbers or grid lines?
Is there a way to print a Discoverer report without row numbers or grid lines?
Thank you.
BlakeHi Blake
You're not doing anything wrong.
The settings made when you use Tools | Options | Sheet are global settings that are only applied to new workbooks and worksheets going forwards. These have no impact on existing worksheets or even the one you currently have open. This is because Discoverer does not know whether your original worksheets were setup in a certain way deliberately as opposed to inheriting the global settings as they were at that time. What this also means, reading between the lines, is that these settings must then be stored within the worksheet itself, and this is exactly what happens.
Thus, to edit an existing worksheet's settings you need to open the worksheet, right-click in the sheet and from the popup select either Format Table or Format Crosstab depending upon the type of worksheet you are working with. After making any necessary changes you will need to save or re-save the workbook in order for those settings to be remembered for the next time.
Best wishes
Michael -
How can i update rows in a table based on a match from a select query
Hello
How can i update rows in a table based on a match from a select query fron two other tables with a update using sqlplus ?
Thanks Glenn
table1
attribute1 varchar2 (10)
attribute2 varchar2 (10)
processed varchar2 (10)
table2
attribute1 varchar2 (10)
table3
attribute2 varchar2 (10)
An example:
set table1.processed = "Y"
where (table1.attribute1 = table2.attribute1)
and (table1.attribute2 = table3.attribute2)Hi,
Etbin wrote:
Hi, Frank
taking nulls into account, what if some attributes are null ;) then the query should look like
NOT TESTED !
update table1 t1
set processed = 'Y'
where exists(select null
from table2
where lnnvl(attribute1 != t1.attribute1)
and exists(select null
from table3
where lnnvl(attribute2 != t1.attribute2)
and processed != 'Y'Regards
EtbinYes, you could do that. OP specifically requested something else:
wgdoig wrote:
set table1.processed = "Y"
where (table1.attribute1 = table2.attribute1)
and (table1.attribute2 = table3.attribute2)This WHERE clause won't be TRUE if any of the 4 attribute columns are NULL. It's debatable about what should be done when those columns are NULL.
But there is no argument about what needs to be done when processed is NULL.
OP didn't specifically say that the UPDATEshould or shouldn't be done on rows where processed was already 'Y'. You (quite rightly) introduced a condition that would prevent redo from being generated and triggers from firing unnecessarily; I'm just saying that we have to be careful that the same condition doesn't keep the row from being UPDATEd when it is necessary. -
How to change a color for a row in ALV grid display
Hi,
how to change a color for a row in ALV grid display based on a condition.Any sample code plzHello Ramya,
Did you check in [SCN|How to color a row of alv grid]
Thanks! -
Obiee oracle gateway error while updating row count
Hi ,
OBIEE server 11.1.1.5 ,oracle server11g installed in linux 64bit,
while updating row count in Admin tool i am getting the following error
[NQODBC][SQL_STATE:HY000][nQSError:10058] A general error has occured.
[nQSError: 43113]Message returned from OBIS.
[nQSError:43093]An error occured while processing the EXECUTE PHYSICAL statement.
[nQSError:17003]Oracle gateway error: OCIEnvNIsCreate or OCIEnvInit failed to initialize environment.Please check your Oracle Client installation and make sure the correct version of OCI libraries are in the library path.
i am able to check the database from sqlplus it is working fine.
Any suggestion highly appreciated plzzzMake sure your connection pool is valid and able to import or execute reports.
If everything good as above said, in Physical layer database properties-> general tab choose the database version and try it once.
If not
Check the doc id 1271486.1
Or
To resolve the issue create a softlink (ln -s) in the <OracleBI>/server/Bin folder to link to the 32-bit Oracle Client Driver file.
The example below shows how to perform a softlink from the 64 bit directory:
cd /u10/app/orcladmin/oracle/OracleBI/server/Bin
ln -s $ORACLE_HOME/lib32/libclntsh.so.10.1 libclntsh.so.10.1
If helps mark -
Not able to update row count in Physical Layer..connection failed in OBIEE 11g
Hi Guys,
I am not able to do Update Row count in the Physical Layer, i am getting an error The Connection has failed. This is in OBIEE 11g Linux env.
I have put the tnsnames.ora file in the below path:
/*****/pkgs/linux/intel/OBIEE_DIT/MW_HOME/Oracle_BI1/network/admin/
I do not have admin under
/****/pkgs/linux/intel/OBIEE_DIT/MW_HOME/oracle_common/network/
But if i put the whole TNS entry in the Data Source Name i am able to connect:
(DESCRIPTION =(ADDRESS = (PROTOCOL= TCP) (HOST= xxx.xxx.com) (PORT= 1671))(CONNECT_DATA = (SERVICE_NAME = US1OBIEE)))
I am not able to understand the issue..
Thanks,
AmitLooks like rpd is looking for local tns config... try to use as hostname:port/ServiceName
This should work, just in case not working! stop doing so since it is know issue.
If helps mark -
Cursor and Update rows based on value/date
SQL Server 2012
Microsoft SQL Server Management Studio
11.0.3128.0
Microsoft Analysis Services Client Tools
11.0.3128.0
Microsoft Data Access Components (MDAC)
6.1.7601.17514
Microsoft MSXML 3.0 4.0 5.0 6.0
Microsoft Internet Explorer
9.11.9600.16518
Microsoft .NET Framework
4.0.30319.18408
Operating System
6.1.7601
The objective of this is to test the Cursor and use it on a production environment after this is fixed. What I would like to do is update rows in a column i duplicated originally called 'HiredDate' from AdventureWorks2012 HumanResources.Employee table. I
made a duplicate column called 'DateToChange' and would like to change it based on a date I have picked, which returns normally 2 results (i.e. date is '04/07/2003'). The code runs but will not change both dates. It did run however with an error but changed
only 1 of the 2 rows because it said ['nothing available in next fetch'].
The code to add the columns and perform the query to get the results I am running this against:
-- ADD column 'DateToChange'
ALTER TABLE [HumanResources].[Employee] ADD DateToChange Date NOT NULL;
-- Copy 'HireDate' data to 'DateToChange'
UPDATE HumanResources.Employee SET DateToChange = HireDate;
-- Change 'DateToChange' to NOT NULL
ALTER TABLE [HumanResources].[Employee] ALTER COLUMN DateToChange Date NOT NULL;
SELECT BusinessEntityID,HireDate, CONVERT( char(10),[DateToChange],101) AS [Formatted Hire Date]
FROM HumanResources.Employee
WHERE [DateToChange] = '04/07/2003';
Code:
USE AdventureWorks2012;
GO
-- Holds output of the CURSOR
DECLARE @EmployeeID INT
DECLARE @HiredDate DATETIME
DECLARE @HiredModified DATETIME
DECLARE @ChangeDateTo DATETIME
--Declare cursor
-- SCROLL CURSOR ALLOWS "for extra options" to pul multiple records: i.e. PRIOR, ABSOLUTE ##, RELATIVE ##
DECLARE TestCursor CURSOR SCROLL FOR
-- SELECT statement of what records going to be used by CURSOR
-- Assign the query to the cursor.
SELECT /*HumanResources.Employee.BusinessEntityID, HumanResources.Employee.HireDate,*/ CONVERT( char(10),[DateToChange],101) AS [Formatted Hire Date]
FROM HumanResources.Employee
WHERE DateToChange = '01/01/1901'
/*ORDER BY HireDate DESC*/ FOR UPDATE OF [DateToChange];
-- Initiate CURSOR and load records
OPEN TestCursor
-- Get first row from query
FETCH NEXT FROM TestCursor
INTO @HiredModified
-- Logic to tell the Cursor while "@@FETCH_STATUS" 0 the cursor has successfully fetched the next record.
WHILE (@@FETCH_STATUS = 0 AND @@CURSOR_ROWS = -1)
BEGIN
FETCH NEXT FROM TestCursor
IF (@HiredModified = '04/07/2003')/*05/18/2006*/
-- Sets @HiredModifiedDate data to use for the change
SELECT @ChangeDateTo = '01/01/1901'
UPDATE HumanResources.Employee
SET [DateToChange] = @ChangeDateTo --'01/01/1901'
FROM HumanResources.Employee
WHERE CURRENT OF TestCursor;
END
-- CLOSE CURSOR
CLOSE TestCursor;
-- Remove any references held by cursor
DEALLOCATE TestCursor;
GO
This query is run successfully but it does not produce the desired results to change the dates
04/07/2003 to 01/01/1901.
I would like the query to essentially be able to run the initial select statement, and then update and iterate through the returned results while replacing the necessary column in each row.
I am also open to changes or a different design all together.
For this query I need:
1. To narrow the initial set of information
2. Check if the information returned, in particular a date, is before [i.e. this current month minus 12 months or
12 months before current month]
3. Next replace the dates with the needed date
[Haven't written this out yet but it will need to be done]
4. After all this is done I will then need to update a column on each row:
if the 'date' is within 12 months to 12 months from the date checked
NOTE: I am new to TSQL and have only been doing this for a few days, but I will understand or read up on what is explained if given enough information. Thank you in advance for anyone who may be able to help.The first thing you need to do is forget about cursors. Those are rarely needed. Instead you need to learn the basics of the tsql language and how to work with data in sets. For starters, your looping logic is incorrect. You open
the cursur and immediately fetch the first row. You enter the loop and the first thing in the loop does what? Fetches another row. That means you have "lost" the values from the first row fetched. You also do not test the success of
that fetch but immediately try to use the fetched value. In addition, your cursor includes the condition "DateToChange = '01/01/1901' " - by extension you only select rows where HireDate is Jan 1 1901. So the value fetched into @HiredModified will
never be anything different - it will always be Jan 1 1901. The IF logic inside your loop will always evaluate to FALSE.
But forget all that. In words, tell us what you are trying to do. It seems that you intend to add a new column to a table - one that is not null (ultimately) and is set to a particular value based on some criteria. Since you intend the
column to be not null, it is simpler to just add the column as not null with a default. Because you are adding the column, the assumption is that you need to set the appropriate value for EVERY row in the table so the actual default value can be anything.
Given the bogosity of the 1/1/1901 value, why not use this as your default and then set the column based on the Hiredate afterwards. Simply follow the alter table statement with an update statement. I don't really understand what your logic
or goal is, but perhaps that will come with a better description. In short:
alter table xxx add DateToChange date default '19010101'
update xxx set DateToChange = HireDate where [some unclear condition]
Lastly, you should consider wrapping everything you do in a transaction so that you recover from any errors. In a production system, you should consider making a backup immediately before you do anything - strongly consider and have a good reason not
to do so if that is your choice (and have a recovery plan just in case). -
Hi my friends,
I have written a small ALV Grid where some rows should be colored, dependend on their status in a table. But it's not working and I can't find out, why it is not working. I've already studied all the topics in this forum, which are related to 'row color alv grid', but I can't find the mistake in my code. Is anyone able to find out what is wrong here?
Thanks a lot for your help!
*& Report /BMC_TST_SHOWLOG
REPORT /BMC_TST_SHOWLOG.
TYPES: BEGIN OF log_table.
TYPES: log_level TYPE /bmc_log_message,
cr_date TYPE /bmc_cr_date,
message TYPE /bmc_log_message,
linecolor(4) TYPE c.
TYPES: END OF log_table.
DATA: lt_log TYPE TABLE OF log_table with HEADER LINE,
lt_log2 TYPE TABLE OF log_table with HEADER LINE,
lt_log_list TYPE TABLE OF log_table,
lt_line LIKE LINE OF lt_log_list,
container_r TYPE REF TO cl_gui_custom_container,
grid_r TYPE REF TO cl_gui_alv_grid,
gc_custom_control_name TYPE scrfname VALUE 'CONTAINER_LOG',
fieldcat_r TYPE lvc_t_fcat,
layout_r TYPE lvc_s_layo,
logA TYPE /bmc_log_level,
logB TYPE /bmc_log_level,
logC TYPE /bmc_log_level,
logD TYPE /bmc_log_level,
logE TYPE /bmc_log_level,
ls_ct TYPE lvc_s_scol,
ok_code LIKE sy-ucomm.
*DATA BEGIN OF ls_log_list OCCURS 0.
*DATA: log_level TYPE /bmc_log_message,
* cr_date TYPE /bmc_cr_date,
* message TYPE /bmc_log_message,
* rowcolor(4) TYPE c.
*DATA END OF ls_log_list.
*DATA: lt_log_list TYPE TABLE OF log_table.
PARAMETERS: loglevlA TYPE c AS CHECKBOX,
loglevlB TYPE c as CHECKBOX,
loglevlC TYPE c As CHECKBOX,
loglevlD TYPE c aS CHECKBOX,
loglevlE TYPE c AS CHECKBOX,
dateA TYPE /bmc_cr_date OBLIGATORY,
dateB TYPE /bmc_cr_date.
CALL SCREEN 0200.
MODULE user_command_0200 INPUT.
CASE ok_code.
WHEN 'BACK'.
SET SCREEN 0.
MESSAGE ID 'BC400' TYPE 'S' NUMBER '057'.
WHEN OTHERS.
ENDCASE.
ENDMODULE.
MODULE clear_ok_code OUTPUT.
CLEAR ok_code.
ENDMODULE.
MODULE status_0200 OUTPUT.
SET PF-STATUS 'DYNPRO200'.
SET TITLEBAR 'D0200'.
ENDMODULE.
MODULE display_alv OUTPUT.
PERFORM display_alv.
ENDMODULE.
FORM display_alv.
IF grid_r IS INITIAL.
*----Creating custom container instance
CREATE OBJECT container_r
EXPORTING
container_name = gc_custom_control_name
EXCEPTIONS
cntl_error = 1
cntl_system_error = 2
create_error = 3
lifetime_error = 4
lifetime_dynpro_dynpro_link = 5
others = 6.
IF sy-subrc <> 0.
*--Exception handling
ENDIF.
*----Creating ALV Grid instance
CREATE OBJECT grid_r
EXPORTING
i_parent = container_r
EXCEPTIONS
error_cntl_create = 1
error_cntl_init = 2
error_cntl_link = 3
error_dp_create = 4
others = 5.
IF sy-subrc <> 0.
*--Exception handling
ENDIF.
PERFORM get_log_data.
*----Preparing field catalog.
PERFORM prepare_field_catalog CHANGING fieldcat_r.
*----Preparing layout structure
PERFORM prepare_layout CHANGING layout_r.
*----Here will be additional preparations
*--e.g. initial sorting criteria, initial filtering criteria, excluding
*--functions
CALL METHOD grid_r->set_table_for_first_display
EXPORTING
is_layout = layout_r
CHANGING
it_outtab = lt_log2[]
it_fieldcatalog = fieldcat_r
EXCEPTIONS
invalid_parameter_combination = 1
program_error = 2
too_many_lines = 3
OTHERS = 4.
IF sy-subrc <> 0.
*--Exception handling
ENDIF.
ELSE.
CALL METHOD grid_r->refresh_table_display
EXCEPTIONS
finished = 1
OTHERS = 2.
IF sy-subrc <> 0.
*--Exception handling
ENDIF.
ENDIF.
CALL METHOD grid_r->register_edit_event
EXPORTING
i_event_id = cl_gui_alv_grid=>mc_evt_enter.
CALL METHOD grid_r->register_edit_event
EXPORTING
i_event_id = cl_gui_alv_grid=>mc_evt_modified.
ENDFORM.
FORM prepare_field_catalog CHANGING pt_fieldcat TYPE lvc_t_fcat.
DATA ls_fcat TYPE lvc_s_fcat.
CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'
EXPORTING
i_structure_name = '/BMC_LOG'
CHANGING
ct_fieldcat = pt_fieldcat[]
EXCEPTIONS
inconsistent_interface = 1
program_error = 2
OTHERS = 3.
IF sy-subrc ne 0.
*--Exception handling
ENDIF.
LOOP AT pt_fieldcat INTO ls_fcat.
CASE ls_fcat-fieldname.
WHEN 'UUID'.
ls_fcat-no_out = 'X'.
MODIFY pt_fieldcat FROM ls_fcat.
WHEN 'LOG_LEVEL'.
ls_fcat-coltext = 'Meldungsart'.
ls_fcat-outputlen = '25'.
MODIFY pt_fieldcat FROM ls_fcat.
WHEN 'CR_DATE'.
ls_fcat-coltext = 'Erstellungsdatum'.
ls_fcat-outputlen = '20'.
MODIFY pt_fieldcat FROM ls_fcat.
WHEN 'CR_TIME'.
ls_fcat-no_out = 'X'.
MODIFY pt_fieldcat FROM ls_fcat.
WHEN 'MESSAGE'.
ls_fcat-coltext = 'Nachricht'.
ls_fcat-outputlen = '50'.
MODIFY pt_fieldcat FROM ls_fcat.
ENDCASE.
* CASE ls_fcat-value.
* WHEN '1'.
* ls_fcat-line_color = 'c100'.
* ENDCASE.
ENDLOOP.
ENDFORM.
FORM prepare_layout CHANGING ps_layout TYPE lvc_s_layo.
ps_layout-zebra = 'X'.
ps_layout-grid_title = 'Log'.
ps_layout-smalltitle = 'X'.
ps_layout-info_fname = 'linecolor'.
ENDFORM.
FORM get_log_data.
if loglevlA = 'X'.
logA = '1'.
ENDIF.
if loglevlB = 'X'.
logB = '2'.
ENDIF.
if loglevlC = 'X'.
logC = '3'.
ENDIF.
if loglevlD = 'X'.
logD = '4'.
ENDIF.
if loglevlE = 'X'.
logE = '5'.
ENDIF.
IF dateB ne 0.
SELECT log_level cr_date message FROM /bmc_log INTO CORRESPONDING FIELDS OF TABLE lt_log_list WHERE log_level = logA
OR log_level = logB OR log_level = logC OR log_level = logD OR log_level = logE and cr_date >= dateA and cr_date <= dateB.
ELSE.
SELECT log_level cr_date message FROM /bmc_log INTO CORRESPONDING FIELDS OF TABLE lt_log_list WHERE log_level = logA
OR log_level = logB OR log_level = logC OR log_level = logD OR log_level = logE and cr_date >= dateA.
ENDIF.
* and cr_date >= dateA.
SORT lt_log_list ASCENDING.
LOOP AT lt_log_list INTO lt_line.
IF lt_line-log_level = '1'.
lt_line-log_level = 'Info'.
lt_line-linecolor = 'C100'.
ENDIF.
IF lt_line-log_level = '2'.
lt_line-log_level = 'Warning'.
lt_line-linecolor = 'C200'.
ENDIF.
IF lt_line-log_level = '3'.
lt_line-log_level = 'Error'.
lt_line-linecolor = 'C300'.
ENDIF.
IF lt_line-log_level = '4'.
lt_line-log_level = 'Debug'.
lt_line-linecolor = 'C400'.
ENDIF.
IF lt_line-log_level = '5'.
lt_line-log_level = 'Trace'.
lt_line-linecolor = 'C500'.
ENDIF.
APPEND lt_line TO lt_log2.
ENDLOOP.
ENDFORM.
SELECTION-SCREEN BEGIN OF SCREEN 0100 TITLE text-001 AS WINDOW.
SELECTION-SCREEN END OF SCREEN 0100.> change to this
>
> <b>ps_layout-stylefname = 'LINECOLOR'.</b>
>
> sorry ignore the above line
>
> just debug and check what is happening
>
> Message was edited by:
> Chandrasekhar Jagarlamudi
Hi,
I've changed the line to <b>ps_layout-stylefname = 'LINECOLOR'.</b>, but then I'm getting a runtime error 'ASSIGN_TYPE_CONFLICT' in program 'SAPLSLVC in line 2975'...
I don't have any idea what is causing that. -
Select multiple rows in a grid
Hi All,
I want to select multiple rows in a grid on click of a button, there is no checkbox there are multiple rows which need to be selected like we do on pressing shift key on the keyboard. Please suggest how can this be done.
thanks in advance.
Regards,
AnjuHi Anju,
You can check this link to solve your problem:
https://wiki.sdn.sap.com/wiki/display/Snippets/ALV%2bGrid%2bDisplay%2bwith%2bcheckbox%2bto%2bprocess%2bselected%2brecords%2bat%2bruntime
Hope it helps you.
Thanks & Regards,
Sarita Singh Rathour -
How to create new or delete the existing row in the grid....
hi my friends...
i am developing report using Reuse_alv_grid_display...
my requirement is... At runtime
1. i may create new row on the grid (empty row inwhich i may enter the data).
2. i may delete a existing row in the grid
3. i may edit the existing data...
then i have to trace the modification in the grid in one internal table...
how can i get into this.....
note:
i have some idea to edit the existing record in the grid and trace those modification,
but i don't know abt how to create new or delete the existing row....
can you give me some idea...Hi deva,
write a class which implemets these methods
CLASS lcl_event_receiver DEFINITION.
PUBLIC SECTION.
METHODS:
To handle the toolbar on alv
handle_toolbar
FOR EVENT toolbar OF cl_gui_alv_grid
IMPORTING e_object e_interactive,
To handle the buttons on the alv grid
handle_user_command
FOR EVENT user_command OF cl_gui_alv_grid
IMPORTING e_ucomm.
endclass.
Now Implement these methods.
CLASS lcl_event_receiver IMPLEMENTATION.
To handle the toolbar on alv
METHOD handle_toolbar.
DATA ls_toolbar TYPE stb_button.
CLEAR gs_toolbar.
MOVE 3 TO gs_toolbar-butn_type.
APPEND gs_toolbar TO e_object->mt_toolbar.
CLEAR gs_toolbar.
PERFORM icon_create USING 'ICON_INSERT_ROW' gs_toolbar-icon.
MOVE text-010 TO gs_toolbar-function.
MOVE text-012 TO gs_toolbar-quickinfo.
MOVE ' ' TO gs_toolbar-disabled.
APPEND gs_toolbar TO e_object->mt_toolbar.
CLEAR gs_toolbar.
PERFORM icon_create USING 'ICON_DELETE_ROW' gs_toolbar-icon.
MOVE text-011 TO gs_toolbar-function.
MOVE text-013 TO gs_toolbar-quickinfo.
MOVE ' ' TO gs_toolbar-disabled.
APPEND gs_toolbar TO e_object->mt_toolbar.
ENDMETHOD.
METHOD handle_user_command.
In this form, check the function code(e_ucomm has the function code), based on that do the required action.
as i said yesterday(i.e for appending a row, deleting a row, modifying a row)
PERFORM user_command USING e_ucomm.
ENDMETHOD
endclass.
Before calling the alv method, create a object of this class.
DATA :
gref_event_receiver TYPE REF TO lcl_event_receiver,
gv_tables_alv TYPE REF TO cl_gui_alv_grid.
CREATE OBJECT gref_event_receiver.
SET HANDLER gref_event_receiver->handle_user_command
FOR gv_tables_alv.
SET HANDLER gref_event_receiver->handle_toolbar
FOR gv_tables_alv.
check this program for event handling, it is the similar way
demo_abap_objects_events
Hope u understood this.
Regards,
Prasant
reward if helpful -
How to find newly updated rows in a table
Hi..
How to know newly updated rows in a table.
Thanks in advance
palOr other good thing would be to add LAST_UPDATED column to your table, that can reflect the time the row gets updated.
G -
Is there way to make rows of a grid component draggable or
interchangable on runtime?Hi,
Yes, Please refer the following link
http://www.sephiroth.it/file_detail.php?id=140
regards,
savneet
Maybe you are looking for
-
I keep getting an error message saying conversion failure when I try to convert a pdf to word format
-
WD ABAP : EMBED Internet PAGE Web on WebDynpro
Hi Experts, how can i embed an Internet Page (for exemple GOOGLE.COM) on my WebDynpro ABAP Application ... In order, i developped this code : data api_component type ref to if_wd_component. data window_manager type ref to if_wd_window_manager. d
-
Enough already with Voice Recorder's 1h limit, PLE...
I'm hoping this post will also be read by someone who works on the applications that are built-into Nokia phones. I have recently made extensive use of the voice recorder feature of my Nokia N85, and I was reminded how extremely inconvenient the arbi
-
Trying to parse out the number strings into its own columns with this expression: WITH T as (SELECT '53-2010-2-101' test_string FROM DUAL union all SELECT '2219-2010-3-22' FROM DUAL union all SELECT '236350-2010-4-3' FROM DUAL) SELECT SUBSTR(test_
-
When I open one of my sites in Muse I receive a message saying there are two Assets that need to be linked. Muse doesn't actually show me where these assets are though. How do I find them? Thanks! kt