Wrong number of records in extraction in Generic Extractor
Hi all,
I have created generic datasource on table DFKKCOLLH and made this datasource delta enabled on field ACPTM.
1)RSA3 is shoiwng 94.615 records
2) When i load the Full load it is fetching 92,015
3) When i load the initlization for Delta load the is it fetchin only 35,000 records
Can anybody suggest why there is difference ?
Regards
Nilesh
you can't use ACPTM as a delta field. it's a time field not a date field. the difference might be that in your init you only take the records where this field is initilal or just not initial...
just check in se16 the number of records you should have and tell us if this corresponds to what you have in rsa3, in full or in init...
M.
Similar Messages
-
Hierarchy datasource is showing wrong number of records
Hi,
I have to load hierarchies from r/3 to BW.when i test my hierarchy DataSource in RSA6 number of records its showing is 40,where as my R/3 system has 45 records for the same hierarchy.Can any one please let me know why its showing different number of records and how to overcome this problem.Hello VaKa,
How r u ?
Just load the data to the PSA and identify which records are missing, you can do this, u have small amount of data. Then you can identify which 5 records are missing and it will help to find the reason as well.
Best Regards....
Sankar Kumar
+91 98403 47141 -
How to reduce long extraction time - Generic extractor based on view
Hello. The previous thread about this error was closed without any answer.
I'm in the same configuration.
"Using a generic extractor (Delta enabled on confirmation date) based on view to load data from ECC6 to BI.
Now my issue is that the delta extraction is running for a long time (around 1 hr) even if the data volume is very small
While checking the job overview in source system i saw that the job is hanging at the below step for almost 1 hr."
1 LUWs confirmed and 1 LUWs to be deleted with function module MF RSC2_QOUT_CONFIRM_DATA.
I am not understanding why this is happening.
Here is the log of the job:
30.05.2011 03:58:11 Job started
30.05.2011 03:58:11 Step 001 started (program SBIE0001, variant &0000000166864, user ID ALEREMOTE)
30.05.2011 03:58:11 Asynchronous transmission of info IDoc 2 in task 0001 (0 parallel tasks)
30.05.2011 03:58:11 DATASOURCE = 0CO_OM_WBS_6
30.05.2011 03:58:11 *************************************************************************
30.05.2011 03:58:11 * Current Values for Selected Profile Parameters *
30.05.2011 03:58:11 *************************************************************************
30.05.2011 03:58:11 * abap/heap_area_nondia......... 4000000000 *
30.05.2011 03:58:11 * abap/heap_area_total.......... 8000000000 *
30.05.2011 03:58:11 * abap/heaplimit................ 100000000 *
30.05.2011 03:58:11 * zcsa/installed_languages...... DEFS *
30.05.2011 03:58:11 * zcsa/system_language.......... E *
30.05.2011 03:58:11 * ztta/max_memreq_MB............ 2047 *
30.05.2011 03:58:11 * ztta/roll_area................ 6500000 *
30.05.2011 03:58:11 * ztta/roll_extension........... 2000000000 *
30.05.2011 03:58:11 *************************************************************************
30.05.2011 03:58:11 1 LUWs confirmed and 1 LUWs to be deleted with function module RSC2_QOUT_CONFIRM_DATA
30.05.2011 05:02:53 Call customer enhancement BW_BTE_CALL_BW204010_E (BTE) with 171 records
30.05.2011 05:02:53 Result of customer enhancement: 171 records
30.05.2011 05:02:53 Call customer enhancement EXIT_SAPLRSAP_001 (CMOD) with 171 records
30.05.2011 05:02:53 Result of customer enhancement: 171 records
30.05.2011 05:02:53 Asynchronous send of data package 1 in task 0002 (1 parallel tasks)
30.05.2011 05:02:53 IDOC: Info IDoc 2, IDoc No. 4667050, Duration 00:00:00
30.05.2011 05:02:53 IDoc: Start = 30.05.2011 03:58:11, End = 30.05.2011 03:58:11
30.05.2011 05:02:53 tRFC: Data Package = 1, TID = AC11082D38B44DE308DD028A, Duration = 00:00:00, ARFCSTATE = RECORDED
30.05.2011 05:02:53 tRFC: Start = 30.05.2011 05:02:53, End = 30.05.2011 05:02:53
30.05.2011 05:02:53 Altogether, 0 records were filtered out through selection conditions
30.05.2011 05:02:53 Asynchronous transmission of info IDoc 3 in task 0003 (0 parallel tasks)
30.05.2011 05:02:53 IDOC: Info IDoc 3, IDoc No. 4667051, Duration 00:00:00
30.05.2011 05:02:53 IDoc: Start = 30.05.2011 05:02:53, End = 30.05.2011 05:02:53
30.05.2011 05:02:53 Synchronized transmission of info IDoc 4 (0 parallel tasks)
30.05.2011 05:02:53 IDOC: Info IDoc 4, IDoc No. 4667052, Duration 00:00:00
30.05.2011 05:02:53 IDoc: Start = 30.05.2011 05:02:53, End = 30.05.2011 05:02:53
30.05.2011 05:02:53 Job finished
Thanks for your help.
YannParth Kulkarni,
following the note and the other thread, I've check the index 4 of the table COEP.
Here is what I got:
Index ID COEP - 4
Short text MANDT/TIMESTMP/OBJNR, Index for Delta read method (CO-PA)
Last changed SAP 04.01.2010
Status Active Saved
Does not exist in the database
DB index nme
Not defined as DB index in the ABAP Dictionary
Is the fact that it doesn't exist in the database a problem ?
Is the fact that it is active is good enough ?
By the way thanks for your speedy reply !
Yann
Edited by: Yann GOFFIN on May 30, 2011 1:35 PM -
Wrong number of records in PSA compared to datasource
Hello all,
I am seeing 760 records in my datasource on R/3 side and when I replicate it and load to PSA (load to PSA only option) I see 1640 records. I dont know why this should happen. What are the things that I need to start checking can someone give some points. Or normally what are the things that cause this type of scenario.
Thanks a lot,This works something like that with the default option of Data Records/Call = 100 and Display Calls = 10, you will get some 1000 records (10010), and when you look at the list extracted, you see 10 data packets with a max of 100 records each. Though in your case I am not sure why it did not turn up the default 1000, but when you changed it to 1000 (= 100010 records), all the records were extacted and displayed.
Hope this helps... -
Query return wrong number of records
In a function, I use a variable declare as my_var table_name1.column_name%type.
This variable is used to to a test on a foreign key when I do a query on another table than table_name1 the number of rows return by the query is different than the number of rows return if I do the test directly with the value accorded.
Ex:
declare
my_var table_name1.column_name%type;
row_num number;
begin
my_var := 10;
select count(1) into row_num
from table_name2
where column_name = my_var;
dbms_output.put_line(row_num);
select count(1) into row_num
from table_name2
where column_name = 10;
dbms_output.put_line(row_num);
end;
the first query will return 2 and the second will return 1.
Can someone explain me why I have this strange result ?
Edited by: 897304 on Nov 15, 2011 5:12 AM
Edited by: 897304 on Nov 15, 2011 5:32 AMI cannot put the description of the table :-/
The type of the field is varchar2(12)
This is the function the value past to param1 came from oracle 11 and the table tab1 is in oracle10.
The first query work and return 1 (result expected) and the second return 2.
FUNCTION getValue(param1 VARCHAR2) RETURN number AS
var1 VARCHAR2(12 BYTE);
res1 number;
BEGIN
var1 := param1;
SELECT count(1)
INTO res1
FROM tab1
WHERE col2 = var1;
SELECT count(1)
INTO res1
FROM tab1
WHERE col2 = param1;
RETURN res1;
END getValue; -
Split R3 table's records into detailed set of records for extracting to BI
Hello, everybody,
In R3 table i have records:
<i>Document_numberA-Material_numberA-Date1-Date2-Date3-Amount1-Amount2---Amount3</i>
I have extract data to BI ODS in format:
<i>Document_numberA-Material_numberA-Date1---Amount1
Document_numberA-Material_numberA-Date2---Amount2
Document_numberA-Material_numberA-Date3---Amount3</i>
<i>Document_numberB-Material_numberB-Date1---Amount1</i>
How i have define extractor and loading mechanism?
Could you give me a suggestion?
Thanks in advance.
Best Regards,
Arunas StonysHello, everybody,
I have created a START ROUTINE, but it doesn't replaces <b>YEARS</b> and <b>AMOUNTS</b>.
<b>Code:</b>
PROGRAM trans_routine.
CLASS routine DEFINITION
CLASS lcl_transform DEFINITION.
PUBLIC SECTION.
Attributs
DATA:
p_check_master_data_exist
TYPE RSODSOCHECKONLY READ-ONLY,
*- Instance for getting request runtime attributs;
Available information: Refer to methods of
interface 'if_rsbk_request_admintab_view'
p_r_request
TYPE REF TO if_rsbk_request_admintab_view READ-ONLY.
PRIVATE SECTION.
TYPE-POOLS: rsd, rstr.
Rule specific types
TYPES:
BEGIN OF tys_SC_1,
Field: BANFN Paraikos nume..
BANFN TYPE C LENGTH 10,
Field: BANFPO Paraikos pozc..
BANFPO TYPE N LENGTH 5,
Field: TXZ01 Pavadinimas.
TXZ01 TYPE C LENGTH 40,
Field: FISTL Lėų centras.
FISTL TYPE C LENGTH 16,
Field: FKBER Programa.
FKBER TYPE C LENGTH 16,
Field: FIPOS Biud.straips..
FIPOS TYPE C LENGTH 14,
Field: GEBER Finan. altinis.
GEBER TYPE C LENGTH 10,
Field: FIPEX Straipsnis.
FIPEX TYPE C LENGTH 24,
Field: ZZYEAR1 Metai 1.
ZZYEAR1 TYPE N LENGTH 4,
Field: ZZYEAR2 Metai 2.
ZZYEAR2 TYPE N LENGTH 4,
Field: ZZYEAR3 Metai 3.
ZZYEAR3 TYPE N LENGTH 4,
Field: ZZSUM1 Suma 1.
ZZSUM1 TYPE P LENGTH 7 DECIMALS 2,
Field: ZZSUM2 Suma 2.
ZZSUM2 TYPE P LENGTH 7 DECIMALS 2,
Field: ZZSUM3 Suma 3.
ZZSUM3 TYPE P LENGTH 7 DECIMALS 2,
Field: WAERS Valiuta.
WAERS TYPE C LENGTH 5,
Field: BSART Paraikos tipas.
BSART TYPE C LENGTH 4,
Field: ERDAT Pakeista.
ERDAT TYPE D,
Field: RECORD Record Number.
RECORD TYPE RSARECORD,
END OF tys_SC_1.
TYPES:
tyt_SC_1 TYPE STANDARD TABLE OF tys_SC_1
WITH NON-UNIQUE DEFAULT KEY.
$$ begin of global - insert your declaration only below this line -
... "insert your code here
$$ end of global - insert your declaration only before this line -
METHODS
start_routine
IMPORTING
request type rsrequest
datapackid type rsdatapid
EXPORTING
monitor type rstr_ty_t_monitors
CHANGING
SOURCE_PACKAGE type tyt_SC_1
RAISING
cx_rsrout_abort.
METHODS
inverse_start_routine
IMPORTING
i_th_fields_outbound TYPE rstran_t_field_inv
i_r_selset_outbound TYPE REF TO cl_rsmds_set
i_is_main_selection TYPE rs_bool
i_r_selset_outbound_complete TYPE REF TO cl_rsmds_set
i_r_universe_inbound TYPE REF TO cl_rsmds_universe
CHANGING
c_th_fields_inbound TYPE rstran_t_field_inv
c_r_selset_inbound TYPE REF TO cl_rsmds_set
c_exact TYPE rs_bool.
ENDCLASS. "routine DEFINITION
$$ begin of 2nd part global - insert your code only below this line *
... "insert your code here
$$ end of 2nd part global - insert your code only before this line *
CLASS routine IMPLEMENTATION
CLASS lcl_transform IMPLEMENTATION.
Method start_routine
Calculation of source package via start routine
<-> source package
METHOD start_routine.
*=== Segments ===
FIELD-SYMBOLS:
<SOURCE_FIELDS> TYPE tys_SC_1.
DATA:
MONITOR_REC TYPE rstmonitor.
*$*$ begin of routine - insert your code only below this line *-*
... "insert your code here
DATA:
ls_SOURCE_PACKAGE type tys_SC_1,
lt_SOURCE_PACKAGE like table of ls_SOURCE_PACKAGE,
l_tabix like sy-tabix.
loop at SOURCE_PACKAGE into ls_SOURCE_PACKAGE.
l_tabix = sy-tabix.
ls_SOURCE_PACKAGE-BANFN = ls_SOURCE_PACKAGE-BANFN.
ls_SOURCE_PACKAGE-BANFPO = ls_SOURCE_PACKAGE-BANFPO.
ls_SOURCE_PACKAGE-TXZ01 = ls_SOURCE_PACKAGE-TXZ01.
ls_SOURCE_PACKAGE-FISTL = ls_SOURCE_PACKAGE-FISTL.
ls_SOURCE_PACKAGE-FKBER = ls_SOURCE_PACKAGE-FKBER.
ls_SOURCE_PACKAGE-FIPOS = ls_SOURCE_PACKAGE-FIPOS.
ls_SOURCE_PACKAGE-GEBER = ls_SOURCE_PACKAGE-GEBER.
ls_SOURCE_PACKAGE-FIPEX = ls_SOURCE_PACKAGE-FIPEX.
ls_SOURCE_PACKAGE-WAERS = ls_SOURCE_PACKAGE-WAERS.
ls_SOURCE_PACKAGE-BSART = ls_SOURCE_PACKAGE-BSART.
ls_SOURCE_PACKAGE-ERDAT = ls_SOURCE_PACKAGE-ERDAT.
ls_SOURCE_PACKAGE-RECORD = ls_SOURCE_PACKAGE-RECORD.
ls_SOURCE_PACKAGE-ZZYEAR1 = ls_SOURCE_PACKAGE-ZZYEAR1.
ls_SOURCE_PACKAGE-ZZSUM1 = ls_SOURCE_PACKAGE-ZZSUM1.
append ls_SOURCE_PACKAGE to lt_SOURCE_PACKAGE.
ls_SOURCE_PACKAGE-ZZYEAR1 = ls_SOURCE_PACKAGE-ZZYEAR2.
ls_SOURCE_PACKAGE-ZZSUM1 = ls_SOURCE_PACKAGE-ZZSUM2.
append ls_SOURCE_PACKAGE to lt_SOURCE_PACKAGE.
ls_SOURCE_PACKAGE-ZZYEAR1 = ls_SOURCE_PACKAGE-ZZYEAR3.
ls_SOURCE_PACKAGE-ZZSUM1 = ls_SOURCE_PACKAGE-ZZSUM3.
append ls_SOURCE_PACKAGE to lt_SOURCE_PACKAGE.
delete SOURCE_PACKAGE index l_tabix.
endloop.
move lt_SOURCE_PACKAGE[] to SOURCE_PACKAGE[].
*-- fill table "MONITOR" with values of structure "MONITOR_REC"
*- to make monitor entries
... "to cancel the update process
raise exception type CX_RSROUT_ABORT.
$$ end of routine - insert your code only before this line -
ENDMETHOD. "start_routine
Method inverse_start_routine
This subroutine needs to be implemented only for direct access
(for better performance) and for the Report/Report Interface
(drill through).
The inverse routine should transform a projection and
a selection for the target to a projection and a selection
for the source, respectively.
If the implementation remains empty all fields are filled and
all values are selected.
METHOD inverse_start_routine.
$$ begin of inverse routine - insert your code only below this line-
... "insert your code here
$$ end of inverse routine - insert your code only before this line -
ENDMETHOD. "inverse_start_routine
ENDCLASS. "routine IMPLEMENTATION
<b>Could you look at code and tell what is wrong?</b>
Thanks in advance!
Best Regards,
Arunas Stonys
Arunas Stonys -
How to get number of records in all user tables in one select
Please advise how to retrieve the number of records in all user tables in one select. I would likt to extract the data to excel file.
Many thanks,
AndrewYou could always analyze the tables:
declare
begin
for X in (select owner, table_name from all_tables
minus
select owner, table_name from all_external_tables) LOOP
dbms_stats.Gather_Table_Stats(X.Owner, X.Table_Name) ;
end loop;
end;
/Then: Select Owner, Table_Name, Num_Rows from All_Tables ; -
Determine the number of records in a file
I want to analyse record types from a large input file and so far have managed to extract different groups and created the relevant files. All I want to do now is count the number of records in each file so I can produce a report showing the different types but cannot figure out how to do this, I know it will be simple but I cannot get any command to accomplish this, help please!
in applescript, there are a few ways to count patterned text. if (as jeffrey suggests) each record is a separate line, then you can use the following:
set textContents to read "/path/to/file.txt"
count of paragraphs of textContents
if records are determined by some other process (such as a special delimiting character or phrase) you can use text items (replace the @ sign with the special character or phrase):
set textContents to read "/path/to/file.txt"
set {oldTID, my text item delimiters} to {my text item delimiters, "@"}
set theCount to count of text items of textContents
set my text item delimiters to oldTID -
Wrong number or types of argumnet in a call to error
Hi all,
Below is my stored proc and it has a input parameter 'c_count_or_perc' . I have passed value to this parameter as in the if block.
But I got the error as "wrong number or types of argumnet in a call to ' .
I really dont know how to pass input value to this parameter .
Could anyone please help?
{code}
PROCEDURE edr_rpt_gen_error_by_hour
in_report_parameter_id IN report_tasks.report_task_id%TYPE,
c_count_or_perc IN VARCHAR2 ,
report_data OUT SYS_REFCURSOR,
chart_data OUT SYS_REFCURSOR,
footer_data OUT SYS_REFCURSOR
{code}
In below 'IF THEN ELSE' block , ( based on the <condition> ) , I dont know how to pass value to input parameter c_count_or_perc .
{code}
IF (c_count_or_perc = 'ERROR BY HOUR') THEN
my_error_text := get_row_error_text;
my_total_text := get_row_total_text;
ELSE
my_error_text := get_row_error_text;
my_total_text := '';
DELETE edr_report_by_hour_output
WHERE row_type = 'Summary Row'
AND row_type = 'Final Row';
END IF;
{code}
Here I have pasted the full package. Could please tell me , what are ways tht I could pass value to the given input parameter.
{code}
CREATE OR REPLACE PACKAGE edr_rpt_error_by_hour_package AS
PROCEDURE edr_rpt_gen_error_by_hour
in_report_parameter_id IN report_tasks.report_task_id%TYPE,
c_count_or_perc IN VARCHAR2 ,
report_data OUT SYS_REFCURSOR,
chart_data OUT SYS_REFCURSOR,
footer_data OUT SYS_REFCURSOR
FUNCTION error_data
in_lane_id edr_report_by_hour_output.lane_id%TYPE,
in_direction_id edr_report_by_hour_output.direction_id%TYPE,
in_interval_start_date_time edr_report_by_hour_output.interval_start_date_time%TYPE,
in_interval_end_date_time edr_report_by_hour_output.interval_end_date_time%TYPE,
in_hour_start edr_report_by_hour_output.hour_start%TYPE,
in_hour_end edr_report_by_hour_output.hour_end%TYPE,
in_min_error NUMBER,
in_max_error NUMBER
RETURN NUMBER;
END edr_rpt_error_by_hour_package;
CREATE OR REPLACE PACKAGE BODY edr_rpt_error_by_hour_package AS
FUNCTION error_data
in_lane_id edr_report_by_hour_output.lane_id%TYPE,
in_direction_id edr_report_by_hour_output.direction_id%TYPE,
in_interval_start_date_time edr_report_by_hour_output.interval_start_date_time%TYPE,
in_interval_end_date_time edr_report_by_hour_output.interval_end_date_time%TYPE,
in_hour_start edr_report_by_hour_output.hour_start%TYPE,
in_hour_end edr_report_by_hour_output.hour_end%TYPE,
in_min_error NUMBER,
in_max_error NUMBER
RETURN NUMBER
IS
my_count_result NUMBER(18);
BEGIN
SELECT NVL(SUM(error_count), 0 )
INTO my_count_result
FROM
SELECT site_lane_id
FROM edr_rpt_tmp_report_lanes
WHERE edr_rpt_tmp_report_lanes.output_lane_id = in_lane_id
AND edr_rpt_tmp_report_lanes.output_direction_id = in_direction_id
) report_lanes
JOIN edr_error_by_hour_report_data
ON edr_error_by_hour_report_data.site_lane_id = report_lanes.site_lane_id
AND edr_error_by_hour_report_data.bin_start_date_time >= in_interval_start_date_time
AND edr_error_by_hour_report_data.bin_start_date_time < in_interval_end_date_time
AND edr_error_by_hour_report_data.hour >= in_hour_start
AND edr_error_by_hour_report_data.hour < in_hour_end
AND edr_error_by_hour_report_data.error_code >= in_min_error
AND edr_error_by_hour_report_data.error_code <= in_max_error
return my_count_result;
END error_data;
FUNCTION get_row_error_text
RETURN VARCHAR2
IS
my_row_error_text VARCHAR2(10000);
my_row_error_entry VARCHAR2(10000);
CURSOR row_error_text IS
SELECT 'edr_rpt_error_by_hour_package.error_data('
||'lane_id, '
||'direction_id, '
||'interval_start_date_time, '
||'interval_end_date_time, '
||'hour_start, '
||'hour_end, '
|| error_code || ', '
|| error_code || ') "'|| error_message.error_short_message || '"'
FROM error_message
WHERE error_code >= 0 and error_code < 19
ORDER BY error_code;
BEGIN
my_row_error_text := '';
my_row_error_entry := '';
-- generate the error code function calls
OPEN row_error_text;
LOOP
FETCH row_error_text INTO my_row_error_entry;
EXIT WHEN row_error_text%NOTFOUND;
my_row_error_text := my_row_error_text || ', ' || my_row_error_entry;
END LOOP;
CLOSE row_error_text;
RETURN my_row_error_text;
END get_row_error_text;
FUNCTION get_row_total_text
RETURN VARCHAR2
IS
my_row_error_text VARCHAR2(10000);
BEGIN
my_row_error_text := '';
-- generate the 'total' column function call
SELECT 'edr_rpt_error_by_hour_package.error_data('
||'lane_id, '
||'direction_id, '
||'interval_start_date_time, '
||'interval_end_date_time, '
||'hour_start, '
||'hour_end, '
|| MIN(error_code) || ', '
|| MAX(error_code) || ') "Total"'
INTO my_row_error_text
FROM error_message
WHERE error_code >= 0 and error_code < 19;
RETURN (', ' || my_row_error_text);
END get_row_total_text;
FUNCTION get_error_data_pct
in_lane_id edr_report_by_hour_output.lane_id%TYPE,
in_direction_id edr_report_by_hour_output.direction_id%TYPE,
in_interval_start_date_time edr_report_by_hour_output.interval_start_date_time%TYPE,
in_interval_end_date_time edr_report_by_hour_output.interval_end_date_time%TYPE,
in_hour_start edr_report_by_hour_output.hour_start%TYPE,
in_hour_end edr_report_by_hour_output.hour_end%TYPE,
in_min_error NUMBER,
in_max_error NUMBER
RETURN NUMBER
IS
my_count NUMBER(18);
my_total NUMBER(18);
my_count_pct NUMBER(18);
my_count_result NUMBER(18);
BEGIN
my_count_pct := 0 ;
my_count_result := error_data (
in_lane_id,
in_direction_id,
in_interval_start_date_time,
in_interval_end_date_time,
in_hour_start,
in_hour_end,
in_min_error,
in_max_error
IF (my_count_result > 0 ) THEN
my_total := error_data (
in_lane_id,
in_direction_id,
in_interval_start_date_time,
in_interval_end_date_time,
in_hour_start,
in_hour_end,
1,
19
my_count_pct := ROUND((my_count_result / my_total) * 100 ,2);
END IF;
return my_count_pct;
END get_error_data_pct;
PROCEDURE edr_error_by_hour_use_per_veh
in_report_parameter_id IN report_tasks.report_task_id%TYPE
IS
BEGIN
DELETE FROM edr_error_by_hour_report_data;
INSERT INTO edr_error_by_hour_report_data
site_id,
site_lane_id,
bin_start_date_time,
hour,
error_code,
error_count
SELECT
site_id,
site_lane_id,
bin_start_date_time,
hour,
error_code,
COUNT(1)
FROM (SELECT site_id,
site_lane_id,
( SELECT NVL(MAX(interval_start_date_time), date_time)
FROM edr_rpt_tmp_grouping_table
WHERE interval_start_date_time <= date_time) bin_start_date_time,
TO_NUMBER(TO_CHAR(date_time, 'hh24')) hour,
NVL(traffic_error.error_code, 0) error_code
FROM edr_error_by_hour_veh_data
LEFT OUTER JOIN traffic_error
ON traffic_error.record_id = edr_error_by_hour_veh_data.record_id
) vehicles
GROUP BY
site_id,
site_lane_id,
bin_start_date_time,
hour,
error_code;
END edr_error_by_hour_use_per_veh;
PROCEDURE edr_error_by_hour_data_type
in_report_parameter_id IN report_tasks.report_task_id%TYPE,
in_data_type IN VARCHAR2,
out_data_type_used OUT VARCHAR2
IS
my_bin_entry_count NUMBER(12,0);
my_veh_entry_count NUMBER(12,0);
BEGIN
IF(UPPER(in_data_type) = 'BINNED') THEN
-- Error information can only be read from Per Vehicle data records
-- - using bins-only is not a supported option
RAISE_APPLICATION_ERROR(-20101,'Binned data cannot be used for this report.');
ELSIF (UPPER(in_data_type) = 'PERVEHICLE')
OR (UPPER(in_data_type) = 'COMBINED')
THEN
out_data_type_used := 'Per Vehicle (All Vehicles)';
edr_error_by_hour_use_per_veh( in_report_parameter_id );
ELSE
RAISE_APPLICATION_ERROR(-20101, 'The data type specified is not recognized.');
END IF;
END edr_error_by_hour_data_type;
PROCEDURE edr_error_by_hour_get_veh_data
in_report_parameter_id IN NUMBER,
in_site_id IN NUMBER,
in_start_date_time IN TIMESTAMP,
in_end_date_time IN TIMESTAMP,
in_report_level_min IN NUMBER,
in_report_level_max IN NUMBER
IS
BEGIN
--Clear the edr_error_by_hour_veh_data temporary table and populate it with the data for the requested
--report.
DELETE FROM edr_error_by_hour_veh_data;
INSERT INTO edr_error_by_hour_veh_data
site_id,
site_lane_id,
record_id,
date_time,
vehicle_error_count,
vehicle_status
SELECT site_to_data_source_lane_v.site_id,
site_to_data_source_lane_v.site_lane_id,
traffic_record.record_id,
traffic_record.datetime,
NVL((SELECT COUNT(1)
FROM traffic_error
WHERE traffic_error.record_id = traffic_record.record_id), 0) vehicle_error_count,
NVL((SELECT SUM(status_code)
FROM traffic_status
WHERE traffic_status.record_id = traffic_record.record_id), 0) vehicle_status
FROM traffic_record
LEFT OUTER JOIN traffic_class
ON traffic_record.record_id = traffic_class.record_id
JOIN site_to_data_source_lane_v
ON traffic_record.data_source_id = site_to_data_source_lane_v.data_source_id
AND traffic_record.lane = site_to_data_source_lane_v.data_source_lane_id
JOIN edr_rpt_tmp_report_lanes
ON site_to_data_source_lane_v.site_lane_id = edr_rpt_tmp_report_lanes.site_lane_id
JOIN edr_rpt_tmp_report_classes
ON NVL(traffic_class.v_class, 0) = edr_rpt_tmp_report_classes.class_id
JOIN edr_rpt_tmp_inclusion_table
ON TRUNC(traffic_record.datetime) = TRUNC(edr_rpt_tmp_inclusion_table.date_time)
WHERE site_to_data_source_lane_v.site_id = in_site_id
AND traffic_record.datetime >= in_start_date_time
AND traffic_record.datetime < in_end_date_time
AND traffic_class.class_level >= in_report_level_min
AND traffic_class.class_level <= in_report_level_max;
END edr_error_by_hour_get_veh_data;
PROCEDURE edr_rpt_gen_error_by_hour
in_report_parameter_id IN report_tasks.report_task_id%TYPE,
c_count_or_perc IN VARCHAR2 ,
report_data OUT SYS_REFCURSOR,
chart_data OUT SYS_REFCURSOR,
footer_data OUT SYS_REFCURSOR
AS
my_date_format_mask VARCHAR2(50);
my_start_date_time TIMESTAMP;
my_end_date_time TIMESTAMP;
my_lane_grouping VARCHAR2(10);
my_interval_duration NUMBER(2);
my_site_id sites.site_id%TYPE;
my_selected_data_type VARCHAR2(50);
my_used_data_type VARCHAR2(50);
my_report_data_statement VARCHAR2(25000);
my_chart_data_statement VARCHAR2(25000);
my_good_weight_viol_total NUMBER(12,0);
my_data_type_used VARCHAR2(50);
my_per_vehicle_total NUMBER(12,0);
my_binned_vehicle_total NUMBER(12,0);
my_error_vehicle_total NUMBER(12,0);
my_status_vehicle_total NUMBER(12,0);
my_good_weight_total NUMBER(12,0);
my_status_clear_total NUMBER(12,0);
my_good_weight_statuses_mask NUMBER(12,0);
my_error_text VARCHAR2(25000);
my_total_text VARCHAR2(25000);
my_error_row_pct_report VARCHAR2(25);
BEGIN
my_date_format_mask := edr_rpt_generic_package.edr_rpt_get_date_format_mask(in_report_parameter_id);
my_start_date_time := edr_rpt_generic_package.edr_rpt_get_start_date_time(in_report_parameter_id, my_date_format_mask);
my_end_date_time := edr_rpt_generic_package.edr_rpt_get_end_date_time(in_report_parameter_id, my_date_format_mask);
my_lane_grouping := edr_rpt_generic_package.edr_rpt_get_lane_grouping(in_report_parameter_id);
my_site_id := edr_rpt_generic_package.edr_rpt_get_site_id(in_report_parameter_id);
my_selected_data_type := edr_rpt_generic_package.edr_rpt_get_data_type(in_report_parameter_id);
-- ensure selected classes and lanes temp tables have been populated
edr_rpt_generic_package.edr_rpt_gen_tmp_lanes(in_report_parameter_id);
edr_rpt_generic_package.edr_rpt_gen_tmp_classes(in_report_parameter_id);
my_good_weight_statuses_mask := edr_rpt_generic_package.get_good_weight_status_mask(in_report_parameter_id);
edr_rpt_generic_package.edr_rpt_gen_inclusion_table(
in_report_parameter_id,
my_date_format_mask,
my_start_date_time,
my_end_date_time
edr_rpt_generic_package.edr_rpt_gen_grouping_table(
in_report_parameter_id,
my_date_format_mask,
my_start_date_time,
my_end_date_time
edr_rpt_generic_package.gen_rpt_by_hour_output_table
in_report_parameter_id
edr_rpt_error_by_hour_package.edr_error_by_hour_get_veh_data
in_report_parameter_id,
my_site_id,
my_start_date_time,
my_end_date_time,
0, --Hardcoded until reclassification is supported.
0 --Hardcoded until reclassification is supported.
edr_rpt_error_by_hour_package.edr_error_by_hour_data_type
in_report_parameter_id,
my_selected_data_type,
my_used_data_type
IF (c_count_or_perc = 'ERROR BY HOUR') THEN
my_error_text := get_row_error_text;
my_total_text := get_row_total_text;
ELSE
my_error_text := get_row_error_text;
my_total_text := '';
DELETE edr_report_by_hour_output
WHERE row_type = 'Summary Row'
AND row_type = 'Final Row';
END IF;
COMMIT;
my_report_data_statement :=
'SELECT rank "Rank", '
|| ' ROW_TYPE "Row Type", '
|| ' interval_start_date_time "Date", '
|| ' interval_start_date_time, '
|| ' hour_label "Chart X-Axis", '
|| ' lane_id "Group Id" , '
|| ' ''None'' "Group Name", '
|| ' hour_label "Hour" '
|| my_error_text
|| my_total_text
|| ' FROM edr_report_by_hour_output '
|| ' ORDER BY lane_id, '
|| ' direction_id, '
|| ' interval_start_date_time, '
|| ' hour_end, '
|| ' rank, '
|| ' hour_start'
dbms_output.put_line('SQL start------------------------');
dbms_output.put_line(my_report_data_statement);
dbms_output.put_line('SQL end--------------------------');
my_chart_data_statement :=
' SELECT hour_start "X Axis", '
|| ' lane_id "Group" '
|| edr_rpt_error_by_hour_package.get_row_error_text
|| ' FROM '
|| ' ( '
|| ' SELECT lane_id, '
|| ' direction_id, '
|| ' hour_start, '
|| ' hour_end, '
|| ' min(interval_start_date_time) interval_start_date_time, '
|| ' max(interval_end_date_time) interval_end_date_time '
|| ' FROM edr_report_by_hour_output '
|| ' WHERE hour_end = hour_start + 1 '
|| ' GROUP BY lane_id, direction_id, hour_start, hour_end '
|| ' ) '
|| ' order by "Group", hour_start '
dbms_output.put_line('SQL start------------------------');
dbms_output.put_line(my_chart_data_statement);
dbms_output.put_line('SQL end--------------------------');
SELECT my_used_data_type
INTO my_data_type_used
FROM SYS.DUAL;
SELECT NVL(COUNT(record_id), 0)
INTO my_per_vehicle_total
FROM edr_error_by_hour_veh_data;
SELECT NVL(COUNT(record_id), 0)
INTO my_status_vehicle_total
FROM edr_error_by_hour_veh_data
WHERE vehicle_status > 0
AND vehicle_error_count = 0;
SELECT NVL(COUNT(record_id), 0)
INTO my_error_vehicle_total
FROM edr_error_by_hour_veh_data
WHERE vehicle_error_count > 0;
SELECT NVL(COUNT(record_id), 0)
INTO my_status_clear_total
FROM edr_error_by_hour_veh_data
WHERE vehicle_status = 0
AND vehicle_error_count = 0;
SELECT NVL(SUM(error_count), 0)
INTO my_binned_vehicle_total
FROM edr_error_by_hour_report_data;
SELECT NVL(COUNT(DISTINCT edr_error_by_hour_veh_data.record_id), 0)
INTO my_good_weight_total
FROM edr_error_by_hour_veh_data
WHERE vehicle_error_count = 0
AND BITAND(vehicle_status, my_good_weight_statuses_mask) = 0;
-- insert vehicle totals into the temporary table
DELETE FROM edr_rpt_tmp_veh_totals_table;
INSERT INTO edr_rpt_tmp_veh_totals_table
data_type_used,
per_vehicle_total,
binned_vehicle_total,
error_vehicle_total,
status_vehicle_total,
good_weight_total,
status_clear_total
SELECT my_data_type_used,
my_per_vehicle_total,
my_binned_vehicle_total,
my_error_vehicle_total,
my_status_vehicle_total,
my_good_weight_total,
my_status_clear_total
FROM SYS.DUAL;
-- execute the query into the output refcursor
OPEN report_data FOR
my_report_data_statement;
OPEN chart_data FOR
my_chart_data_statement;
OPEN footer_data FOR
SELECT data_type_used,
per_vehicle_total,
binned_vehicle_total,
error_vehicle_total,
status_vehicle_total,
good_weight_total,
status_clear_total
FROM edr_rpt_tmp_veh_totals_table;
END edr_rpt_gen_error_by_hour;
END edr_rpt_error_by_hour_package;
{code}Hi,
Thx for the reply.
As the store proc is inside the package and its invoked in visual studio.
I used to compile the pkg in SQL plus and it throws the error as ' wrong number or types of argument in a call to the stored proc 'edr_rpt_gen_error_by_hour'
As I'm new to pl/sql programming , i really dont know how to pass value to the input parameter.
Edited by: user10641405 on Nov 18, 2009 7:27 PM
Edited by: user10641405 on Nov 18, 2009 7:29 PM -
Different number of records in RSA3 for Full and INIT
Hi All,
I am about to load the data from 0FI_GL_4 and checked it in RSA3 for the number of records. It returned different number of records when I run the extract with options 'F' and 'C'. Why is it so? This is the first time I am loading the data into BW for this datasource. I would expect the number of records to be same if I do either a full extract or an init but surprised by seeing different number of records.
Best Regards,
James.Hi James,
Probably it's because of the time stamps stored in table BWOM2_TIMEST.
If you run a delta init and than a delta update then the number of the records should match with the record of the full update.
You can find some more info about table BWOM2_TIMEST here:
https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/a7f2f294-0501-0010-11bb-80e0d67c3e4a#527,7,Timestamp%20Mechanism:%20New%20documents
Bye,
Zsolt -
Number of Records in RSA3 for 0EC_PCA_1
Dear all,
I have installed data source 0EC_PCA_1 from content. Data for this data source is extracted from table GLPCT. When see at the table there are only 634 and number of records that are extracted from data source in RSA3 is 28203. I want to understand logic behind this or am I making any mistake.
On source system side we are ECC 6.0 and 'New GL' Functionality has been activated.
Request your help as usual.
Regards
SN DubeyYou can try the function module ECPCA_BIW_GET_DATA in order to see what really happens; but it could take some time since it depends a lot on your customizing: if you use special ledgers, the balance carry forward stuff and a lot more...
An you are correct: I thought straight forward about EC_PCA_3 (GLPCA) instead of EC_PCA_1 (GLPCT); my mistake, sorry for that.
In any case I cannot tell how it works in ECC.
regards -
Number of records in internal table
Hi
How can I tjeck an internal table for the number of records it contains (even if it contains 0).
Thanks in advance, regards
TorbenHi,
DESCRIBE TABLE itab.
Effect
Returns the attributes of the internal table itab. You must use at least one of the additions listed below:
Note
The DESCRIBE statement cannot be used for all ABAP types. In connection with ABAP Objects, SAP has introduced a RTTI concept based on system classes to determine type attributes at runtime. This concept applies to all ABAP types and as such covers all the functions of the DESCRIBE TABLE statement.
Extras:
1. ... LINES n
2. ... OCCURS n
3. ... KIND k
Addition 1
... LINES n
Effect
Places the number of filled lines of the table t in the field lin. The value returned to lin has type I.
Note
The number of filled lines of the table itab can also be ascertained using the predefined function lines( itab ).
Example
DATA: N TYPE I,
ITAB TYPE TABLE OF I.
CLEAR ITAB.
APPEND 36 TO ITAB.
DESCRIBE TABLE ITAB LINES N.
Result: N contains the value 1.
Addition 2
... OCCURS n
Effect
Passes the size of the OCCURS parameter from the table definition (as defined with DATA) to the variable n. The value returned to n has type I.
Example
DATA: N1 TYPE I,
N2 TYPE I,
ITAB1 TYPE TABLE OF I INITIAL SIZE 10,
ITAB2 TYPE I OCCURS 5.
DESCRIBE TABLE ITAB1 OCCURS N1.
DESCRIBE TABLE ITAB2 OCCURS N2.
Result: OCC contains the value 10 and N2 the value 5.
Addition 3
... KIND k
Effect
Writes the table type from itab to the variables n. The value returned to k is of type C. The constants SYDES_KIND-STANDARD, SYDES_KIND-SORTED and SYDES_KIND-HASHED are defined in the type group SYDES for the return values.
Example
Generic FORM routine any table type
TYPE-POOLS: SYDES.
FORM GENERIC_FORM USING ITAB TYPE ANY TABLE.
DATA: K TYPE C.
DESCRIBE TABLE ITAB KIND K.
CASE K.
WHEN SYDES_KIND-STANDARD.
WHEN SYDES_KIND-SORTED.
WHEN SYDES_KIND-HASHED.
ENDCASE.
ENDFORM.
Notes
Performance: The runtime for executing the DESCRIBE TABLE statement is approximately 4 msn (standardized microseconds).
The DESCRIBE TABLE statement also passes values to the SY-TFILL and SY-TLENG System fields
Additional help
Determining the Attributesof Internal Tables
Thanks,
Sankar M -
Number of records in setup tables
Hi all,
How do we find out the number of records extracted into setup tables ?
Thanks in advance
KiranHi Kiran,
You can check in the RSA3 for the data source.
In TA NPRT check for the no.of records and then cross check in SE16.
Assign points if it helps
Regards,
Sinivas
Message was edited by:
Srinivas
Message was edited by:
Srinivas -
Number of records in trail files
Hi,
I have a extract group which captures the change data from many source tables and gives one kind of trail files in different sequence number.
I would like to know the number of records per table in the trail files.I am not sure whether there is any log table which holds this information?
Regards,
AzimDear ,
Thanks for your reply.
Could you please tell me what kind of checkpoints?
Regards,
Azim -
Process Chains - number of records loaded in various targets
Hello
I have been trying to figure to access the metadata on the process chain log to extract information on the number of records loaded in various targets(Cubes/ODS/Infoobjects).
I have seen a few tables like RSMONICTAB, RSPCPROCESSLOG and RSREQICODS through various threads posted, however I would like to know whether there is any data model ( relationship structure beween these and other std. tables) so that I could seamless traverse through them to get the information I need.
In traditional ETL tools I would approach the problem :
> Load a particular sequence(in our case = BW Process chain) name into the program
> Extract the start time and end time information.
> Tranverse through all the objects of the sequence(BW Process chain)
> Check if the object is a data target
> If yes scan through the logs to extract the number of records loaded.
could I have a list of similar tables which I could traverse through ABAP code to extract such information?
Thanks in advanceHi Richa,
Please check these tables which may be very useful for you.
rsseldone,
rsdodso,
rsstatmanpsa,
rsds,
rsis,
rsdcube
I have got a abap code where you can get all the information for a particular request.
If you need more information goto ST13; select BI TOOLS and Execute.
hope this helps .....
Regards,
Ravi Kanth
Edited by: Ravi kanth on May 15, 2009 11:08 AM
Maybe you are looking for
-
Workflow Functional Specification Document
Hi All I am working on a implementation project which includes Workflows. Right now I am in the process of writing the functional specification document for the Workflows. I am a functional consultant and never worked on workflows. Can some one provi
-
hey guys, i made a program that counts any system with single character values (binary, ternary, octal, decimal,...etc) I am asking the user to input a starting point to count from and a stoping point to stop at. It starts from the correct place but
-
Fault cases identification using Sql query
Hi , i have data in below format.using below data to extract the fault cases. operator machine fromdate todate 1491 QC03 2014-09-02 02:51:00.000 2014-09-02 06:10:00.000 1427 QC03 2014-09-02 06:11:00.000 2014-09-02 07:17:00.000 1491 QC03 2014-09-02 11
-
Hi all, we would like to modify the HTML code of a template, inserting blinking words in the signature. We modified the HTML source but the recipients receives the email where the words supposed to blink don't blink. The added code is <span style="te
-
Why can't I find iPhoto?
MacPro G5, bought in o5. HD recently crashed. Replaced with new HD (larger) Now, when I went to reload all my software from the start through Tiger I can't seem to find iPhoto. ANYWHERE. And I can't find the first version online to reload to update a