Physical Sort on Table data
Is there a way to sort the records of a table physically?
The order by clause does a logical sort on the table data that is temporary.
Can we sort the records permanently?
In my environment your query is using a [ INDEX FAST FULL SCAN :|http://download.oracle.com/docs/cd/B19306_01/server.102/b14211/optimops.htm#i52044] which is not guaranteed to follow physical ordering:
>
It cannot be used to eliminate a sort operation, because the data is not ordered by the index key. It reads the entire index using multiblock reads, unlike a full index scan, and can be parallelized.
>
SQL> select * from v$version;
BANNER
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Prod
PL/SQL Release 10.2.0.1.0 - Production
CORE 10.2.0.1.0 Production
TNS for Linux: Version 10.2.0.1.0 - Production
NLSRTL Version 10.2.0.1.0 - Production
SQL>
SQL> drop table test_iot;
Table dropped.
SQL>
SQL> create table test_iot(sq number primary key, txt varchar2(20))
2 organization index;
Table created.
SQL>
SQL> insert into test_iot
2 select rownum , to_char(rownum,'Fm000000')||'#'||dbms_random.random
3 from dba_objects where rownum < 1001;
1000 rows created.
SQL>
SQL> exec dbms_stats.gather_table_stats(ownname => user, tabname => 'TEST_IOT', cascade => TRUE);
PL/SQL procedure successfully completed.
SQL>
SQL> explain plan for select * from test_iot;
Explained.
SQL> select * from table(dbms_xplan.display);
PLAN_TABLE_OUTPUT
Plan hash value: 2167072184
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
| 0 | SELECT STATEMENT | | 1000 | 21000 | 3 (0)| 00:00:01 |
| 1 | INDEX FAST FULL SCAN| SYS_IOT_TOP_52896 | 1000 | 21000 | 3 (0)| 00:00:01 |
8 rows selected.Since DBMS_ROWID cannot be used on a IOT, I'm not sure that a SQL query can prove that IOT guarantees physical ordering.
Similar Messages
-
Problem in sorting of table data
Hi all,
I had gone through the PDF given (Developing with tables in webdynpro).
i got struck in creating TableSorter.java file...
can any one tell me how to create that java file in my project and how to send the colum which i want to sort to TableSorter.java
Regards
PadmaTo implement it ,create a value attribute say "sorter" of java native type
com.sap.tc.webdynpro.tests.utils.TableSorter. (The package name MIGHT be different.)
In wdDoModifyView,obtaine a refernce to the table objject like
table = (IWDTable)view.getElement("table ui name);
and use
wdContext.currentContextElement().setSorter(
new TableSorter(table, wdThis.wdGet
<action name for sort>Action(), null));
Now inside that action handler,
wdContext.currentContextElement().getTableSorter().sort(wdEvent,
wdContext.node<nodename>());
also chk it
Re: Sort a table
sort table columns
Table Sorting ( In Case Insensitive order)
null -
Dear Guru's
Can you please advice me how I can sort the table data in Adobe Interactive form.
Thanks!
Surya.Hi,
In the context area , Double click on the table.
In the bottom area u can see the properties tab....
In that go to control levels tab where u cna set the sorting on the basis of a particular field.
Please let me know if you find any issue.
Regards,
sasi -
Input table sort for uncommited data
Hi OTN,
I have an input table on my ADF page. The table is based on a view object which has ORDER BY VALUE clause.
There is an opportunity to insert new rows and edit Value attribute of any row.
I would like the table always to be sorted by Value attribute before commiting the changes.
Input fields have autosubmit=true and I also have button which performs ADFUtils.findIterator(..).executeQuery() and refreshing the table (with addPartialTarget or table's partial trigger).
Besides I tried declarative column sorting.
By no means I succeeded to sort the table with new values without commiting data.
Is there any possibility to do this?
Thanks.
JDev 11.1.1.4Hi,
After applying this code in a managed bean System.out.println("ViewObject.QUERY_MODE_SCAN_DATABASE_TABLES | ViewObject.QUERY_MODE_SCAN_VIEW_ROWS");
trIter.getViewObject().setQueryMode(ViewObject.QUERY_MODE_SCAN_DATABASE_TABLES | ViewObject.QUERY_MODE_SCAN_VIEW_ROWS);
trIter.getViewObject().setSortBy("NEnd");
trIter.executeQuery();in-memory sorting really works.
But now I have a row with null NEnd first in my table. Without modifying query mode it was last just as I need.
It is now:null
10
20
30Can I bring null row back to last position?
Tried trIter.getViewObject().setSortBy("NEnd nulls last"); and trIter.getViewObject().setSortBy("deocde(NEnd, null, 9999, NEnd)"); with no success.
Edited by: ILya Cyclone on Jul 8, 2011 3:28 PM -
30EA2 - SQL-Developer 3.0.02 Another Table Data Sort Order Bug
Although the "30EA1 - SQL-Developer 3.0.02 Table Data Sort Order Bug" still exists in 30EA2, there is a new substantial mistake.
How to see it:
Open table1 (Preference "Automatically Freeze Object Viewer Windows" is set). Click data.
Open table2. Click data.
Go back to table1. Click Sort. => You see the columns of table2. The is no way to sort table1, before you close the table2 window (tab).
Edited by: oestreicher1 on 01.12.2010 04:54Logged Bug 10358797 - ea2: grid sorter shows wrong columns
-Raghu -
Sorting internal table by date
Hello experts,
i wat to sort internal table in asscending order and am using the code as follows,
APPEND wa_final TO it_final.
sort it_final by edatu vbeln ASCENDING.
am getting output as 05.09.2008
10.09.2008
27.08.2008
but i want in 27.08.2008
05.09.208
10.09.2008
please help me ASAP.
Thanks,
vino....Hi
I think you uploaded date field as your output format. If it is in ddmmyyyy format, when you sort it, automatically it will sort. Check your input entries.
Otherwise, what you had written is correct.
check your code
Regards,
Dhanunjaya Reddy. -
Sort a Table with data extracted form Another table
I have a MAster Table that consist of many columns of data. I have extracted data (rows) from the table to another table for a list. I used vlookup to get the extracted data. In my new table everything is list ed out perfectly. I want to sort the table using one of the columns. I tried the reorganize button and just sorting on that one column and it won't sort. I know I'm doing something wrong whether the way I am extracting the data,or something else. Do I use lookup and large or small function to list and sort it from the main table? I stumped. Anybody have sugestions?
Hi tj,
"The Master file is the second image. I have extracted the data for the second table(second image). "
Hmmm...
Both tables are the second image. Good trick!
Good thing you included the description.
The (modified) Master table is Table 1 on Sheet 15. From this, you are extracting the participants for "R & B Winter Sk8 Jam. You want the extracted rows to be displayed on the Contestant Sheet table sorted by Division.
I see two possible lines of attack here:
The simplest might be to presort the Master table on Division, then within that sort, on last name, then on first name. With the Master table in that order, extracting the data using the index you are currently using should pull the rows in the desired order.
Construct an index of numerical values constructed from the sum of:
-- a very large number corresponding to the event, pulled from a Lookup table.
-- a large numbers corresponding to the division, pulled from a second Lookup table.
-- a small number corresponding to he count (from the top of the main tale to the current row) of Sk8ers entered in each event. (This, I think, would be the same as the count in your Index column.)
Retrieval would be done using RANK to determine the smallest and largest index values to retrieve, and SMALL to collect data from the rows with index values within that range.
No. 2 is at the concept stage, and is open to anyone wanting to give it a go.
Regards,
Barry -
Hi all,
I have populated an index_by binary_integer pl/sql table :
declare
type rec_ty is record(ligne number,code_enreg number(2),code_enreg_ordered number(2));
type tab_ty is table of rec_ty index by binary_integer;
vtab tab_ty;
i pls_integer := 1;
begin
for venreg in(select * from fichier_tempo where num > 0 order by num) loop
vtab(i).ligne := venreg.num;
vtab(i).code_enreg := to_number(substr(venreg.texte,7,2));
i := i + 1;
end loop;
end;
Now I want to sort the code_enreg data of vtab into its code_enreg_ordered field. I must do that because I must verify that each code_enreg data entered are ordered. So if code_enreg is not equal to code_enreg_ordered at a specified index of vtab then I must take a decision in my program code ; I must code something when this disorder happens.
How to do that ?
Thank you very much indeed.Thank you Jeneesh , it works with a few modifications about the assignement of the pl/sql tables.
Fantasy > Your blog talks about sorting the pl/sql table through the key. But I want to sort it through the field data. And my field data contains duplicated data. So you did not really reply to my need. Thank you anymore. -
How to re-sort Table data like A-Z and Z-A
Hello Gurus,
How can i re-sort Table data based on last name or first name, once table filled data from backend(i mean, once executed RFC, Table will be filled with data records, after that i want to re-sort table).
Can you provide me code, how to do?
Thanks
Venkat.Hi Venkat,
For sorting to table columns, you need to pick up the code from here and add into a java file within your development component.
http://wiki.sdn.sap.com/wiki/display/Snippets/TableSorterClassfor+WebDynpro
Then, you can call the constructor of the class and pass the arguments to enable table sorting in your code.
Refer to following blog for execution
http://www.sdn.sap.com/irj/scn/weblogs;jsessionid=(J2EE3417100)ID1078501850DB00490474849923920126End?blog=/pub/wlg/3287
Let me know, if the problem persists.
Regards,
Tushar Sinha -
Table EABL Question SORT with reading date ADATTATS and ADAT
Hi all,
I have selction criteria to qery EABL.
After select ,i have to sort to get latest 10 records from EABL .
I was told if the value of ADATTATS is null ,i should display ADAT .
But to select latest 10 records i have need to sort based upon date field..IF date field is null i will not get sort in proper descending order......
Any suggestions and help ?
display :for a partcular contract account
Current meter reading date 1
previous meter reading date 2
previous meter reading date 3
Is there any other field in this table EABL which could be used for SORT here for this display.
Thanks in advance...
Edited by: Sona on Feb 26, 2008 7:29 PMYes,
My case is :
ADATTATS
record1 : date1
date2
null
null
record5 : date5
ADAT
record1 : 0
0
date3
date4
record5 : 0
Result is :
date1
date2
date3
date4
date5
I was told only if date is null in ADATTATS i should go for ADAT.(that means only then value will be in ADAT)The majority of the time there will be a date in ADATTATS. If an estimate or manual MR is entered, the date will come from ADAT.
My test table has all null values in ADATTATS ,i hv values only in ADAT in test table.
Another question :
Can we change the data in test tables ?
Testing process to check the billing run ?what r the steps involved ? -
Can we delete the archived RS tables data in unix path?
Hi Experts
As you all know that when we perform RS table archiving we setup a Logical file path 'ARCHIVE_GLOBAL_PATH' pointing to the physical path '/usr/sap/<SYSID>/SYS/global/<FILENAME>' in unix system.
Here we have our RS table data in the unix path and this logical path will make sure that there are no problems with requests status.
Now our unix path has grown in size hence we would like to delete some archived data from this path. Could you pls confirm if we delete the data from this unix path will there be any problems with the requests status?
Simply can we delete the RS table archived data from the unix file path??
Thanks!!Hi All
Any idea about this would be appreciated.
Thanks!! -
Issue with value of transient attribute after filtering or sorting a table
Hi guys,
i'm using jdev 11.1.1.4.0 .
i've the use case :
- a table with a column containing a checkbox to mark the selection of a row
<af:column align="center" sortProperty="TemIsChosen" filterable="true"
sortable="true" id="c6">
<af:selectBooleanCheckbox value="#{row.bindings.TemIsChosen.inputValue}" autoSubmit="true"
shortDesc="#{bindings.ServersIndicTempVVO.hints.TemIsChosen.tooltip}"
id="sbc1"
valueChangeListener="#{backing_initIndicatorsTemp.onSelectTemp}"/>
</af:column>
- i select one or more rows with checkboxes
- if i filter or sort the table, the selection of the checkboxes reset to not selected (value false by default).
I understand that for the framework, it's a normal behavior because for filtering or sorting , it re-executes the query from database. And transient attribute is not persistent, so it goes back to the default initial value "false".
What i would appreciate, it's that filtering or sorting has no effect on the value of the transient attribute, ie end user selection remains.
I tried to modify query mode of the ViewObject to filter with in-memory data. It works fine but if you reset filter inputs you can't retrieve correct RowSet. Only new RowSet is stored, old is lost.
So now it's the filtering feature that doesn't work as expected.
How can i implement my use case withouth the troubles i've described.
Best regards,
DavidHi Frank,
no it's a view object level attribute inside a read-only view object.
The view object doesn't use any entity.
Here is the definition of the attribute in the xml file of the VO, if can help you :
<ViewAttribute
Name="TemIsChosen"
IsSelected="false"
IsPersistent="false"
PrecisionRule="true"
Type="java.lang.Boolean"
ColumnType="BIT"
AliasName="VIEW_ATTR"
SQLType="BIT"
Passivate="true">
<Properties>
<SchemaBasedProperties>
<TOOLTIP
ResId="ADD"/>
<DISPLAYWIDTH
Value="50"/>
</SchemaBasedProperties>
</Properties>
</ViewAttribute>
David -
Hi
I have a requirement of writing internal table data to XML. Any idea where i should start.
I have pretty good experience with ABAP and basic knowledge in XML.
There are good blogs which talk about transformations and other stuff but they are not able to give me clear path to my solution.
Could somebody give me a basic example or some reference material where i can move the data in internal table (assume Sales order details of a day) to XML.
ThanksRefer the program -
In this implementation we will only focus on the creation of the XML file and the transfer to the user. You can not create a XML document directly. You have to use a so called ixml factory first.
TYPE-POOLS: ixml.
DATA: l_ixml TYPE REF TO if_ixml.
l_ixml = cl_ixml=>create( ).
This iXML factory can create an empty XML document object named l_document.
DATA: l_document TYPE REF TO if_ixml_document.
l_document = l_ixml->create_document( ).
At this point you can add the nodes (elements, attributes) into the document. First you have to declare the root element node.
DATA: l_element_root TYPE REF TO if_ixml_element.
This node we have to give a name and add it (create_simple_node) to the document object l_document, which will be the parent of this node.
l_element_root = l_document->create_simple_element(
name = 'flights'
parent = l_document ).
Next we can add child nodes to there parent node using the same method of the document object.
DATA: l_element_airline TYPE REF TO if_ixml_element,
l_element_airline = l_document->create_simple_element(
name = 'airline'
parent = l_element_root ).
An attribute can be add easily using the method set_attribute of the element node.
l_rc = l_element_airline->set_attribute( name = 'code' value = 'LH401' ).
Now we have finished the document object. Regretfully it can not be displayed in any form due to the fact that it is a binary object.
The next step is to convert the created document to a flat file. To achieve this we have to create a stream factory, which will help us to create an output stream.
DATA: l_streamfactory TYPE REF TO if_ixml_stream_factory.
l_streamfactory = l_ixml->create_stream_factory( ).
In this case, we will convert the document into an output stream which is based on an internal table of type x.
TYPES: BEGIN OF xml_line,
data(256) TYPE x,
END OF xml_line.
DATA: l_xml_table TYPE TABLE OF xml_line,
l_xml_size TYPE i,
l_rc TYPE i,
l_ostream TYPE REF TO if_ixml_ostream.
l_ostream = l_streamfactory->create_ostream_itable( table = l_xml_table ).
When we have created the output stream we can do the rendering from the document into the stream. The XML data will be stored in the internal table automatically.
DATA: l_renderer TYPE REF TO if_ixml_renderer.
l_renderer = l_ixml->create_renderer( ostream = l_ostream
& nbsp; document = l_document ).
l_rc = l_renderer->render( ).
In the last step we upload the file to the sapgui
l_xml_size = l_ostream->get_num_written_raw( ).
CALL METHOD cl_gui_frontend_services=>gui_download
EXPORTING
bin_filesize = l_xml_size
filename = 'c:\temp\flights.xml'
filetype = 'BIN'
CHANGING
data_tab = l_xml_table
EXCEPTIONS
OTHERS = 24.
This finished the first step-of-three. As mentioned before the next log will focus on the conversion from xml files (back) to abap tables.
REPORT z_xit_xml_dom_create.
TYPE-POOLS: ixml.
TYPES: BEGIN OF xml_line,
data(256) TYPE x,
END OF xml_line.
DATA: l_ixml TYPE REF TO if_ixml,
l_streamfactory TYPE REF TO if_ixml_stream_factory,
l_ostream TYPE REF TO if_ixml_ostream,
l_renderer TYPE REF TO if_ixml_renderer,
l_document TYPE REF TO if_ixml_document.
DATA: l_element_flights TYPE REF TO if_ixml_element,
l_element_airline TYPE REF TO if_ixml_element,
l_element_flight TYPE REF TO if_ixml_element,
l_element_from TYPE REF TO if_ixml_element,
l_element_to TYPE REF TO if_ixml_element,
l_element_dummy TYPE REF TO if_ixml_element,
l_value TYPE string.
DATA: l_xml_table TYPE TABLE OF xml_line,
l_xml_size TYPE i,
l_rc TYPE i.
DATA: lt_spfli TYPE TABLE OF spfli.
DATA: l_spfli TYPE spfli.
START-OF-SELECTION.
Fill the internal table
SELECT * FROM spfli INTO TABLE lt_spfli.
Sort internal table
SORT lt_spfli BY carrid.
Start filling xml dom object from internal table
LOOP AT lt_spfli INTO l_spfli.
AT FIRST.
Creating a ixml factory
l_ixml = cl_ixml=>create( ).
Creating the dom object model
l_document = l_ixml->create_document( ).
Fill root node with value flights
l_element_flights = l_document->create_simple_element(
name = 'flights'
parent = l_document ).
ENDAT.
AT NEW carrid.
Create element 'airline' as child of 'flights'
l_element_airline = l_document->create_simple_element(
name = 'airline'
parent = l_element_flights ).
Create attribute 'code' of node 'airline'
l_value = l_spfli-carrid.
l_rc = l_element_airline->set_attribute( name = 'code' value = l_value ).
Create attribute 'name' of node 'airline'
SELECT SINGLE carrname FROM scarr INTO l_value WHERE carrid EQ l_spfli-carrid.
l_rc = l_element_airline->set_attribute( name = 'name' value = l_value ).
ENDAT.
AT NEW connid.
Create element 'flight' as child of 'airline'
l_element_flight = l_document->create_simple_element(
name = 'flight'
parent = l_element_airline ).
Create attribute 'number' of node 'flight'
l_value = l_spfli-connid.
l_rc = l_element_flight->set_attribute( name = 'number' value = l_value ).
ENDAT.
Create element 'from' as child of 'flight'
CONCATENATE l_spfli-cityfrom ',' l_spfli-countryfr INTO l_value.
l_element_from = l_document->create_simple_element(
name = 'from'
value = l_value
parent = l_element_flight ).
Create attribute 'airport' of node 'from'
l_value = l_spfli-airpfrom.
l_rc = l_element_from->set_attribute( name = 'airport' value = l_value ).
Create element 'to' as child of 'flight'
CONCATENATE l_spfli-cityto ',' l_spfli-countryto INTO l_value.
l_element_to = l_document->create_simple_element(
name = 'to'
value = l_value
parent = l_element_flight ).
Create attribute 'airport' of node 'from'
l_value = l_spfli-airpto.
l_rc = l_element_to->set_attribute( name = 'airport' value = l_value ).
Create element 'departure' as child of 'flight'
l_value = l_spfli-deptime.
l_element_dummy = l_document->create_simple_element(
name = 'departure'
value = l_value
parent = l_element_flight ).
Create element 'arrival' as child of 'flight'
l_value = l_spfli-arrtime.
l_element_dummy = l_document->create_simple_element(
name = 'arrival'
value = l_value
parent = l_element_flight ).
Create element 'type' as child of 'flight'
CASE l_spfli-fltype.
WHEN 'X'.
l_value = 'Charter'.
WHEN OTHERS.
l_value = 'Scheduled'.
ENDCASE.
l_element_dummy = l_document->create_simple_element(
name = 'type'
value = l_value
parent = l_element_flight ).
ENDLOOP.
IF sy-subrc NE 0.
MESSAGE 'No data into db table ''spfli'', please run program ''SAPBC_DATA_GENERATOR'' with transaction ''SA38''' TYPE 'E'.
ENDIF.
Creating a stream factory
l_streamfactory = l_ixml->create_stream_factory( ).
Connect internal XML table to stream factory
l_ostream = l_streamfactory->create_ostream_itable( table = l_xml_table ).
Rendering the document
l_renderer = l_ixml->create_renderer( ostream = l_ostream
document = l_document ).
l_rc = l_renderer->render( ).
Saving the XML document
l_xml_size = l_ostream->get_num_written_raw( ).
CALL METHOD cl_gui_frontend_services=>gui_download
EXPORTING
bin_filesize = l_xml_size
filename = 'c:\temp\flights.xml'
filetype = 'BIN'
CHANGING
data_tab = l_xml_table
EXCEPTIONS
OTHERS = 24.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
<?xml version="1.0"?>
<flights>
<airline code="AA" name="American Airlines">
<flight number="0017">
<from airport="JFK">NEW YORK,US</from>
<to airport="SFO">SAN FRANCISCO,US</to>
<departure>110000</departure>
<arrival>140100</arrival>
<type>Scheduled</type>
</flight>
<flight number="0064">
<from airport="SFO">SAN FRANCISCO,US</from>
<to airport="JFK">NEW YORK,US</to>
<departure>090000</departure>
<arrival>172100</arrival>
<type>Scheduled</type>
</flight>
</airline>
<airline code="AZ" name="Alitalia">
<flight number="0555">
<from airport="FCO">ROME,IT</from>
<to airport="FRA">FRANKFURT,DE</to>
<departure>190000</departure>
<arrival>210500</arrival>
<type>Scheduled</type>
</flight>
<flight number="0788">
<from airport="FCO">ROME,IT</from>
<to airport="TYO">TOKYO,JP</to>
<departure>120000</departure>
<arrival>085500</arrival>
<type>Scheduled</type>
</flight>
<flight number="0789">
<from airport="TYO">TOKYO,JP</from>
<to airport="FCO">ROME,IT</to>
<departure>114500</departure>
<arrival>192500</arrival>
<type>Scheduled</type>
</flight>
<flight number="0790">
<from airport="FCO">ROME,IT</from>
<to airport="KIX">OSAKA,JP</to>
<departure>103500</departure>
<arrival>081000</arrival>
<type>Charter</type>
</flight>
</airline>
<airline code="DL" name="Delta Airlines">
<flight number="1984">
<from airport="SFO">SAN FRANCISCO,US</from>
<to airport="JFK">NEW YORK,US</to>
<departure>100000</departure>
<arrival>182500</arrival>
<type>Scheduled</type>
</flight>
<flight number="1699">
<from airport="JFK">NEW YORK,US</from>
<to airport="SFO">SAN FRANCISCO,US</to>
<departure>171500</departure>
<arrival>203700</arrival>
<type>Scheduled</type>
</flight>
<flight number="0106">
<from airport="JFK">NEW YORK,US</from>
<to airport="FRA">FRANKFURT,DE</to>
<departure>193500</departure>
<arrival>093000</arrival>
<type>Scheduled</type>
</flight>
</airline>
<airline code="JL" name="Japan Airlines">
<flight number="0407">
<from airport="NRT">TOKYO,JP</from>
<to airport="FRA">FRANKFURT,DE</to>
<departure>133000</departure>
<arrival>173500</arrival>
<type>Scheduled</type>
</flight>
<flight number="0408">
<from airport="FRA">FRANKFURT,DE</from>
<to airport="NRT">TOKYO,JP</to>
<departure>202500</departure>
<arrival>154000</arrival>
<type>Charter</type>
</flight>
</airline>
<airline code="LH" name="Lufthansa">
<flight number="2407">
<from airport="TXL">BERLIN,DE</from>
<to airport="FRA">FRANKFURT,DE</to>
<departure>071000</departure>
<arrival>081500</arrival>
<type>Scheduled</type>
</flight>
<flight number="2402">
<from airport="FRA">FRANKFURT,DE</from>
<to airport="SXF">BERLIN,DE</to>
<departure>103000</departure>
<arrival>113500</arrival>
<type>Scheduled</type>
</flight>
<flight number="0402">
<from airport="FRA">FRANKFURT,DE</from>
<to airport="JFK">NEW YORK,US</to>
<departure>133000</departure>
<arrival>150500</arrival>
<type>Charter</type>
</flight>
<flight number="0401">
<from airport="JFK">NEW YORK,US</from>
<to airport="FRA">FRANKFURT,DE</to>
<departure>183000</departure>
<arrival>074500</arrival>
<type>Scheduled</type>
</flight>
<flight number="0400">
<from airport="FRA">FRANKFURT,DE</from>
<to airport="JFK">NEW YORK,US</to>
<departure>101000</departure>
<arrival>113400</arrival>
<type>Scheduled</type>
</flight>
</airline>
<airline code="QF" name="Qantas Airways">
<flight number="0005">
<from airport="SIN">SINGAPORE,SG</from>
<to airport="FRA">FRANKFURT,DE</to>
<departure>225000</departure>
<arrival>053500</arrival>
<type>Scheduled</type>
</flight>
<flight number="0006">
<from airport="FRA">FRANKFURT,DE</from>
<to airport="SIN">SINGAPORE,SG</to>
<departure>205500</departure>
<arrival>150500</arrival>
<type>Scheduled</type>
</flight>
</airline>
<airline code="SQ" name="Singapore Airlines">
<flight number="0988">
<from airport="SIN">SINGAPORE,SG</from>
<to airport="TYO">TOKYO,JP</to>
<departure>163500</departure>
<arrival>001500</arrival>
<type>Scheduled</type>
</flight>
<flight number="0158">
<from airport="SIN">SINGAPORE,SG</from>
<to airport="JKT">JAKARTA,ID</to>
<departure>152500</departure>
<arrival>160000</arrival>
<type>Scheduled</type>
</flight>
<flight number="0015">
<from airport="SFO">SAN FRANCISCO,US</from>
<to airport="SIN">SINGAPORE,SG</to>
<departure>160000</departure>
<arrival>024500</arrival>
<type>Scheduled</type>
</flight>
<flight number="0002">
<from airport="SIN">SINGAPORE,SG</from>
<to airport="SFO">SAN FRANCISCO,US</to>
<departure>170000</departure>
<arrival>192500</arrival>
<type>Scheduled</type>
</flight>
</airline>
<airline code="UA" name="United Airlines">
<flight number="0941">
<from airport="FRA">FRANKFURT,DE</from>
<to airport="SFO">SAN FRANCISCO,US</to>
<departure>143000</departure>
<arrival>170600</arrival>
<type>Scheduled</type>
</flight>
<flight number="3504">
<from airport="SFO">SAN FRANCISCO,US</from>
<to airport="FRA">FRANKFURT,DE</to>
<departure>150000</departure>
<arrival>103000</arrival>
<type>Scheduled</type>
</flight>
<flight number="3516">
<from airport="JFK">NEW YORK,US</from>
<to airport="FRA">FRANKFURT,DE</to>
<departure>162000</departure>
<arrival>054500</arrival>
<type>Scheduled</type>
</flight>
<flight number="3517">
<from airport="FRA">FRANKFURT,DE</from>
<to airport="JFK">NEW YORK,US</to>
<departure>104000</departure>
<arrival>125500</arrival>
<type>Scheduled</type>
</flight>
</airline>
</flights>
Regards,
Amit
Reward all helpful replies. -
How to find min and max of a field from sorted internal table
Hi,
I have sorted Internal Table by field f1.
How do I find max and min value of f1.
For min value of f1 I am using,
READ TABLE IT1 INDEX 1.
IT1-F1 = MIN.
Is this correct? And how do I find the max value of f1 from this table.
Thanks,
CDYes, that is right, and you can get the max like this.
data: lv_lines type i.
* get min
READ TABLE IT1 INDEX 1.
MIN = IT1-F1.
* get max
lv_lines = lines( it1 ).
read table it1 index lv_lines.
MAX = IT1-F1.
Regards,
Rich Heilman -
How to Convert internal table data into text output and send mail in ABAP
Hi All,
Good Morning.
Taking a glance at a code that converts internal table data to an Excel file in ABAP. also checked how to send this excel to mailing list as attachment.
But thought of doing it without excel.
I mean, I have an internal table which contains fields of all types (character,integer,date,time). Since it is only around 4 to 5 rows in it (output),why to convert it to excel. not required!!. Instead I want to send this output to User's mails as Normal mail body with No attachments.
Could anybody please suggest me a way as to how to send internal table data as a mail ( not as an excel or PDF etc).
as of now my findings are, it is quite complex to convert internal table data to email (Text) format. but i believe if there is some way of doing it.
Best Regards
Dileep VThere's something I have used in the past where we send out information about failed precalculation settings (which are stored in internal table gt_fail)
notice we use gt_text as "mail body"
TRY.
* -------- create persistent send request ------------------------
gv_send_request = cl_bcs=>create_persistent( ).
* -------- create and set document -------------------------------
* create text to be sent
wa_line = text-001.
APPEND wa_line TO gt_text.
CLEAR wa_line.
APPEND wa_line TO gt_text.
LOOP AT gt_fail ASSIGNING <fs_fail>.
MOVE <fs_fail>-retry_count TO gv_count.
CONCATENATE text-002
<fs_fail>-setting_id
text-003
gv_count
INTO wa_line SEPARATED BY space.
APPEND wa_line TO gt_text.
CLEAR wa_line.
ENDLOOP.
APPEND wa_line TO gt_text.
wa_line = text-007.
APPEND wa_line TO gt_text.
* create actual document
gv_document = cl_document_bcs=>create_document(
i_type = 'RAW'
i_text = gt_text
i_length = '12'
i_subject = 'Failed Precalculation Settings!' ).
* add document to send request
CALL METHOD gv_send_request->set_document( gv_document ).
* --------- set sender -------------------------------------------
gv_sender = cl_sapuser_bcs=>create( sy-uname ).
CALL METHOD gv_send_request->set_sender
EXPORTING
i_sender = gv_sender.
* --------- add recipient (e-mail address) -----------------------
LOOP AT s_email INTO wa_email.
MOVE wa_email-low TO gv_email.
gv_recipient = cl_cam_address_bcs=>create_internet_address(
gv_email ).
CALL METHOD gv_send_request->add_recipient
EXPORTING
i_recipient = gv_recipient
i_express = 'X'.
ENDLOOP.
* ---------- set to send immediately -----------------------------
CALL METHOD gv_send_request->set_send_immediately( 'X' ).
* ---------- send document ---------------------------------------
CALL METHOD gv_send_request->send(
EXPORTING
i_with_error_screen = 'X'
RECEIVING
result = gv_sent_to_all ).
IF gv_sent_to_all = 'X'.
WRITE text-004.
ENDIF.
COMMIT WORK.
* exception handling
CATCH cx_bcs INTO gv_bcs_exception.
WRITE: text-005.
WRITE: text-006, gv_bcs_exception->error_type.
EXIT.
ENDTRY.
with the following declarations
* TABLES *
TABLES:
adr6,
rsr_prec_sett.
* INTERNAL TABLES & WORK AREAS *
DATA:
gt_fail TYPE SORTED TABLE OF rsr_prec_sett
WITH UNIQUE KEY setting_id run_date,
gt_text TYPE bcsy_text,
wa_fail LIKE LINE OF gt_fail,
wa_line(90) TYPE c.
FIELD-SYMBOLS:
<fs_fail> LIKE LINE OF gt_fail.
* VARIABLES *
DATA:
gv_count(4) TYPE n,
gv_send_request TYPE REF TO cl_bcs,
gv_document TYPE REF TO cl_document_bcs,
gv_sender TYPE REF TO cl_sapuser_bcs,
gv_recipient TYPE REF TO if_recipient_bcs,
gv_email TYPE adr6-smtp_addr,
gv_bcs_exception TYPE REF TO cx_bcs,
gv_sent_to_all TYPE os_boolean.
* SELECTION-SCREEN *
SELECT-OPTIONS:
s_email FOR adr6-smtp_addr NO INTERVALS MODIF ID sel.
DATA:
wa_email LIKE LINE OF s_email.
Maybe you are looking for
-
Incompatible web sites, playing wmv video on mac
I am an expert pc user switching to mac... I realized when I made the switch that they would be software that worked with PC that would not work with MAC. What has really surprised me, is there seems to be many web sites that will not work with MAC a
-
Using bind variables with sql statements
We connect from a VB 6.0 program via OO4O to an Oracle 8.1.7 database, using bind variables in connection with select statements. Running ok, but performance again by using bind vars not as good as expected! When looking into the table v$sqlarea, we
-
How to do Setup and Security implementation in ODI
HI Friends, I have few question regarding ODI installations.I am using Oracle DB version is Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production ODI is ODI 11.1.1.5 version. While installing can we go for One Master repository
-
We have a wierd situation going on here. Running Server OS X 10.3.9. A company that we work with has one user who's mail gives us problems. When we open mail he sends us on our end (using Mail in Jaguar, Panther, and Tiger) the reply address is repor
-
Removing leading zeros from a string value
Hi All, i have a Requirement like , i need remove leading zeros from a string value, like , 00Raj00Shekar==>Raj00shekar, how can i do this ? if it is only with the custom functions ,where can add the fuction in Jdeveloper and SOA Middle ware? Thanks