Please Help!!! Getting data to a table
I am having real problems with this I want a table with a header which lists the contents of a file. In this file on each line there are the header titles eg each line is set out the same just containing different parameters etc Event No: 0 Time Elapsed: 1.0 Event String: Algoritm changed Parameter: algo: Monitoring
In the table the constructor says Object [][] and Object [] please help how do I get my code to compile.
FileReader file = new FileReader("c:\\projects\\FirstSupport\\logfile2.txt");
BufferedReader inputfile = new BufferedReader (file);
Object[] columnNames = {"Event No",
"Time Elapsed",
"Event String",
"Parameter"};
Object[] values;
MessageFormat mf = new MessageFormat("Event No:{0,number} Time Elapsed: {1,number} Event String:{2} Parameter:{3,number}");
text = "Event No: 0 Time Elapsed: 1.0 Event String: Algoritm changed Parameter: algo: Monitoring";
while ((Line = inputfile.readLine()) != null);
System.out.println(text);
values = mf.parse(text);
int eventNo = ((Number)values[0]).intValue();
double time = ((Number)values[1]).doubleValue();
String eventString = (String)values[2];
int param = ((Number)values[3]).intValue();
JTable table = new JTable(values,columnNames);
Hi,
where is the problem? Does the part reading the file work? If so I would use a class extending DefaultTableModel .
Have a look at :
http://java.sun.com/docs/books/tutorial/uiswing/components/table.html
Phil
Similar Messages
-
How to get data from a table in a condition between twomonth
hai friends
I have a query that is i want to get data from a table based on a condition between two months in a format of char column
Ex
I have a column called from_month in the format of 'mon/yyyy'(already converted from date')
then the second column is to_month in the same format 'mon/yyyy'
now i wiil select from_month and to_month like
from month jan/2009
to month mar/2010
how to use between of two months in the format of char.Please tell me how to get two different month between data.Hi,
This may be of help.
Remember Pointless has made a point ;) (worth millions)
If possible , DO NOT store dates as strings or numbers.Let dates be dates.
WITH dat AS
(SELECT ' THIS IS JAN' x,to_char(to_date('01-JAN-2009','DD-MON-YYYY'),'mon/yyyy') y FROM dual UNION
SELECT ' THIS IS FEB' x,to_char(to_date('01-FEB-2009','DD-MON-YYYY'),'mon/yyyy') y FROM dual UNION
SELECT ' THIS IS MAR' x,to_char(to_date('01-MAR-2009','DD-MON-YYYY'),'mon/yyyy') y FROM dual UNION
SELECT ' THIS IS APR' x,to_char(to_date('01-APR-2009','DD-MON-YYYY'),'mon/yyyy') y FROM dual UNION
SELECT ' THIS IS MAY' x,to_char(to_date('01-MAY-2009','DD-MON-YYYY'),'mon/yyyy') y FROM dual UNION
SELECT ' THIS IS JUN' x,to_char(to_date('01-JUN-2009','DD-MON-YYYY'),'mon/yyyy') y FROM dual UNION
SELECT ' THIS IS JUL' x,to_char(to_date('01-JUL-2009','DD-MON-YYYY'),'mon/yyyy') y FROM dual UNION
SELECT ' THIS IS AUG' x,to_char(to_date('01-AUG-2009','DD-MON-YYYY'),'mon/yyyy') y FROM dual UNION
SELECT ' THIS IS SEP' x,to_char(to_date('01-SEP-2009','DD-MON-YYYY'),'mon/yyyy') y FROM dual UNION
SELECT ' THIS IS OCT' x,to_char(to_date('01-OCT-2009','DD-MON-YYYY'),'mon/yyyy') y FROM dual UNION
SELECT ' THIS IS NOV' x,to_char(to_date('01-NOV-2009','DD-MON-YYYY'),'mon/yyyy') y FROM dual)
SELECT * FROM dat
WHERE to_date(y,'mon/yyyy') BETWEEN to_date('01 jan 2009','dd mon yyyy') AND to_date('01 mar 2009','dd mon yyyy')Cheers!!!
Bhushan -
Jdbc getting data from multiple tables
hi guys
how can i get data from multiple tables in MSAccess
please help>
here is code thata i want to do
i have 3 tables in my MSAccess databace
Stud_O which consist name,surname fields
Stud_I consist address,tel
Stud_E department,faculty fields
Based on this I would guess that you are missing a key field. There is no way to connect the tables.
I make the class to insert data to the tables. But
cant do getting datas from this tables.
can anybody help me in making query
and method that displays reultset strings to the
textBoxes
A select ...
select name,surname from Stud_O. Use the executeQuery() method. -
Select statement failed to get data from transparent table
Hi Experts,
Please let me know why my select statement is failing to get data form transparent table REGUH. My code query is as below:
SELECT * FROM REGUH WHERE
LAUFD = RUN_DATE AND
LAUFI = ID AND
LIFNR = P0009-PERNR AND
RZAWE = 'C'.
MOVE REGUH-RWBTR TO CASH.
CASH = CASH * -1.
ENDSELECT.
REGUH table has data for the given query but it is not retreiving the data.Please let me know what is the problem with the query
because of which it is not fetching the data.The same query is working fine in Developement but fails in production may be because one new patch is updated.please help asap.Hi Ankita,
Why you are going for select *
Try This...
SELECT SINGLE RWBTR
INTO v_RWBTR
WHERE LAUFD = RUN_DATE
AND LAUFI = ID
AND LIFNR = P0009-PERNR
AND RZAWE = 'C'.
MOVE v_RWBTR TO CASH.
CASH = CASH * -1.
Regards,
Raj. -
Please help me to find the table for fields where the descriptions are give
please help me to find the table for fields where the descriptions are given below
Customer Support Administrator
first line Support indicatorYou could also try table DD01T. In se 16,put in the description thats needed,you will get to know the respective data elements.
Then you can use DD03L to find the respective table. This would work if the data element is not generic.
Regards,
Anubhav. -
How to get data from COSP table, field HRKFT as the key to data from PM?
Dear ladies and gentlemen!
I need to get data from COSP table, field HRKFT as the key to data from PM tables (AFKO and AUFK).
The problem is that it is a key field to the COSP, and all non-key fields as an alternative to HRKFT are not suitable for this task.
All this is necessary for the extractor, which loads the data from the R \ 3 systems in the BW-system. I need to perform SELECT from a table COSP and maybe also JOIN, most likely between tables COSP and AUFK.
What should I do in this case?
Thank you very much in advance!From information on help.sap.com I've made a conclusion that one of possible solutions in theory is to modify standard extractor PM_OM_OPA_1 in order to make HRKFT field available for work, because by default it is hidden by SAP and not available for use as a key field.
Of course, it's not a very good solution, but for now I know no other way to solve this problem.
Maybe someone knows better ways? In this case I will be very grateful for any help!
Moderator: You'd better post it on BI forums -
iitWhen syncing my iPhone the storage says OTHER what is other and how do you delete it or make it smaller my 16g phone has 3G of other please help get rid of it
The following has some information that may help: http://osxdaily.com/2013/07/24/remove-other-data-storage-iphone-ipad/
-
I am converting a servlet based application to struts framework.I have a screen which gets data from 7 tables.I cannot use a stored procedure so has to manage using SQL queries.I thought i will query each table and set it to my struts form.The screen has lot of drop down boxes .
I have heard of composite design pattern .Please let me know the best way to query the tables.Here are the queries.
Select a.proj_id , a.proj_nm
From stn_proj_et a, stn_proj b
Where a.proj_id = b.proj_id
And a.sftwr_id = 24
And b.stn_id = 56602;
Select round(utm_x,3) utm_x, round(utm_y,3) utm_y, stn_id
From stn_loc_hist
Where stn_id ='56602'
And cur_use_cd = 1
select data_tp_cd
from data_coll_summ
where stn_id ='56002'
And rownum < 2;
select lat_no,long_no,pnt_loc_dsc,srce_id,mthd_dtrmn_cd,ctrl_dtm_cd
from stn_et
where stn_id = '56002';
select
distinct sjr_utils.getcatalogvalue(mthd_dtrmn_cd)
from stn_et;
select
distinct sjr_utils.getcatalogvalue(ctrl_dtm_cd)
from stn_et;
select distinct PROJ_NM from stn_proj_et where sftwr_id=24;
Select a.stn_alias_nm stn_alias_nm, b.alias_orgn_nm alias_orgn_nm
From stn_alias_nm a, alias_orgn_et b
Where a.alias_orgn_id = b.alias_orgn_id
And b.alias_orgn_tp = 0
And stn_id = '56002';adithiananya wrote:
I am converting a servlet based application to struts framework.How well do you know Struts?
I have a screen which gets data from 7 tables.I cannot use a stored procedure so has to manage using SQL queries.I thought i will query each table and set it to my struts form.The screen has lot of drop down boxes .You don't need a stored procedure to query a database.
I have heard of composite design pattern .This ain't it.
Please let me know the best way to query the tables.Here are the queries.
Select a.proj_id , a.proj_nm
From stn_proj_et a, stn_proj b
Where a.proj_id = b.proj_id
And a.sftwr_id = 24
And b.stn_id = 56602;What are those hard-wired magic numbers in the WHERE clause?
>
Select round(utm_x,3) utm_x, round(utm_y,3) utm_y, stn_id
From stn_loc_hist
Where stn_id ='56602'
And cur_use_cd = 1What are those hard-wired magic numbers in the WHERE clause?
>
select data_tp_cd
from data_coll_summ
where stn_id ='56002'
And rownum < 2;What are those hard-wired magic numbers in the WHERE clause?
>
select lat_no,long_no,pnt_loc_dsc,srce_id,mthd_dtrmn_cd,ctrl_dtm_cd
from stn_et
where stn_id = '56002';
select
distinct sjr_utils.getcatalogvalue(mthd_dtrmn_cd)
from stn_et;
select
distinct sjr_utils.getcatalogvalue(ctrl_dtm_cd)
from stn_et;
select distinct PROJ_NM from stn_proj_et where sftwr_id=24;What are those hard-wired magic numbers in the WHERE clause?
Select a.stn_alias_nm stn_alias_nm, b.alias_orgn_nm alias_orgn_nm
From stn_alias_nm a, alias_orgn_et b
Where a.alias_orgn_id = b.alias_orgn_id
And b.alias_orgn_tp = 0
And stn_id = '56002';What are those hard-wired magic numbers in the WHERE clause?
Do you really want to execute different requests given input from the users? (e.g., enter a value in a text box and see the drop down list boxes change)
% -
Could you please help me in joining these tables
Could you please help me in joining these tables
ra_customers
oe_order_headers_all
oe_order_lines_all
mtl_system_items_b
mtl_item_categories
mtl_categories
I wrote the condition like this.Is there any more possibilities for join
Tell me what more to join in this query....?
select x.customer_name,x.segment1,x.description,x.segment2,sum(x.week1) week1, sum(x.week2) week2,
sum(x.week3) week3, sum(x.week4) week4, sum(x.week5) week5
from
select a.customer_name,d.segment1,d.description,f.segment2,
case
when to_char(to_date(c.request_date,'DD-MON-YYYY'),'w')= 1 then
nvl(c.ordered_quantity,0)
else null
end as WEEK1,
case
when to_char(to_date(c.request_date,'DD-MON-YYYY'),'w')= 2 then
nvl(c.ordered_quantity,0)
else null
end as WEEK2,
case
when to_char(to_date(c.request_date,'DD-MON-YYYY'),'w')= 3 then
nvl(c.ordered_quantity,0)
else null
end as WEEK3,
case
when to_char(to_date(c.request_date,'DD-MON-YYYY'),'w')= 4 then
nvl(c.ordered_quantity,0)
else null
end as WEEK4,
case
when to_char(to_date(c.request_date,'DD-MON-YYYY'),'w')= 5 then
nvl(c.ordered_quantity,0)
else null
end as WEEK5
from
ra_customers a,
oe_order_headers_all b,
oe_order_lines_all c,
mtl_system_items_b d,
mtl_item_categories e,
mtl_categories f
where
a.customer_id=b.sold_to_org_id and
b.header_id=c.header_id
and c.request_date between sysdate-7 and sysdate+7
and c.inventory_item_id=d.inventory_item_id
and d.inventory_item_id = e.inventory_item_id
and e.category_id = f.category_id
and d.organization_id=e.organization_id
and e.category_set_id=1
) x
group by x.customer_name,x.segment1,x.description,x.segment2;Hw will I join the tables that have no column in common?I need to retrieve a value from table 2 by refering the value in table 1Post some sample data and show us what you want.
-
How to get data from large table (more than 9 million rows) by EJB?
I have a giant table, it has more than 9 million rows.
I want to use ejb finders method to get data from this table but always get not enough memory error or time out error,
Can anyone give me solutions?
ThxYour problem may be that you are simply trying to load so many objects (found by your finder) that you are exceeding available memory. For example if each object is 100 bytes and you try to load 1,000,000 objects thats 100Mb of memory gone.
You could try increasing the amount of memory available to OC4J with the appropriate argument on the command line (or in the 10gAS console). For example to make 1Gb available to OC4J you would add the argument:
-Xmx1000m
Of course you need have this available as hard memory on your server or you will incur serious swapping.
Chris -
JSON - get data from Oracle table
Hi all,
I hope it is correct thread...
My need is to get data from oracle table using JSON and show output at html table. I'm very new to JSON (got some experience in PL/SQL and basic html knowledge). Could someone direct me to manual or give me simple example?JSON is a way to format data, not a way to fetch data. Call it an alternative to XML.
Are you perhaps talking about doing an ajax request to fetch data? -
I reboot my router updated to IOS 5, still NO on/off selection for mirroring..please help getting disappointed
What are you trying to mirror from? Mirroring from your Mac won't be available until Mountain Lion 10.8 www.apple.com/macosx/mountain-lion/
Setting up and troubleshooting AirPlay Mirroring
support.apple.com/kb/TS4085 -
Getting data into internal table wa_final
Hi Guys
I have change the logic for this program , I have created 2 workareas and internal table now I need help to place the data into
wa_final-max_date = wa_data-idate.
wa_final-min_date = wa_data-idate.
wa_final-max_km = wa_data-recdv.
wa_final-min_km = wa_data-recdv.
wa_final-max_hR = wa_data-recdv.
wa_final-min_hR = wa_data-recdv.
wa_final-max_lit = wa_data-recdv.
wa_final-min_lit = wa_data-recdv.
wa_final-t_max_min_km = wa_data-recdv. " min_km - max_km
wa_final-t_max_min_hr = wa_data-recdv. " min_hr - max_hr
wa_final-t_max_min_lit = wa_data-recdv. " min_lit - max_lit.
so how can I put the logic to the value please correct my program.seeing my program can anyone give some idea ?
REPORT Z_FUEL_MONTHLY_QTY LINE-SIZE 260 LINE-COUNT 75
NO STANDARD PAGE HEADING.
TABLES : equi,
equz,
imptt,
imrg,
eqkt,
iloa.
Type Declaration
*DATA: BEGIN OF ty_equi occurs 0,
equnr type equi-equnr,
END OF ty_equi.
*DATA: BEGIN of ty_eqkt occurs 0,
equnr type eqkt-equnr,
eqktx type eqkt-eqktx,
END OF ty_eqkt.
*DATA: BEGIN of ty_iloa occurs 0,
iloan type iloa-iloan,
eqfnr type iloa-eqfnr,
END OF ty_iloa.
*DATA: BEGIN of ty_imptt occurs 0,
mpobj type imptt-mpobj,
END of ty_imptt.
*DATA: BEGIN of ty_imrg occurs 0,
idate type imrg-idate,
recdv type imrg-recdv,
recdu type imrg-recdu,
END of ty_imrg.
TYPES: BEGIN OF ty_data ,
equnr type equnr, " Euipment no
eqktx type eqkt-eqktx, " Equipment Text
eqfnr type iloa-eqfnr, " Equipment Sort field
idate type imrg-idate, " Measuring Date
recdu type imrg-recdu, " Unit of measuring ='KM','L','H'
recdv type imrg-recdv, " Counter reading data
END OF ty_data.
TYPES: BEGIN OF ty_final,
equnr type equnr, " Equipment no
eqktx type eqkt-eqktx, " Equipment Text
eqfnr type iloa-eqfnr, " Equipment Sort field
min_date type imrg-idate, " Min Date
min_km type p decimals 2, " Max Km
max_km type p decimals 2, " Min km
t_max_min_km type i, " Total min_km-max_km
max_date type imrg-idate, " Max Date
min_hr type imrg-recdv, " Max hr
max_hr type imrg-recdv, " Min hr
t_max_min_hr type i, " Total min_hr-max_hr
min_lit type imrg-recdv, " Max lit
max_lit type imrg-recdv, " Min lit
t_max_min_lit type i, " Total min_lit-max_lit
fuel_con type p decimals 2, " Total_hrs / t_max_min_hr
km_l type p decimals 2, " km / L
lit_per_hr type i , " fuel comsumed / t_max_min_hr
END OF ty_final.
DATA: i_data TYPE TABLE OF ty_data, " internal table
wa_data TYPE ty_data, " work area
i_final TYPE TABLE OF ty_final, " internal table
wa_final TYPE ty_final. " work area
DATA : max_date type date ,
min_date type date,
max_km TYPE p DECIMALS 2,
min_km TYPE p DECIMALS 2,
max_hr TYPE p DECIMALS 2,
min_hr TYPE p DECIMALS 2,
max_lit TYPE p DECIMALS 2,
min_lit TYPE p DECIMALS 2,
t_max_min_km TYPE p DECIMALS 2,
t_max_min_hr TYPE p DECIMALS 2,
t_max_min_lit TYPE p DECIMALS 2.
SELECTION-SCREEN BEGIN OF BLOCK blk WITH FRAME.
SELECTION-SCREEN BEGIN OF BLOCK blk1 WITH FRAME TITLE text-001.
SELECT-OPTIONS: p_equnr FOR equi-equnr, "no-extension no intervals,
p_idate FOR imrg-idate. "NO-EXTENSION NO INTERVALS OBLIGATORY,
"p_recdu FOR imrg-recdu NO-EXTENSION NO INTERVALS ."default 'M3'" OBLIGATORY.
SELECTION-SCREEN END OF BLOCK blk1.
SELECTION-SCREEN BEGIN OF BLOCK blk2 WITH FRAME TITLE text-002.
SELECTION-SCREEN END OF BLOCK blk2.
SELECTION-SCREEN END OF BLOCK blk.
TOP-OF-PAGE.
FORMAT INTENSIFIED ON.
WRITE:/1(40) ' INVESTMENT LIMITED '.
WRITE:/50(40) ' FUEL CONSUMPTION REPORT ' CENTERED ,
2 'Page', sy-pagno.
FORMAT INTENSIFIED OFF.
WRITE:/50(40) '----
' CENTERED .
FORMAT INTENSIFIED ON.
WRITE:/2 sy-datum COLOR 3, sy-uzeit .
"WRITE:/1 S903-SPMON ."p_yearf.
ULINE.
"CENTERED.
write: /2 'Date From :'.
write: /2 'Equipment No :'.
write: /2 'Unit :'.
SKIP.
ULINE.
WRITE:/1 sy-vline,
2 'EQUIP NO', 10 sy-vline,
11 'NAME', 40 sy-vline,
41 'SORT', 60 sy-vline,
61 'MIN DATE', 74 sy-vline,
75 'MAX DATE', 87 sy-vline,
88 'MIN KM', 100 sy-vline,
101 'MAX KM' , 113 sy-vline,
114 'TOTALK', 126 sy-vline,
127 'MIN HR', 139 sy-vline,
140 'MAX HR', 152 sy-vline,
153 'TOTALH' , 167 sy-vline,
168 'MIN LIT', 180 sy-vline,
181 'MAX LIT', 193 sy-vline,
194 'TOTALL', 206 sy-vline,
207 'FUEL CON', 219 sy-vline,
220 'KM L', 232 sy-vline,
233 'LIT PER KM', 246 sy-vline.
FORMAT COLOR 3 ON.
ULINE.
END-OF-PAGE.
START-OF-SELECTION.
select a~equnr d~eqktx f~eqfnr e~idate e~recdu e~recdv
into table i_data
from equi AS a
inner join equz as b
on a~equnr = b~equnr
inner join iloa as f
on b~iloan = f~iloan
inner join imptt as c
on a~objnr = c~mpobj
inner join eqkt as d
on a~equnr = d~equnr
inner join imrg as e
on e~point = c~point
where a~equnr in p_equnr
and
e~idate in p_idate.
loop at i_data into wa_data.
CLEAR: wa_final.
READ TABLE i_final into wa_final
with key equnr = wa_data-equnr.
if sy-subrc EQ 0.
PERFORM prepare_final_rec USING'M'. " Modify Existing Record
ElSE.
PERFORM prepare_final_rec USING'A'. " Append New Record.
ENDIF.
ENDLOOP.
LOOP AT i_final into wa_final.
WRITE:/1 sy-vline,
2 wa_final-equnr , 10 sy-vline,
11 wa_final-eqktx , 40 sy-vline,
41 wa_final-eqfnr , 60 sy-vline,
61 wa_final-min_date , 74 sy-vline,
75 wa_final-max_date , 87 sy-vline,
88 wa_final-min_km EXPONENT 0 DECIMALS 2 LEFT-JUSTIFIED , 100 sy-vline,
101 wa_final-max_km EXPONENT 0 DECIMALS 2 LEFT-JUSTIFIED , 113 sy-vline,
114 wa_final-t_max_min_km EXPONENT 0 DECIMALS 2 LEFT-JUSTIFIED , 126 sy-vline,
127 wa_final-min_hr EXPONENT 0 DECIMALS 2 LEFT-JUSTIFIED , 139 sy-vline,
140 wa_final-max_hr EXPONENT 0 DECIMALS 2 LEFT-JUSTIFIED , 152 sy-vline,
153 wa_final-t_max_min_hr EXPONENT 0 DECIMALS 2 LEFT-JUSTIFIED , 167 sy-vline,
168 wa_final-min_lit EXPONENT 0 DECIMALS 2 LEFT-JUSTIFIED , 180 sy-vline,
181 wa_final-max_lit EXPONENT 0 DECIMALS 2 LEFT-JUSTIFIED , 193 sy-vline,
194 wa_final-t_max_min_lit EXPONENT 0 DECIMALS 2 LEFT-JUSTIFIED , 206 sy-vline,
207 wa_final-fuel_con EXPONENT 0 DECIMALS 2 LEFT-JUSTIFIED , 219 sy-vline,
220 wa_final-km_l EXPONENT 0 DECIMALS 2 LEFT-JUSTIFIED , 232 sy-vline,
233 wa_final-lit_per_hr EXPONENT 0 DECIMALS 2 LEFT-JUSTIFIED , 246 sy-vline.
ULINE.
endloop.
FORM prepare_final_rec USING p_mode TYPE char1.
SORT i_data BY equnr idate descending .
if wa_data-recdu = 'KM'.
max_km = wa_data-recdv.
min_km = wa_data-recdv.
endif.
if wa_data-recdu ='H'.
max_hr = wa_data-recdv.
min_hr = wa_data-recdv.
endif.
if wa_data-recdu ='L'.
max_lit = wa_data-recdv.
min_lit = wa_data-recdv.
endif.
at new equnr.
read table i_final into wa_final index sy-tabix.
write:/ wa_final-equnr, wa_final-eqktx ,wa_final-eqfnr ,wa_final-idate ,
'Min KM',min_km EXPONENT 0 DECIMALS 2 color 7 ,
'Min H',min_hr EXPONENT 0 DECIMALS 2 color 7 ,
'Min L',min_lit EXPONENT 0 DECIMALS 2 color 7.
endat.
*at end of equnr.
read table i_data into wa_data index sy-tabix.
write:/ wa_final-equnr, wa_final-eqktx ,wa_final-eqfnr ,wa_final-idate ,
'Max KM', max_km EXPONENT 0 DECIMALS 2 color 7,
'Max H', max_hr EXPONENT 0 DECIMALS 2 color 7,
'Max L', max_lit EXPONENT 0 DECIMALS 2 color 7.
*endat.
wa_final-max_date = wa_data-idate.
wa_final-min_date = wa_data-idate.
wa_final-max_km = wa_data-recdv.
wa_final-min_km = wa_data-recdv.
wa_final-max_hR = wa_data-recdv.
wa_final-min_hR = wa_data-recdv.
wa_final-max_lit = wa_data-recdv.
wa_final-min_lit = wa_data-recdv.
wa_final-t_max_min_km = wa_data-recdv. " min_km - max_km
wa_final-t_max_min_hr = wa_data-recdv. " min_hr - max_hr
wa_final-t_max_min_lit = wa_data-recdv. " min_lit - max_lit.
IF p_mode = 'A'.
wa_final-equnr = wa_data-equnr.
wa_final-eqktx = wa_data-eqktx.
wa_final-eqfnr = wa_data-eqfnr.
APPEND wa_final TO i_final.
ELSE.
MODIFY i_final FROM wa_final
TRANSPORTING
max_date
min_date
max_km
min_km
max_hr
min_hr
max_lit
min_lit
t_max_min_km
t_max_min_hr
where equnr = wa_data-equnr.
ENDIF.
ENDFORM. " PREPARE_FINAL_REC
regards;Hi
Thanks , where to use the loop and endloop.
I want individual data to go into wa_final but confused how to start to get
min date..max..date..minkm_value..maxkm_value...total min-max,
min_hr,max_hr,total diff , min_lit,max_lit, total as in the program but how the data will go according to the values in wa_final
regards
Piroz -
Hi All,
I am working on a report where i need to get the data from few tables and get it displayed, in the requirement I need to get some data from REGUP based on the vendor and then I am trying to retrieve the information from PAYR table such as check #, check date. So far I have tried selecting the information from REGUP using the vendor number entered by the user and then I am doing a select on PAYR to get the other information for all the entries in my REGUP internal table. Using a simple select statement is taking lot of time and I am having performance issues, can you please suggest any better approach? I understand REGUP is a huge table.
Thanks,
RajHi Raja,
RUGUH is Payment header table and REGUP is payment item table.
If your basic requirement is to pick data from PAYR table only then why don't you write query as below,
Select
laufd
laufi
hktid
hbkid
from reguh
into table it_data_reguh
where ZBUKR = 'ZTC'
AND lifnr in s_lifnr.
sort it_data_reguH.
select chect
bancd
for all entries in it_data_reguH
into table it_data_payr
where ZBUKR = 'ZTC'
AND hbkid = it_data_reguH-hbkid
AND HKTID = it_data_reguH-hKTid
AND laufd = it_data_reguH-laufd
and laufi = it_data_reguH-laufi.
After doing above you can pick entries from REGUP if required as REGUP contains item details against the paymnt header details IN REGUH, you will also find all key fields of REGUP table from REGUH table hence your performance will definitely get improve.
Hope it will help you.
Regards,
Umang Mehta -
Please help getting invalid number error.
Hi Experts,
My requirement is
If DT_ID value of xmlmsg existed in the DT_ID of PART_ID_COLLES table then that record should be processd else should be skipped.
And xmlmsg of PART_ID should start with "A" and followed only by the number then that record should be processed else should be skipped.
And xmlmsg of DD_DAYS should contain only the number and grater than or equal to 0 ,then that record should be processed else should be skipped.
For that I have written this code.
But if I pass dt_id as string value in xmlmsg I am getting invalid number error.
DT_ID of PART_ID_COLLES table is number data type.
SELECT xmlmsg.part_id part_id,xmlmsg.dd_days dd_days,xmlmsg.dt_id dt_id
FROM XMLTABLE(
XMLNAMESPACES(
'urn:schemas-microsoft-com:rowset' as "rs"
, '#RowsetSchema' as "z"
'/z:row[not(@dt_id=following-sibling::z:row/@dt_id and @part_id=following-sibling::z:row/@part_id)]'
PASSING p_dd_days_vals
COLUMNS
ITEM_NO for ordinality
, dt_id VARCHAR2 (20) path '@dt_id'
, part_id VARCHAR2 (25) path '@part_id'
, dd_days VARCHAR2 (20) path '@dd_days'
) xmlmsg,
part_id_colles pic
WHERE REGEXP_REPLACE(TRIM(xmlmsg.dt_id),'^([0-9]+)$|.','\1') = pic.dt_id
AND REGEXP_LIKE (UPPER(TRIM(xmlmsg.part_id)),'^[A][0-9]+$')
AND (TO_NUMBER(REGEXP_REPLACE(TRIM(xmlmsg.dd_days),'^([0-9]+)$|.','\1')) >=0
AND REGEXP_LIKE(TRIM(xmlmsg.dd_days), '^-?[[:digit:],.]*$') ;
Sample message is
<MESSAGES>
<MESSAGE ID="12345">
<MSG_ID>3026900</MSG_ID>
<DT_POSTED>6/20/2013 08:15:48</DT_POSTED>
<POSTED_BY>GPD_MSG_EXTRACTOR</POSTED_BY>
<DT_LAST_QUEUED />
<MSG>
<WORK_SET TRANSACTION_ID="@TRANS_ID" TRANSACTION_TYPE="Batch" IS_ACID="@IS_ACID">
<WORK_UNIT GROUP="dd_days" ACTION="ADD" AFFECTED="dd_days">
<RECORDSET TABLE_NAME="dd_days">
<xml xmlns:s="uuid:BDC6E3F0-6DA3-11d1-A2A3-00AA00C14882" xmlns:dt="uuid:C2F41010-65B3-11d1-A29F-00AA00C14882" xmlns:rs="urn:schemas-microsoft-com:rowset" xmlns:z="#RowsetSchema">
<rs:data>
<z:row dt_id="430" part_id="A5556689" dd_days="10"/>
<z:row dt_id="550A" part_id="A8889965" dd_days="20"/>
</rs:data>
</xml>
</RECORDSET>
</WORK_UNIT>
</WORK_SET>
</MSG>
</MESSAGE>
</MESSAGES>
Please help me.
Thanks.Your code has ton of errors. Anyway:
with part_id_colles as (
select 430 dt_id,xmltype('<MESSAGES>
<MESSAGE ID="12345">
<MSG_ID>3026900</MSG_ID>
<DT_POSTED>6/20/2013 08:15:48</DT_POSTED>
<POSTED_BY>GPD_MSG_EXTRACTOR</POSTED_BY>
<DT_LAST_QUEUED />
<MSG>
<WORK_SET TRANSACTION_ID="@TRANS_ID" TRANSACTION_TYPE="Batch" IS_ACID="@IS_ACID">
<WORK_UNIT GROUP="dd_days" ACTION="ADD" AFFECTED="dd_days">
<RECORDSET TABLE_NAME="dd_days">
<xml xmlns:s="uuid:BDC6E3F0-6DA3-11d1-A2A3-00AA00C14882" xmlns:dt="uuid:C2F41010-65B3-11d1-A29F-00AA00C14882" xmlns:rs="urn:schemas-microsoft-com:rowset" xmlns:z="#RowsetSchema">
<rs:data>
<z:row dt_id="430" part_id="A5556689" dd_days="10"/>
<z:row dt_id="550A" part_id="A8889965" dd_days="20"/>
</rs:data>
</xml>
</RECORDSET>
</WORK_UNIT>
</WORK_SET>
</MSG>
</MESSAGE>
</MESSAGES>') p_dd_days_vals from dual)
SELECT xmlmsg.part_id part_id,
xmlmsg.dd_days dd_days,
xmlmsg.dt_id dt_id
FROM part_id_colles pic,
XMLTABLE(
XMLNAMESPACES(
'urn:schemas-microsoft-com:rowset' as "rs",
'#RowsetSchema' as "z"
'/MESSAGES/MESSAGE/MSG/WORK_SET/WORK_UNIT/RECORDSET/xml/rs:data/z:row[not(@dt_id=following-sibling::z:row/@dt_id and @part_id=following-sibling::z:row/@part_id)]'
PASSING p_dd_days_vals
COLUMNS
ITEM_NO for ordinality,
dt_id VARCHAR2 (20) path '@dt_id',
part_id VARCHAR2 (25) path '@part_id',
dd_days VARCHAR2 (20) path '@dd_days'
) xmlmsg
WHERE REGEXP_REPLACE(TRIM(xmlmsg.dt_id),'^([0-9]+)$|.','\1') = pic.dt_id
AND REGEXP_LIKE(UPPER(TRIM(xmlmsg.part_id)),'^[A][0-9]+$')
AND TO_NUMBER(REGEXP_REPLACE(TRIM(xmlmsg.dd_days),'^([0-9]+)$|.','\1')) >=0
AND REGEXP_LIKE(TRIM(xmlmsg.dd_days), '^-?[[:digit:],.]*$')
PART_ID DD_DAYS DT_ID
A5556689 10 430
SQL>
SY.
Maybe you are looking for
-
Not Syncing to Windows or iTunes?
please help i dont no y but it wont sync to my computer or to itunes and i want it fixed but i dont no how 2?
-
Windows Update Service keeps turning back on
I have Windows Update service stopped and Disabled in my image. It doesn't turn back on upon every reboot I attempt. However, once I use it in an OSD to apply image and carry out my OSD task sequence, every single time the Windows Update service
-
Visibility and Authorisation of Cfolders
Hi , I am working on a SNC+C-Folders collab project for a major discrete manufacturing co. Am stuck at 2 places in cfolders and would seriously appreciate some pointers to get me out of this ... 1. Is there a way to control visibility of non-relevan
-
My Nokia N80's battery has been acting up lately. It will last only a short time (at most 2 hours) of talk time then die, and in standby (with screen turned off and only LED blinking) it will last only 1 day. I need to purchase a new battery, and not
-
How to create slide show in Photoshop CS5.
Hi, Does anybody knows how to create a slide show in photoshop CS5 on windows computer? Thanx