Find count of matching records in vector
Hi All,
I read a file and write the values to a vector as below.
Japan version
Newzeland version
Australia version
Singapore version
China version
Japan version
Japan version
China version
I want to know how many times each line is repeated like below
Japan version found 3 time
Newzeland version found 1 time
China version found 2 times
Singapore version found 1 time
Any help on how to achieve this functionality is greatly appreciated.
Thanks
DevJoseph wrote:
I can use Map also. But, for Map i need to put like key value pairs. i dont know what are all the keys in the input.
Can you please help me either with pseudo code or an example?
Thanks
Let frequency be an empty map.
for each input string s:
if frequency contains key s
increment its count
else
put new entry (s, 1) into frequency map
Similar Messages
-
How to find count of records based on batch wise.
Hi All,
We are working on OWB10gr2. I would like share one requirement. Any one can suggest me how to do it and which is the best way to get accurate information.
We have 2 schemas’ like nia_src and nia_tgt. currently we are moving data from nia_src to nia_tgt for that reason we implemented some mappings based on requirement. In my source schema (nia_src) having 100 tables with data and similar structure replicated in target schema (nia_tgt).
In source schema every table having one date field for which record is inserted and based on that field we can find how may records are inserted on particular table ,particular time.
Same like target also maintaining date fields for tracking purposes.
We have done some mappings and scheduled also. Every day we are into the target with incremental data. All are working fine not any issues.
I wanted to know how many records inserted, updated, merged for particular batch
How can we find?
Can we find exact information in OWB_REP_OWNER schema on WB_RT_AUDIT?.
For tracking purposes I need to find those values how many records are available in
Source table and how many records are populated to the target schema?
How to find schedule batch count of records table wise for batch wise?
Please suggest me any one on this.
thanks and regards,
venkat.RE: based on pre operator can we find count of records. if yes how to do it.
No, you cannot tell from the pre- operator how many records will be inserted or updated into a mapping. How could you? The mapping hasn't run yet!
At best (if you have simple mappings with single targets) you could come up with a strategy to have the pre-mapping procedure aware of it's package name, then select from user_source for that package body until you find that first cursor used for the row-based processing, copy the cursor into a local variable, and then execute immediate select count(*) from that cursor definition. But still, all that would get you is the number of rows selected - not inserted / updated / errored etc.
A post-mapping procedure that is aware of the package name will, however, run prior to package exit so that the package spec is still in memory so you can access the public variables in the package spec. We do that in our standard post-mapping procedure
CREATE OR REPLACE procedure erscntrl_finalize_prc(
p_process_id in number,
p_process_name in varchar2)
as
l_numread number := 0;
l_numInserted number := 0;
l_numUpdated number := 0;
l_numMerged number := 0;
l_owb_audit_id number := 0;
l_owb_status number := 0;
sqlStmt varchar2(2000) :=
'begin '||
' :1 := '||p_process_name||'.get_selected; '||
' :2 := '||p_process_name||'.get_inserted; '||
' :3 := '||p_process_name||'.get_updated; '||
' :4 := '||p_process_name||'.get_merged; '||
' :5 := '||p_process_name||'.get_audit_id; '||
' :6 := '||p_process_name||'.get_status; '||
' end;';
begin
-- we use dynamic SQL to return required audit field values.
-- This allows us to alter which values we need at a later date
-- without impacting the deployed mappings.
execute immediate sqlStmt
using out l_numread, out l_numInserted, out l_numUpdated,
out l_numMerged, out l_owb_audit_id, out l_owb_status;
-- then execute our own logging package.
owb_mapping_log_pkg.finalize(
p_process_id,
p_process_name,
l_numread,
l_numInserted,
l_numUpdated,
l_numMerged,
l_owb_audit_id,
l_owb_status
end;
/However, even in this case bear in mind that if you run the mapping in set-base mode, all Oracle returns is the number merged which does not give values for the inserted and updated counts. If you really need those values you need to either a) run in row-based mode or row-based-target-only, or come up with some custom queries. For example, in your pre-mapping do a select count(*) from your_target_table, then run the mapping, then get the number merged, then do another select count(*) from your_target_table. With these values and basic math you could tell the number inserted by the growth in the table, and the rest of the number merged must have been updates.
That being said, if you are playing with dimensions as large as most of the ones I am - there is no bloody way that you want to do two select count(*) statements on each run without a really, really good reason.....
Cheers,
Mike -
To find matching records across two tables
Hi folks,
I have a question regarding modifying the query. I am trying to compare the data between two tables, there are matching records in two tables, but are not in the same order. How to modify the query so that it finds the matching record between the two tables?
Here is my code
loop at itab_A.
read table itab_B with key
employeenumber = itab_zmgr_training-empid binary search.
if sy-subrc = 0.
Any thoughts?
Thanks,
Sk
Here I am getting the return value as '4'I have tried all that, but why is it that while reading a record from itab_B I see no record in the header line,
Let me paste the entire code of what I am trying to achieve.
data: itab_A like A occurs 0 with header line.
data: itab_B like B occurs 0 with header line.
some validation.....
loop at itab_A.
read table itab_B with key employee number = empid binary search.
if sy-subrc =0.
per form validation.
else.
perform validation.
endif.
endloop.
My observation: while reading recrod from itab_B the header line is clear, no record is read here hence sy-subrc = 0.
How can I correct this? Since it is not reading any record from itab_B no matching record is found.
Any thoughts would be really helpful.
Thanks,
Santhosh. -
Record count not matching when using HS while querying.
Hello,
We are using 10gr2.
I created a Database link connecting to lotus notes using HETROGENEOUS SERVICES and ODBC.
When we query the table in Lotus Notes using database link oracle is showing less records.
For example.
Lotus Notes database have a table which contains 873 records.
When we query this table from oracle we are getting the count of 722 records.
Any ideas why this is happening.
Thank you for the help.
Regards
Seshadri ThopeOracle Corporation --- THURSDAY JAN 29 2009 10:34:23.786
Heterogeneous Agent Release
10.2.0.4.0
(0) hoagprd (2): ; hoagprd Entered.
(0) HOACONN.C (270): ; [Generic Connectivity Using ODBC] version: 10.2.0.0.0080
(0) HOACONN.C (323): ; Class version: 300
(0) hoagprd (2): ; hoagprd Exited with retcode = 0.
(0) hoainit (3): ; hoainit Entered.
(0) (0): ; connect string is: defTdpName=DATABASEA;SYNTAX=(ORACLE8_HOA, BASED_ON=ORACLE8, IDENTIFIER_QUOTE_CHAR="", CASE_SENSITIVE=CASE_SENSITIVE_QUOTE);BINDING=<navobj><binding><datasources><datasource name='DATABASEA' type='ODBC' connect='socrates'><driverProperties disableExtendedFetch='true'/></datasource></datasources><remoteMachines/><environment><optimizer noFlattener='true'/><misc year2000Policy='-1' consumerApi='1' codepage='WE8ISO8859P15' sessionBehavior='4'/><queryProcessor parserDepth='2000' tokenSize='1000' noInsertParameterization='true'
noThreadedReadAhead='true' noCommandReuse='true'/><debug generalTrace='true'/></environment></binding></navobj>
(0) ORACLE GENERIC GATEWAY Log File Started at 2009-01-29T10:34:24
(0)
(0) hoainit (3): ; hoainit Exited with retcode = 0.
(0) hoalgon (7): ; hoalgon Entered. name = .
(0) Created new ODBC connection (32056720)
(0) hoalgon (7): ; hoalgon Exited with retcode = 0.
(0) hoaulcp (4): ; hoaulcp Entered.
(0) hoaulcp (4): ; hoaulcp Exited with retcode = 0.
(0) hoauldt (5): ; hoauldt Entered.
(0) hoauldt (5): ; hoauldt Exited with retcode = 0.
(0) hoabegn (9): ; hoabegn Entered. formatID = 306206, hoagttln = 38, hoagttid = DATABASEA.e53cf895.2.35.27286, hoagtbln = 10, hoagtbid = , tflag = 0, initial = 1
(0) hoabegn (9): ; hoabegn Exited with retcode = 0.
(0) hoadtab (26): ; hoadtab Entered. count = 1
(0) hoadtab (26): ; schema_name = , table_name = TABLEA
(0) odbc_rec: select * from "TABLEA"
(0) nvOUT (D:\Work_Builds\connect_5010\src\qp\QP_SQTXT.C 89): select NON_UNIQUE, INDEX_NAME, TYPE, SEQ_IN_INDEX, COLLATION, CARDINALITY, COLUMN_NAME from NAV_PROC:SP_STATISTICS('DATABASEA', '%', 'TABLEA', 1, 0, 0) order by 3, 1, 2, 4
(0) nvRETURN (D:\Work_Builds\connect_5010\src\qp\qpsynon.c 1171): -1
(0) <<<<<<<<<<<<<<<<<<< Execution Strategy Begin <<<<<<<<<<<<<<<<<<<<<<<<<<<<
(0) Original SQL:
(0) select NON_UNIQUE , INDEX_NAME , TYPE , SEQ_IN_INDEX , COLLATION , CARDINALITY , COLUMN_NAME from NAV_PROC : SP_STATISTICS ( 'DATABASEA' , '%' , 'TABLEA' , 1 , 0 , 0 ) order by 3 , 1 , 2 , 4
(0)
(0)
(0) Accessing saved query spec SP_STATISTICS()
(0) from NAV_PROC DB
(0)
Execution Strategy End >>>>>>>>>>>>>>>>>>>>>>>>>>>>(0) HOAUTIL.C (1284): ; ------ hoadtab (hoat) -------:
(0) HOAUTIL.C (1287): ; hoatnam: TABLEA, hoatnml: 20, hoatnrw: 711, hoatarl: 110000
(0) HOAUTIL.C (1298): ; ------ hoadtab (hoai) -------:
(0) HOAUTIL.C (1299): ; n_index_stat: 0
(0) HOAUTIL.C (1249): ; -------- hoadtab for table TABLEA---------:
(0) HOAUTIL.C (1250): ; hoadamsz: 22, hoadasiz: 22, hoadambr: 1, hoadabrc: 0, hoadawht: 5
(0) HOAUTIL.C (1253): ; row 0 - hoadambl: 4000, hoadadty: 108, hoadaprc: 0, hoadacst: 0
(0) HOAUTIL.C (1257): ; row 0 - hoadascl: 0, hoadanul: 1, hoadanml: 7, hoadanam: Subject, hoadabfl: 4000, hoadamod: 0
(0) HOAUTIL.C (1253): ; row 1 - hoadambl: 4000, hoadadty: 108, hoadaprc: 0, hoadacst: 0
(0) HOAUTIL.C (1257): ; row 1 - hoadascl: 0, hoadanul: 1, hoadanml: 11, hoadanam: DateCreated, hoadabfl: 4000, hoadamod: 0
(0) HOAUTIL.C (1253): ; row 2 - hoadambl: 4000, hoadadty: 108, hoadaprc: 0, hoadacst: 0
(0) HOAUTIL.C (1257): ; row 2 - hoadascl: 0, hoadanul: 1, hoadanml: 18, hoadanam: CustomerFacingUnit, hoadabfl: 4000, hoadamod: 0
(0) HOAUTIL.C (1253): ; row 3 - hoadambl: 4000, hoadadty: 108, hoadaprc: 0, hoadacst: 0
(0) HOAUTIL.C (1257): ; row 3 - hoadascl: 0, hoadanul: 1, hoadanml: 12, hoadanam: OFFERNUMBERS, hoadabfl: 4000, hoadamod: 0
(0) HOAUTIL.C (1253): ; row 4 - hoadambl: 4000, hoadadty: 108, hoadaprc: 0, hoadacst: 0
(0) HOAUTIL.C (1257): ; row 4 - hoadascl: 0, hoadanul: 1, hoadanml: 13, hoadanam: textedPricing, hoadabfl: 4000, hoadamod: 0
(0) HOAUTIL.C (1253): ; row 5 - hoadambl: 4000, hoadadty: 108, hoadaprc: 0, hoadacst: 0
(0) HOAUTIL.C (1257): ; row 5 - hoadascl: 0, hoadanul: 1, hoadanml: 22, hoadanam: textedShortDescription, hoadabfl: 4000, hoadamod: 0
(0) HOAUTIL.C (1253): ; row 6 - hoadambl: 4000, hoadadty: 108, hoadaprc: 0, hoadacst: 0
(0) HOAUTIL.C (1257): ; row 6 - hoadascl: 0, hoadanul: 1, hoadanml: 21, hoadanam: textedLongDescription, hoadabfl: 4000, hoadamod: 0
(0) HOAUTIL.C (1253): ; row 7 - hoadambl: 4000, hoadadty: 108, hoadaprc: 0, hoadacst: 0
(0) HOAUTIL.C (1257): ; row 7 - hoadascl: 0, hoadanul: 1, hoadanml: 14, hoadanam: textedBenefits, hoadabfl: 4000, hoadamod: 0
(0) HOAUTIL.C (1253): ; row 8 - hoadambl: 4000, hoadadty: 108, hoadaprc: 0, hoadacst: 0
(0) HOAUTIL.C (1257): ; row 8 - hoadascl: 0, hoadanul: 1, hoadanml: 18, hoadanam: textedAboutAuthors, hoadabfl: 4000, hoadamod: 0
(0) HOAUTIL.C (1253): ; row 9 - hoadambl: 4000, hoadadty: 108, hoadaprc: 0, hoadacst: 0
(0) HOAUTIL.C (1257): ; row 9 - hoadascl: 0, hoadanul: 1, hoadanml: 13, hoadanam: textedContent, hoadabfl: 4000, hoadamod: 0
(0) HOAUTIL.C (1253): ; row 10 - hoadambl: 4000, hoadadty: 108, hoadaprc: 0, hoadacst: 0
(0) HOAUTIL.C (1257): ; row 10 - hoadascl: 0, hoadanul: 1, hoadanml: 23, hoadanam: textedDiffByMedia_Print, hoadabfl: 4000, hoadamod: 0
(0) HOAUTIL.C (1253): ; row 11 - hoadambl: 4000, hoadadty: 108, hoadaprc: 0, hoadacst: 0
(0) HOAUTIL.C (1257): ; row 11 - hoadascl: 0, hoadanul: 1, hoadanml: 20, hoadanam: textedDiffByMedia_CD, hoadabfl: 4000, hoadamod: 0
(0) HOAUTIL.C (1253): ; row 12 - hoadambl: 4000, hoadadty: 108, hoadaprc: 0, hoadacst: 0
(0) HOAUTIL.C (1257): ; row 12 - hoadascl: 0, hoadanul: 1, hoadanml: 26, hoadanam: textedDiffByMedia_Internet, hoadabfl: 4000, hoadamod: 0
(0) HOAUTIL.C (1253): ; row 13 - hoadambl: 4000, hoadadty: 108, hoadaprc: 0, hoadacst: 0
(0) HOAUTIL.C (1257): ; row 13 - hoadascl: 0, hoadanul: 1, hoadanml: 23, hoadanam: textedDiffByMedia_Other, hoadabfl: 4000, hoadamod: 0
(0) HOAUTIL.C (1253): ; row 14 - hoadambl: 4000, hoadadty: 108, hoadaprc: 0, hoadacst: 0
(0) HOAUTIL.C (1257): ; row 14 - hoadascl: 0, hoadanul: 1, hoadanml: 10, hoadanam: BookStatus, hoadabfl: 4000, hoadamod: 0
(0) HOAUTIL.C (1253): ; row 15 - hoadambl: 4000, hoadadty: 108, hoadaprc: 0, hoadacst: 0
(0) HOAUTIL.C (1257): ; row 15 - hoadascl: 0, hoadanul: 1, hoadanml: 9, hoadanam: Published, hoadabfl: 4000, hoadamod: 0
(0) HOAUTIL.C (1253): ; row 16 - hoadambl: 4000, hoadadty: 108, hoadaprc: 0, hoadacst: 0
(0) HOAUTIL.C (1257): ; row 16 - hoadascl: 0, hoadanul: 1, hoadanml: 4, hoadanam: ISBN, hoadabfl: 4000, hoadamod: 0
(0) HOAUTIL.C (1253): ; row 17 - hoadambl: 4000, hoadadty: 108, hoadaprc: 0, hoadacst: 0
(0) HOAUTIL.C (1257): ; row 17 - hoadascl: 0, hoadanul: 1, hoadanml: 5, hoadanam: Pages, hoadabfl: 4000, hoadamod: 0
(0) HOAUTIL.C (1253): ; row 18 - hoadambl: 4000, hoadadty: 108, hoadaprc: 0, hoadacst: 0
(0) HOAUTIL.C (1257): ; row 18 - hoadascl: 0, hoadanul: 1, hoadanml: 7, hoadanam: Binding, hoadabfl: 4000, hoadamod: 0
(0) HOAUTIL.C (1253): ; row 19 - hoadambl: 4000, hoadadty: 108, hoadaprc: 0, hoadacst: 0
(0) HOAUTIL.C (1257): ; row 19 - hoadascl: 0, hoadanul: 1, hoadanml: 11, hoadanam: ProductSize, hoadabfl: 4000, hoadamod: 0
(0) HOAUTIL.C (1253): ; row 20 - hoadambl: 4000, hoadadty: 108, hoadaprc: 0, hoadacst: 0
(0) HOAUTIL.C (1257): ; row 20 - hoadascl: 0, hoadanul: 1, hoadanml: 12, hoadanam: DateModified, hoadabfl: 4000, hoadamod: 0
(0) HOAUTIL.C (1253): ; row 21 - hoadambl: 4000, hoadadty: 108, hoadaprc: 0, hoadacst: 0
(0) HOAUTIL.C (1257): ; row 21 - hoadascl: 0, hoadanul: 1, hoadanml: 15, hoadanam: ProductItemCode, hoadabfl: 4000, hoadamod: 0
(0) hoadtab (26): ; hoadtab Exited with retcode = 0.
(0) hoadafr (23): ; hoadafr Entered. id = 0.
(0) hoadafr (23): ; hoadafr Exited with retcode = 0.
(0) hoapars (15): ; hoapars Entered. stmtType = 0, id = 1.
(0) nvOUT (D:\Work_Builds\connect_5010\src\qp\QP_SQTXT.C 89): SELECT COUNT(*) FROM "TABLEA" A1
(0) nvRETURN (D:\Work_Builds\connect_5010\src\qp\qpsynon.c 1171): -1
(0) SELECT COUNT(*) AS c000 FROM "TABLEA" "A1"
(0)
(0) <<<<<<<<<<<<<<<<<<< Execution Strategy Begin <<<<<<<<<<<<<<<<<<<<<<<<<<<<
(0) Original SQL:
(0) SELECT COUNT ( * ) FROM "TABLEA" A1
(0)
(0)
(0) Accessing Database 'DATABASEA' with SQL:
(0) SELECT COUNT(*) AS c000 FROM "TABLEA" "A1"
(0)
(0)
Execution Strategy End >>>>>>>>>>>>>>>>>>>>>>>>>>>>(0) hoapars (15): ; hoapars Exited with retcode = 0.
(0) hoaopen (19): ; hoaopen Entered. id = 1.
(0) hoaopen (19): ; hoaopen Exited with retcode = 0.
(0) hoadscr (16): ; hoadscr Entered. id = 1.
(0) hoastmt.c (304): ; Array fetch size is: 1.
(0) HOAUTIL.C (1249): ; ------ hoadscr() -------:
(0) HOAUTIL.C (1250): ; hoadamsz: 1, hoadasiz: 1, hoadambr: 1, hoadabrc: 1, hoadawht: 5
(0) HOAUTIL.C (1253): ; row 0 - hoadambl: 4, hoadadty: 8, hoadaprc: 10, hoadacst: 0
(0) HOAUTIL.C (1257): ; row 0 - hoadascl: 0, hoadanul: 1, hoadanml: 8, hoadanam: $$CALC_1, hoadabfl: 4, hoadamod: 0
(0) hoadscr (16): ; hoadscr Exited with retcode = 0.
(0) hoaftch (21): ; hoaftch Entered. id = 1.
(0) apiutil.c (0): ; hoaftch()::
(0) apiutil.c (0): ; Column 0 - pszName: $$CALC_1, size: 4, id: 8, width: 0, scale: 0, flags: 12.
(0) SELECT COUNT(*) AS c000 FROM "TABLEA" "A1"
(0)
(0) hoaftch (21): ; hoaftch Exited with retcode = 0, hoadabrc = 1.
(0) hoaftch (21): ; hoaftch Entered. id = 1.
(0) hoaftch (21): ; hoaftch Exited with retcode = 1403, hoadabrc = 0.
(0) hoaclse (22): ; hoaclse Entered. id = 1.
(0) hoaclse (22): ; hoaclse Exited with retcode = 0.
(0) hoadafr (23): ; hoadafr Entered. id = 1.
(0) hoadafr (23): ; hoadafr Exited with retcode = 0.
(0) hoacomm (11): ; hoacomm Entered. keepinfo = FALSE, tflag = 1.
(0) hoacomm (11): ; hoacomm Exited with retcode = 0.
(0) hoalgof (8): ; hoalgof Entered. tflag = 1.
(0) hoalgof (8): ; hoalgof Exited with retcode = 0.
(0) hoaexit (6): ; hoaexit Entered.
(0) hoaexit (6): ; hoaexit Exited with retcode = 0.
(0) (0): ; Closing log file at THU JAN 29 10:38:55 2009. -
How to find the number of records per months in cube
Hi,
how to find the number of records per months for my all cubes?
Can i use the ListCube transaction to find totl number f records per cube monthwise ?
JimmyHi,
Here is a program to generate no of records and list of ODS and Cubes in Active version.Schedule this program in background and create a cube to load this information and schedule to the data from the file generated by the program. Schedule this all per you requirement.
1.Copy the code into your Z<programname> from Se38.
2.change the FILENAME in CALL FUNCTION 'GUI_DOWNLOAD' in the program to the location from where you can pick the information to load data to cube(eg Application server).
3.Save program.
4.Schedule the program in background as required
5.Create cube with infoobjects to hold no of records and Infoprovider name
6.Load this cube based on event after the program job is done.
Hence you can report on this cube to see no of records in CUBE or ODS in your box.
Please find the code below.
Cheers,
Kavitha Kamesh.
types: begin of itabs ,
tabname type dd02l-tabname,
end of itabs.
data: itab type itabs occurs 0 with header line.
data: counter type i.
data: begin of itab1 occurs 0,
tabname type dd02l-tabname,
counter type i,
end of itab1.
DATA: ITABTABNAME TYPE STRING.
DATA: LENGTH TYPE I.
DATA: OBJECT(30).
data: str(6) type c.
select tabname from dd02l into table itab where ( tabname LIKE '/BIC/F%' or tabname LIKE '/BIC/A%00' )
and TABCLASS = 'TRANSP' and AS4LOCAL = 'A'.
loop at itab.
select count(*) from (itab-tabname) into counter.
str = itab-tabname.
if str = '/BIC/F'.
LENGTH = STRLEN( ITAB-TABNAME ).
SHIFT itab-tabname BY 6 PLACES LEFT.
ELSEIf str = '/BIC/A'.
SHIFT itab-tabname BY 6 PLACES LEFT.
LENGTH = STRLEN( ITAB-TABNAME ).
LENGTH = LENGTH - 2.
endif.
itab1-tabname = itab-tabname(LENGTH).
append itab1.
itab1-counter = counter.
clear itab-tabname.
clear: COUNTER.
endloop.
*********** itab1
loop at itab1.
write:/ itab1-tabname, itab1-counter.
endloop.
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
* BIN_FILESIZE =
FILENAME = 'c:records.xls'
FILETYPE = 'ASC'
* APPEND = ' '
WRITE_FIELD_SEPARATOR = ','
* HEADER = '00'
* TRUNC_TRAILING_BLANKS = ' '
* WRITE_LF = 'X'
* COL_SELECT = ' '
* COL_SELECT_MASK = ' '
* DAT_MODE = ' '
* CONFIRM_OVERWRITE = ' '
* NO_AUTH_CHECK = ' '
* CODEPAGE = ' '
* IGNORE_CERR = ABAP_TRUE
* REPLACEMENT = '#'
* WRITE_BOM = ' '
* TRUNC_TRAILING_BLANKS_EOL = 'X'
* WK1_N_FORMAT = ' '
* WK1_N_SIZE = ' '
* WK1_T_FORMAT = ' '
* WK1_T_SIZE = ' '
* IMPORTING
* FILELENGTH =
TABLES
DATA_TAB = itab1
* FIELDNAMES =
* EXCEPTIONS
* FILE_WRITE_ERROR = 1
* NO_BATCH = 2
* GUI_REFUSE_FILETRANSFER = 3
* INVALID_TYPE = 4
* NO_AUTHORITY = 5
* UNKNOWN_ERROR = 6
* HEADER_NOT_ALLOWED = 7
* SEPARATOR_NOT_ALLOWED = 8
* FILESIZE_NOT_ALLOWED = 9
* HEADER_TOO_LONG = 10
* DP_ERROR_CREATE = 11
* DP_ERROR_SEND = 12
* DP_ERROR_WRITE = 13
* UNKNOWN_DP_ERROR = 14
* ACCESS_DENIED = 15
* DP_OUT_OF_MEMORY = 16
* DISK_FULL = 17
* DP_TIMEOUT = 18
* FILE_NOT_FOUND = 19
* DATAPROVIDER_EXCEPTION = 20
* CONTROL_FLUSH_ERROR = 21
* OTHERS = 22
IF SY-SUBRC <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF. -
How to find the number of records in ods?
how to find the number of records in ods?
Pls suggest the solution apart going to the table of ods and seeing the number of records.
Is there any program or function module to see the number of records in ods?
For eg: SAP_INFOCUBE_DESIGNS is a program which gives the detail (number of records) of infocube.Hi,
I was looking at this and found the following tables that may be of help.
One of these tables will include a summary of the record count of all the tables in your system based on the last time each table had it's database statistics calculated:
DBSTATTADA
DBSTATTDB2
DBSTATTDB4
DBSTATTDB6
DBSTATTINF
DBSTATTMSS
DBSTATTORA
We run on an Oracle database so the table record counts can be taken from DBSTATTORA. Type in AZ in table selection field in SE16 to restrict the output to ODS (or DSO) tables only.
The record count is at the time indicated in the timestamp field. Obviously this is not real time but should not be too out of date - if it is you may be having performance issues and should get your DBA / Basis to run a full refresh of DB stats.
Hope this helps, alhtough not real time the table should give you a decent indication of the size of all your ODS objects (or any other table for that matter!) -
How to count number of records for a field based on condition?
Hi guys,
I want to know how to find count of records coming from the database for a particular field based on some condition.
I need to use this count to suppress some headers. Because of this i am not able to use running totals. Is there any other way?
Ex scenario:
I have account number and currency fields, those are coming from database. And i need to count the number of accounts whose currency is not Euro.
Thanks in advance,
Vijay.A simple formula can do that:
//Formula begin
if {your account field}<>"Euro" then 1
//Formula end
This formula can be summarized. (by group or report)
Bryan Tsou@Taiwan -
How do you search for a partial match in a vector table?
Hi,
I have a program that parses some table of mine into a vector table. It has a search function in the program that is intended to search the vector table for a specified keyword that the user enters. If a match is found, it returns true. If no match is found, false is returned.
That part works great. However, I would like my program to search the vector table to try and find a PARTIAL match of the users entry, instead of looking for a complete match.
Currently my program uses the Vector method 'contains(Object elem)' to find the complete matches and that part works great. It doesn't seem to work with partial matches. Either the exact syntax of the user's entry is in the table or it isn't.
Hope I was clear enough. Any thoughts?
Cheers,
the sherlockYou might find this code of interest. It uses the same commands as mentioned previously, but wraps them into a Comparator object. Note that you can't store elements with '*' in the Vector 'v' and that you must sort the elements with Collections.sort() beforehand.
import java.util.*;
class WildcardComparator implements Comparator
public int compare(Object o1, Object o2)
String string1 = (String)o1;
String string2 = (String)o2;
if(string2.indexOf("*") != -1) {
// take off asterik
return wildcardCompare(string1,
string2.substring(0, string2.length()-1));
return string1.compareTo(string2);
public int wildcardCompare(String s1, String key_s) {
String s1substring = s1.substring(0, key_s.length());
return s1substring.compareTo(key_s);
public class wildcard
public static void main(String[] args)
Vector v = new Vector();
v.add("coke");
v.add("pepsi");
v.add("7-up");
v.add("a&w root beer");
v.add("a&w cream");
Collections.sort(v, new WildcardComparator());
String key = "a&w*";
int index = Collections.binarySearch(v,
key,
new WildcardComparator());
if(index > 0)
System.out.println("elem: " + v.get(index));
else
System.out.println("item not found");
key = "c*";
index = Collections.binarySearch(v,
key,
new WildcardComparator());
if(index > 0)
System.out.println("elem: " + v.get(index));
else
System.out.println("item not found");
} -
No Matching records found (OACT) - A/P Credit Memo
Hi Experts
When i try to post an A/P Credit memo, SAP B1 gives an error No Matching records found (OACT). i checked all the account determination. could not find anything any suggestions to solve this problem.
Thanks in advance
Kanishka WickramaHi Kanishka,
in addtion to the ususal accounts necessary for transactions involving stock you also need to define the Sales & Purchase credit accounts. Also, you might check whether there is a freight charge that needs to be credited or if a different tax code is used. Even if the tax rate is zero, the application will look for an account to be defined.
There could be a multitude of other reasons which are documented in the EES : GL Account missing, which is available [here|https://psd.sap-ag.de/PEC/calendar/html/recording.php?hck=3163a8d6a4540ecf1794ece0245f291154d30e1080359d2e994ef79c1a469aa0cd808769d9c7ee30ca342c6803d2ebcec3eb71a928d6db187dfb1fc2cf640395].
All the best,
Kerstin -
How to find out no. of records or repeating frame in a page
Hi All,
How do I find out how many records have been displayed on a particular page?
I'm having a repeating frame, and I want to know print another item, on a condition that if the records printed on the page are less than 5 then it should be printed otherwise not.
The item to be printed is not a part of the repeating frame whoz occurences have to be counted.
Regards
NaveenHi Naveen
You can create a Packaged varaible that acts as
global variable , and you can increment this
variable in the repeating frames Format Trigger .
Based on the value of the variable , you can
return true or false for the item that you want to
display . -
Hi ,
How to find out the latest Record in per_all_people_f and per_all_assignments_f
Requirement : Need to find out the latest record in per_all_people_f and per_all_assignments_f to update the attribute column with pre defined value . Its not possible to track only with person_id / assignment_id and effective end date
SELECT pp_id
FROM (SELECT app.person_id pp_id,
asf.*
FROM apps.per_all_people_f app,
apps.per_all_assignments_f asf
WHERE --app.person_id=123568 and
asf.person_id = app.person_id AND
app.effective_end_date = to_date('31-dec-4712') AND
asf.effective_end_date = to_date('31-dec-4712')
GROUP BY app.person_id)
HAVING COUNT(pp_id) > 1
GROUP BY pp_id
This query also returns more than 1 value for person_id .
It would be great if you put comment on this .. Thanks in advance ,
AryaI am getting more records with asf.primary_flag='Y' . If you give ur mail id , i will send the sample data
ASSIGNMENT_ID EFFECTIVE_START_DATE EFFECTIVE_END_DATE BUSINESS_GROUP_ID RECRUITER_ID GRADE_ID POSITION_ID JOB_ID ASSIGNMENT_STATUS_TYPE_ID PAYROLL_ID LOCATION_ID PERSON_REFERRED_BY_ID SUPERVISOR_ID SPECIAL_CEILING_STEP_ID PERSON_ID RECRUITMENT_ACTIVITY_ID SOURCE_ORGANIZATION_ID ORGANIZATION_ID PEOPLE_GROUP_ID SOFT_CODING_KEYFLEX_ID VACANCY_ID PAY_BASIS_ID ASSIGNMENT_SEQUENCE ASSIGNMENT_TYPE PRIMARY_FLAG APPLICATION_ID ASSIGNMENT_NUMBER CHANGE_REASON COMMENT_ID DATE_PROBATION_END DEFAULT_CODE_COMB_ID EMPLOYMENT_CATEGORY FREQUENCY INTERNAL_ADDRESS_LINE MANAGER_FLAG NORMAL_HOURS PERF_REVIEW_PERIOD PERF_REVIEW_PERIOD_FREQUENCY PERIOD_OF_SERVICE_ID PROBATION_PERIOD PROBATION_UNIT SAL_REVIEW_PERIOD SAL_REVIEW_PERIOD_FREQUENCY SET_OF_BOOKS_ID SOURCE_TYPE TIME_NORMAL_FINISH TIME_NORMAL_START BARGAINING_UNIT_CODE LABOUR_UNION_MEMBER_FLAG HOURLY_SALARIED_CODE REQUEST_ID PROGRAM_APPLICATION_ID PROGRAM_ID PROGRAM_UPDATE_DATE ASS_ATTRIBUTE_CATEGORY ASS_ATTRIBUTE1 ASS_ATTRIBUTE2 ASS_ATTRIBUTE3 ASS_ATTRIBUTE4 ASS_ATTRIBUTE5 ASS_ATTRIBUTE6 ASS_ATTRIBUTE7 ASS_ATTRIBUTE8 ASS_ATTRIBUTE9 ASS_ATTRIBUTE10 ASS_ATTRIBUTE11 ASS_ATTRIBUTE12 ASS_ATTRIBUTE13 ASS_ATTRIBUTE14 ASS_ATTRIBUTE15 ASS_ATTRIBUTE16 ASS_ATTRIBUTE17 ASS_ATTRIBUTE18 ASS_ATTRIBUTE19 ASS_ATTRIBUTE20 ASS_ATTRIBUTE21 ASS_ATTRIBUTE22 ASS_ATTRIBUTE23 ASS_ATTRIBUTE24 ASS_ATTRIBUTE25 ASS_ATTRIBUTE26 ASS_ATTRIBUTE27 ASS_ATTRIBUTE28 ASS_ATTRIBUTE29 ASS_ATTRIBUTE30 LAST_UPDATE_DATE LAST_UPDATED_BY LAST_UPDATE_LOGIN CREATED_BY CREATION_DATE TITLE OBJECT_VERSION_NUMBER
931510 7-Nov-08 31-Dec-12 122 (null) (null) (null) 3978 1 (null) 14402 (null) 220150 (null) 734956 (null) (null) 476 (null) (null) (null) (null) 2 E Y (null) 100035417-2 (null) (null) (null) 45948739 (null) (null) (null) (null) (null) (null) (null) 868007 (null) (null) (null) (null) 449 (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null)
797386 26-Aug-08 26-Aug-08 122 (null) (null) (null) 3980 3 (null) 14402 (null) 218925 (null) 734956 (null) (null) 476 (null) (null) (null) (null) 1 E Y (null) 100035417 (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) 740071 (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null)
916076 26-Aug-08 31-Dec-12 122 (null) (null) (null) 3980 1 4 14402 (null) 218925 (null) 734956 (null) (null) 476 (null) (null) (null) (null) 1 B Y (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null)
797386 25-Feb-08 25-Aug-08 122 (null) (null) (null) 3980 1 (null) 14402 (null) 218925 (null) 734956 (null) (null) 476 (null) (null) (null) (null) 1 E Y (null) 100035417 (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) 740071 (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) -
Payment wizard -No matching records found 'Bank Codes' (ODSC) (ODBC -2028)
Hello dear experts,
I'm trying to execute the payment wizard to receive a payment from a vendor
The invoice appears in the recommendation report but the payment isn't added when i execute the payment run.
It appears after that in the Non-Included transactions with the following error message :
No matching records found 'Bank Codes' (ODSC) (ODBC -2028)
Can you solve this problem?
Thank youHi,
Could you find the followings regarding bank information and check if all the settings are correctly defined
1. Define payment run defaults > Payment method
Check payment method details from Administration > Setup > Banking
> Define payment methods
Payment method which is linked to BP > payment means - Bank transfer
2. ODSC table, Bank Code (just to check bank codes are stored well)
3. BP master data > Payment terms > BP Bank accounts
4. BP master data > Payment system > House bank.
Also Check Note no [971105|https://websmp230.sap-ag.de/sap(bD1lbiZjPTAwMQ==)/bc/bsp/spn/sapnotes/index2.htm?numm=0000971105].
Regards
VIkas
SAP Business One Forums Team -
How to get the count of the records
Hi all,
how can we get the record count after the read statement.Means if we write a read statement based on a condition,then how can we know that how many records get effected for this read statementYou can use loop statement to read the records and write in some internal table and after the end of the loop, you can use describe command to find the number of records.
For eg. DESCRIBE TABLE tablename LINES lines.
Here the "Lines" field will give the total number of records present in the table "tablename" -
Match Records - Import manager
Dear Experts,
When there is a table with NO DATA init, the match records options work diffrently.
This could be because matching record allways tries to compare source with destination values.
As here the destination table is blank i guess this could be the reason i am not able to judge the outcome.
Lets say i have 3 fields.
name dept cost
adapter IT 20
adapter IT 20
when i try to import the above data..
matching fileds : name
active match type default import action
2 of 2 NONE CREATE
Now if i chk the DM i can see only 1 record.
Is this behaviour correct!!! please educate me if i am missing something.
I would like to know how matching records work on a empty table.
Kind Regards
EvaHi Eva,
if 2 fileds selected INDIVIDIALLY.
1st field values are duplicated and second field does not have duplicate.
all the records where 1st field duplicates are present ARE NOT IMPORTED.
Yes, your understanding is partial correct, i mean new record will not imported(gets created into MDM) but it can be imported with updated fields with conditions (Partial or conflict) only
Now, when i need to push some data to a table which has data already.
-> it first chks the Matching fields comparision 'within' source fields data first.
-> then it compares the result data and Destination data
See as suggested above, if you select matching field as single field or Multiple fields selection with combined option then it worka as single match for these records if it finds already existing match for the combination of these fields only in that case you will able to update else result in newly created records.
If you go mutliple fields selection with Individual Option, I mean you will able to create new record only if all of these records fields has distinct values e.g. Suppose
Existing record in MDM
Name dept rating
adapter elec 30
will create new record only if your source file has below record.
Name dept rating
adapter1 elec1 40
else if you have any of the record for which any of the fields has same value it will only update the records based on condition as below:
Exact. All the individual value matches are Equal. e.g. source file has values adapter elec 30
Partial. At least one value match is Equal and at least one Undefined; e.g source file has values adapter 20
here one value is equal adapter, one value is not defined value for dept is null in your source file
Partial. At least one value match is Equal and no value matches are Not Equal e.g source values as adapter elec1 40
Conflict. At least one value match is Equal and at least one value match is Not Equal. e.g. Src value as adapter elec 40
@Sudhanshu, M i right or not. Your understanding is correct. Imported records would be only one of these 1 a d, 1 a z , 2 a b
For more understanding Please refer page 347-348/432 of import Reference guide
http://help.sap.com/saphelp_nwmdm71/helpdata/en/4b/72b8e7a42301bae10000000a42189b/MDMImportManager71.pdf
Figure 220. Multiple matching fields (SKU and UPC) and Figure 221. Multiple matching fields (SKU and Mfr. & PartNo.)
Hope it clarifies both of you.
Regards,
Mandeep Saini -
How to count no of records returned from a query?
Hello,
I need to find out how many records displayed from a query without writing any other queries.
i mean that.
I have a query such as:
query = "select * from users";
and the resultset for it is rs.
and i need to display how many records fetched from this query without using any other query such as "select count(user_id) from users" etc.
Is there any function ?No, unfortunately there is no method or property that will tell you how many rows have been returned by a query.
People use many different techniques.
1.The simplest would be, keep incrementing a counter in while ( rs.next() ) and at the end you'll have the count. But only at the end, after the loop.
2. Run another query with count(*) just to fetch the count.
3. Run the same query twice, once for counting and then again for printing out. Very dumb idea though, might as well do 2. suggested above.
4. If you have a scrollable resultset, you could go to the lastRecord and then getRow number and hence know how many there are and then rewind the resultset. I don't know how advisable using scrollable resultsets is.
5. Create a slightly clumsy query like : select count(*) as "totalcount", emp_id, emp_name, emp_email, emp_phone from employees group by emp_id, emp_name, emp_email, emp_phone. You'll need to use the group by clause since count() is an aggregate function and you can't mix aggregate functions and columns unless you add the group by to all the columns you're fetching.
Maybe you are looking for
-
Interactive PDF file with layer visibility issue.
I have created an interactive PDF file in InDesign CC and added buttons in Acrobat CC. The buttons reveal layers with the layer visibility action under properties. The problem is that Reader takes 3-4 seconds to show the layer in full screen mode and
-
Hello All, I've imported the MSS BP 60.1.5 (Based on Java) into the Portal Successfully. After creating a System Object 'SAP_R3_HumanResources' i'm trying to run the iviews however am getting a message "Could not connect to the R/3 System". I checked
-
How to Create Mapllet in Informatica PowerCenter Designer 9.01
Hi All, I don't know this is right Platform to ask this question. I wrote a SQL Query and i want to create Mapplet for this query. I don't understand in Mapplet which Tools i should use to apply SQL WHERE conditions, I need some guidelines. If i know
-
V8.3 wifi slowed or not working
all of a sudden, out of the blue, after about three yrs of working absolutely fine, my wifi network has slowed to a crawl or stopped working altogether. the only thing i can think of that caused the problem is that the iOS update v8.3 happened around
-
.bbb; "tasks" and "memo"; Curve 8520; Playbook
I have a BlackBerry Curve 8520 and a BlackBerry Playbook. Short context: Destroyed phone but salvaged the SIM. Curve was synched to Playbook. Playbook contains thesis information that I NEED to recover: Specifically, “tasks” and “memo” items. Used