How to retreive data from alv when using CL_GUI_ALV_GRID
Hi All,
I am using two subscreens to display 2 ALV grids in a screen using the OOPs concept and the class CL_GUI_ALV_GRID. I would like to download data from these two alv grids into an excel after any changes, i.e sort, filter or summation. I was able to capture data for sort and filter. The logic to capture summation and subtotals is becoming very complex. I need to simplify for better. I need help to see if there is any method which captures the changed data on the screen so that i can just call the method and retrieve the data to push into an internal table before downlaoding to excel.
Your help is greatly appreciated.
Thanks in advance.
Roopa
Step 1, define the method in class grid_hdr:
METHODS:handle_data_changed CHANGING e_valid TYPE c.
Step 2, process the method:
METHOD handle_data_changed.
CALL METHOD zgrid->check_changed_data
IMPORTING
e_valid = e_valid.
ENDMETHOD. "handle_data_changed
Step 3, use the method in PAI:
DATA l_valid TYPE c.
CALL METHOD grid_hdr->handle_data_changed
CHANGING
e_valid = l_valid.
IF l_valid = 'X'.
ENDIF.
Also you can search BCALV_EDIT_* in your system.
Edited by: SAM XIAO on Nov 17, 2009 8:03 AM
Similar Messages
-
How to select data from a table using a date field in the where condition?
How to select data from a table using a date field in the where condition?
For eg:
data itab like equk occurs 0 with header line.
select * from equk into table itab where werks = 'C001'
and bdatu = '31129999'.
thanks.Hi Ramesh,
Specify the date format as YYYYMMDD in where condition.
Dates are internally stored in SAP as YYYYMMDD only.
Change your date format in WHERE condition as follows.
data itab like equk occurs 0 with header line.
select * from equk into table itab where werks = 'C001'
and bdatu = <b>'99991231'.</b>
I doubt check your data base table EQUK on this date for the existince of data.
Otherwise, just change the conidition on BDATU like below to see all entries prior to this date.
data itab like equk occurs 0 with header line.
select * from equk into table itab where werks = 'C001'
and <b> bdatu <= '99991231'.</b>
Thanks,
Vinay
Thanks,
Vinay -
Incorrect link to "OS X: How to migrate data from another Mac using Mountain Lion and earlier". Should be http://support.apple.com/kb/HT6025
I think the OP is saying OS X: How to migrate data from another Mac using Mountain Lion and earlier (which should be a link to HT4889) just links back to OS X: How to migrate data from another Mac using Mavericks (HT5872).
It does indeed do that, & HT4889 seems to be MIA. -
How to retreive data from a maintainence view?
Hi all,
I have used select query to retreive data from a maintainence view. But it gave me a syntactical error that XYZ is not in abap dictionary , it's a database / projection view?
So can't we get data from a view using select query?
Please share if u have answers.
Thanks & regards,
ChandruHi,
Maintenance view will be created for database tables only.
Just display the maintainence from SE11 and click Tables tab in the screen
Here you can find the list of tables used to created for Maintainence view.
YOu can use these tables to write SELECT.
If you give us the maintainence table, we will help you.
Thanks,
Ramakrishna -
How to extract data from CRICKET MCS410CA using RS232
I need to extract data from CRICKET and use it for internal Localization of mobile robot.How to use the extracted data to form a map...
You seem to have the same exact project as someone else... http://forums.ni.com/t5/LabVIEW/cricket-integration/m-p/2052334
Hmmmmm.....
Some might think you're all in the same class.... -
Retreiving data from 2 tables using a sender JDBC Channel
Hi all,
We got anew requirement where we have to select data from 2 tables and update fields in 2 tables at the sametime.
I have a few queries regarding this.
Can we retrieve data from 2 tables using select query in sender JDBC channel?
If yes, how we can achieve this?
Can we use inner/outer joins in the select query?
Can we update field of 2 tables using the Update query in Sender JDBC channel?
Your help is greatly rewarded.
With Regards
Sudha.Hi,
Even i have the same requirement where data has to be read from 2 tables and later update the falg once done .
SELECT query :
SELECT t1.KUNNR,t1.SETT_KEY,t1.QUART_START,t1.QUART_END,t2.PAY_METH,t2.MAT_NDC,t2.AMOUNT FROM TSAP_REBATE_MEDI t1 INNER JOIN TSAP_REBATE_LINE t2 ON t1.KUNNR=t2.KUNNR AND t1.SETT_KEY=t2.SETT_KEY WHERE t1.PROCESSING_STATUS = 'N' AND t2.PROCESSING_STATUS = 'N'
This is working fine.
Can somebody help me with update query with this. where flag PROCESSING_STATUS has to be updated with 'P'.
I tried a lot but couldnt get the answer
Br,
Manoj -
How to Downlaod Data from Alv List to Excel File
Hi,
I have a Requirement like While download data from ALV to Excel File .After Download data into Excel we will not allow user to edit the Excel data..
Plz help me to complete this scenario.
Thanks & Regards,
Kumaran Duraiswamy.hi,
try these following fm's
MS_EXCEL_OLE_STANDARD_DAT
EXCEL_OLE_STANDARD_DAT
CALL FUNCTION 'MS_EXCEL_OLE_STANDARD_DAT'
EXPORTING
file_name = 'Your Path' " enter your path to save the file.
CREATE_PIVOT = 0
* DATA_SHEET_NAME = ' '
* PIVOT_SHEET_NAME = ' '
* PASSWORD = ' '
* PASSWORD_OPTION = 0
VISIBLE = '0'
No_DIALOG = 'X'
TABLES
* PIVOT_FIELD_TAB =
DATA_TAB = t_deli_final
* FIELDNAMES =
EXCEPTIONS
FILE_NOT_EXIST = 1
FILENAME_EXPECTED = 2
COMMUNICATION_ERROR = 3
OLE_OBJECT_METHOD_ERROR = 4
OLE_OBJECT_PROPERTY_ERROR = 5
INVALID_FILENAME = 6
INVALID_PIVOT_FIELDS = 7
DOWNLOAD_PROBLEM = 8
OTHERS = 9
IF sy-subrc 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
2nd fm
CALL FUNCTION 'EXCEL_OLE_STANDARD_DAT'
EXPORTING
FILE_NAME = 'Your Path' "path to save your file
DATA_SHEET_NAME = V_SHEET_NAME
TABLES
DATA_TAB = TLX
EXCEPTIONS
FILE_NOT_EXIST = 1
FILENAME_EXPECTED = 2
COMMUNICATION_ERROR = 3
OLE_OBJECT_METHOD_ERROR = 4
OLE_OBJECT_PROPERTY_ERROR = 5
INVALID_FILENAME = 6
INVALID_PIVOT_FIELDS = 7
DOWNLOAD_PROBLEM = 8
OTHERS = 9.
IF SY-SUBRC NE 0.
WRITE:/ 'ERROR OPENING EXCEL'.
ENDIF.
ELSE.
WRITE:/ 'ERROR OR NO DATA'.
ENDIF. -
JTable, how to read Data from it when enter is pressed
How to read Data from JTable on Return or lost focus from cell.
Also please tell me which listener I should should.
thx for helpYou should read the tutorial about tables, cell editors and models.
Also you should not [url http://forum.java.sun.com/thread.jsp?thread=472677&forum=57&message=2186815]crosspost
Mike -
How to retreive data from a table and a structure
Hi experts,
I have a requirement to create an ALV report. I have to include fields from two tables 'PA0001' and 'CATSDB' and from one structure 'CATSAPPR'. I am able to retrieve data from tables using INNERJOIN. But i have no idea how to deal with Structure.
I know that structure does not contain any data.
But i am not able to find any transparent table which has field 'ORDERTEXT' . I found field 'ORDERTEXT' only in structure 'CATSAPPR'.
So please anyone tell me, either any transparent table which has field 'ORDERTEXT' or please tell me how to deal with structure, in this case.
Please help me,
Thanks in advance
Anucheck this
Table-Fields Short descriptn
AUFK- KTEXT Order master data
COCH- KTXT Process Management: Control Recipe Header
COCHP- KTXT PI sheet: Control Recipe Header
COMPHDR- KTEXT OCM: Comparison results, indiv. records for order headers
HIKO- KTEXT Order master data history
MAAVC_MDO- KTEXT MPO: Individual Master Data for Orders
MCHPVS- AUFTEXT Batch Record: Shadow Table for Link to Archive
OCMHOMO_ARCH- KFELD Backup Table of Homogeneity List in Case of Archiving
PSJHIEDATA- KTEXT Hierarchy data to test LDB PSJ
TEWOCODEST- DESCRIPTION Order Codes (Texts)
TEWOCODET- KTEXT Allocation of Message Codes to Order
VLCSMORDER- KTEXT VELO : Service Order
VSAUFK_CN- KTEXT Version: Order master data
Yogesh N -
How to retreive data from the column of CLOb dataype in BPEL.
Hello Everyone,
I have a scenario in which i have two databses primary and secondary. In first bpel process i am checking if primary database is down then store the payload in temp staging table in secondary database. That payload is getting stored in a cloumn of CLOB datatype in a text format.
Now in second bpel process when primary is up i have to pull the data from the temp staging table...but here i want the data in the same format (like it came in the first process...the input payload format)....but as the CLOB will store the data as a text then how to reform that data in to ealier payload format.
Can any one pls suggest me the solution...
ThanksConfirm that you have the VISA Run Time Engine on the target machine. If you do not have it installed, you can install the VISA Run Time Engine from ni.com.
Error -1073807346 Using VISA When Running LabVIEW Executable On Target Computer
Message Edited by Mathan on 10-12-2009 07:11 AM -
How to Select Data from different Tables Using Linq
Hi,
I have two different tables, I just want to collect data from tables using Linq to SQL Queries.
The tables looks like This
ID Name ImageUrl
Other Table is
ID EmpID CheckInTime CheckOutTime
What I want to Collect data from CheckInTime and want to place it in a that is in a list view
Same thing I want to do it for CheckOutTime And One thing I want to tell is both tables are joined by a FK EmpID with ID.
What Are the suggestions for me
I have Used this code
var data = from emp in db.Employees
join chk in db.CheckInCheckOuts on emp.ID equals chk.EmpID
select new EmployeeCheckInOut
Name = emp.Name,
ImageUrl = emp.ImageUrl,
CheckIn = emp.CheckInCheckOuts,
CheckOut = emp.CheckInCheckOuts
Here the CheckInCheckOuts is another table, I don't how do I access fields of the Other table "CheckInCheckOuts"
Thank you
AliMitja,
Kind of Tables, I don't Know but I can Tell you that these are Two table, first Table Have Data in It, Name, ImageUrl I have filled this table with names and ImageUrls And are string type.Other Table is for the CheckInTime And CheckOutTime of the employee.
What I need that when I click on the Image button it Should displays The Current Datetime into the label below the Image button.
So I have Problem accessing my CheckInCheckOut Table because I may not have Idea about.Did you understand what I need to do, if you have more question please ask to me.
Thanks
Ali -
Retreiving data from external DB using cursors (Native SQL)
Hi experts,
Iu2019m trying to use some functionality based on the Native SQL on an Oracle Server. Iu2019m facing some difficulties using cursors and fetching data from the external database.
Basically the synonym its zfisicc_c_dblink, and Iu2019m running the for the following code:
TRY.
OPEN CURSOR WITH HOLD c1 FOR SELECT *
FROM zfisicc_c_dblink
WHERE estado_sif = 'I'.
CATCH cx_sql_exception INTO sqlerr_ref.
PERFORM handle_sql_exception USING sqlerr_ref.
ENDTRY.
DO.
* "Move the data from the Cursor into the target area.
FETCH NEXT CURSOR c1 APPENDING TABLE tab.
IF sy-subrc 0.
EXIT.
ENDIF.
ENDDO.
CLOSE CURSOR c1.
The cursor C1 it's cursor type and the table tab it's ZFISICC_C_DBLINK type, but every time i run it it's giving me the ORA-932 error.
Database error text........: "ORA-00932: inconsistent datatypes: expected %s
got %s"
Can anyone help me on this error? What Iu2019m doing wrong when fetching the data ?
Another doubt that Iu2019ve it's when using pl/Sql procedure. Can anyone tell how I can retrieve data from the external database with the following code?
**Select Directo com Cursor
EXEC SQL.
CONNECT TO :gv_db_name AS 'dblink_con'
ENDEXEC.
IF sy-subrc NE 0.
WRITE: 'Não foi possível fazer a ligação à DBCON: ', gv_db_name.
ELSE.
EXEC SQL.
DECLARE CURSOR c_1 IS SELECT tipo_operacao FROM movimento_contribuicao
WHERE ROWNUM <= 10000;
wa movimento_contribuicao.tipo_operacao%type;
BEGIN
OPEN c_1;
LOOP
FETCH c_1 INTO wa; "Not able to return data to SAP system
EXIT WHEN c_1%NOTFOUND;
END LOOP;
END;
ENDEXEC.
EXEC SQL.
DISCONNECT 'dblink_con'
ENDEXEC.
ENDIF.
On the FETCH c_1 INTO wa; code Iu2019m moving the data to an Oracle variable, wa movimento_contribuicao.tipo_operacao%type;, and not to an program variable. Can anyone explain me this how this is +possible using this PL/SQL procedure?
Thanks in advance,
Best Regards
João Martins
Edited by: Rob Burbank on May 7, 2010 10:25 AMHi Joao,
Regarding your first question: It looks like there's a conversion problem (with one or more columns) from your Oracle table to your ABAP internal table.
In the following link you can see (in your case in the SELECT section) the type conversions used for each type combination.
Some combinations lead to an oracle error (specified in the "Result" column), like in your case (error 932).
http://help.sap.com/saphelp_470/helpdata/EN/a3/74caa1d9c411d1950e0000e8353423/content.htm
Regarding your second question: You can use the PERFORMING addition in the EXEC SQL statement.
You can see an example in the following link:
http://help.sap.com/saphelp_470/helpdata/EN/fc/eb3b8b358411d1829f0000e829fbfe/content.htm
Hope it helps.
Regards,
Ana Luisa. -
No data in ALV when using MC_STYLE_ENABLED
Hi experts,
I want to display some data in a ALV-Grid control, with just one column which is editable. So the ALV-Grid looks well, when I only display the data. But when I add the attributes for the editable column into my internal table, then I cannot see any data in there. But I can see the rows with the editable column.
Here are the operations:
1) All items of an transparent table is viewed in the ALV-LIST1
2) User can select the specific rows which he/she want to edit.
3) User press a button in the toolbar of ALV-LIST1
4) The ALV-LIST2 comes up with the selected rows and one editabled column, but no data in there...
I already looked in this great example, but I cannot see any special command, posted here:
editing alv output
I also looked in the examples of BCALV_EDIT_0*.
Here is the code:
Definitions:
The method for creating the second ALV-Grid
METHOD create_alv_list2.
DATA: ls_selected_line TYPE lvc_s_row,
lf_row_index TYPE lvc_index,
lt_celltab TYPE lvc_t_styl,
ls_celltab TYPE lvc_s_styl,
l_index TYPE i,
lt_exclude TYPE ui_functions
IF container23 is initial.
CREATE OBJECT container23
EXPORTING container_name = 'LIST_AREA2'
EXCEPTIONS
cntl_error = 1
cntl_system_error = 2
create_error = 3
lifetime_error = 4
lifetime_dynpro_dynpro_link = 5.
IF sy-subrc <> 0.
CALL FUNCTION 'POPUP_TO_INFORM'
EXPORTING
titel = g_repid
txt2 = sy-subrc
txt1 = 'Control element couldn't be created'(510).
ENDIF.
CREATE OBJECT alv_list2
EXPORTING i_parent = container23.
ELSE.
CALL METHOD alv_list2->refresh_table_display.
ENDIF. "IF container23 IS INITIAL.
* Layout
g_lvc_layout-grid_title = 'Edit the rows'.
g_lvc_layout-sel_mode = ' '.
g_lvc_layout-stylefname = 'CELLTAB'.
CLEAR: lt_celltab,
wa_lab_dispo2,
it_lab_dispo2,
wa_lab_dispo3,
it_lab_dispo3
* catch all selected rows from ALV-Grid1
CALL METHOD alv_list1->get_selected_rows
IMPORTING et_index_rows = it_lvc_rows.
* write the lines into the it_lab_dispo3
LOOP AT it_lvc_rows INTO ls_selected_line.
lf_row_index = ls_selected_line-index.
READ TABLE it_lab_dispo INDEX lf_row_index INTO wa_lab_dispo.
wa_lab_dispo3-lab_dispo_struk = wa_lab_dispo.
APPEND wa_lab_dispo3 TO it_lab_dispo3.
ENDLOOP.
CLEAR: wa_lab_dispo3.
* make the cell XBEME editable
LOOP AT it_lab_dispo3 INTO wa_lab_dispo3.
l_index = sy-tabix.
ls_celltab-FIELDNAME = 'XBEME'.
ls_celltab-STYLE = CL_GUI_ALV_GRID=>MC_STYLE_ENABLED.
ls_celltab-STYLE2 = SPACE.
ls_celltab-STYLE3 = SPACE.
ls_celltab-STYLE4 = SPACE.
INSERT ls_celltab INTO TABLE lt_celltab.
INSERT LINES OF lt_celltab INTO TABLE wa_lab_dispo3-celltab.
MODIFY it_lab_dispo3 FROM wa_lab_dispo3 INDEX l_index TRANSPORTING celltab.
ENDLOOP.
CALL METHOD alv_list2->set_ready_for_input
EXPORTING i_ready_for_input = 1.
PERFORM exclude_tb_functions CHANGING lt_exclude.
* display the second grid
CALL METHOD alv_list2->set_table_for_first_display
EXPORTING i_structure_name = 'zmm_lab_dispo'
i_save = 'A'
it_toolbar_excluding = lt_exclude
is_layout = g_lvc_layout
CHANGING
it_outtab = it_lab_dispo3[]
CALL METHOD cl_gui_control=>set_focus
EXPORTING control = alv_list2.
CALL METHOD cl_gui_cfw=>flush.
IF sy-subrc <> 0.
CALL FUNCTION 'POPUP_TO_INFORM'
EXPORTING
titel = g_repid
txt2 = sy-subrc
txt1 = 'Error in Flush ALV'(500).
ENDIF.
ENDMETHOD.
<b>If I follow my coding by processing the application, I could see that in the Method "SET_VALUES (CL_ALV_VARIANT)" which was executed by "CALL METHOD alv_list2->set_table_for_first_display" the table "it_outtab" is just filled with the data of my selected rows!
And after this Method their called "FUNCTION K_KKB_PUT_GLOBALS" which has only one command: </b>
create data gs_table_row like es_table_row.
<b>And the gs_table_row has the needed deep-structure.
After it i cannot see any really intressting backend-functions related to my Problem.
</b>
I also try to do something with the fieldcatalog but in this case I only could add columns to the existing table which was editable.
Regards,
SteffenHi Steffen,
Just give the name in capital letters and try:
display the second grid
CALL METHOD alv_list2->set_table_for_first_display
EXPORTING i_structure_name = <b>'ZMM_LAB_DISPO'</b>
i_save = 'A'
it_toolbar_excluding = lt_exclude
is_layout = g_lvc_layout
CHANGING
it_outtab = it_lab_dispo3[]
REgards,
Ravi -
How to open document from mac when using windows without transferring the file?
How can i open a document from mac when i am using windows without transferring it?
depend on the document program more then anything else really
when ever I open a doc with word it make a history for undo and redo action file in the same dir
with bootcamp you only have read not write access to the osx partition so it would fail to be able to create that file
but if you can get word or whatever program you use to open the file not to place a temp file in the same dir
or use a program which did not make any type of temp file or used a program where the temp file would be located elsewhere where you decide it would work file -
How to Retreive data from custom list on specify conditions?
Hi All,
I have custom list.And the custom list data contains 100 rows of data.
my requirement is how to retrieve custom list data from specific condition like 20-30,50-70.
Assume that i want to fetch 20 record to 30th record.
How to use the caml query for the above situation.
Please assist me.
RamaHi
Thanks for posting your issue, Kindly browse the below mentioned URL to find related the CAML query example
http://karinebosch.wordpress.com/2012/02/03/caml-and-the-client-object-model/
I hope this is helpful to you, mark it as Helpful.
If this works, Please mark it as Answered.
Regards,
Dharmendra Singh (MCPD-EA | MCTS)
Blog : http://sharepoint-community.net/profile/DharmendraSingh
Maybe you are looking for
-
Based on http://forums.adobe.com/thread/1308132?tstart=0 I decided to add each question seperately: Hello, I'm quite interested in buying Lightroom 5.2. I tried the RC which ran out now. Yet, I have a several questions that I can't really find good c
-
Calendar Sync Issue With repeating entry deletions Notes 8.5 to BB
I have an issue where when synchronizing may calendar with Lotus Notes version 8.5, the Blackberry will delete repeating entries. Specifically, if I load the Blackberry with all my calendar entries from Notes and then in one entry in my Notes calenda
-
How to save a web site to the top site page
how do you save a web site to the top site page
-
Mpeg goes "black" on full screen
I have just bought quicktime pro to enable me to view in full screen mode. The videos play perfectly in small screen but when full screen is selected only a black screen is displayed even though the video seems to still be playing. Codecs seem to be
-
Problem when install driver for DKU-5 cable
After installing driver for DKU-5 cable follow guide line, i conected DKU-5 cable with my computer but there is error appear that is 'can not pass winxp logo testing'.So i can not complete install driver for DKU-5 cable.Please help me.Thanks.