Counter in ODS
GUYS
HELP ME
I have a DSO and I want to have a field in the DSO to be a sequential counter.
It always starts at 0 (zero) and as the records are loaded I want to increment the number by 1.
How can I do this?
If I understand you correctly, you want a sequential counter where record 1 = 0 and record 500 = 500.
You might be able to get this from the request information (e.g., if you look at the PSA, it has a record number in it). I'm not sure how you would do that, but maybe an ABAP'er can help out with it.
You cannot do it in the Start Routine unless you combine all of your datapackets first. Which is a mess.
For example, if you are loading 20,515 records, and end up with two packets .... 20k for the first and 515 for the second .... your Start Routine will assign 1 through 20,000 to the first packet and then 1 through 515 for the second packet.
So, trying to get the record number from the request info may be the easier method because combining the data packets may be much more difficult and prone to errors.
Brian
Edited by: Brian Anthony on Aug 28, 2008 6:13 PM
I was just debugging an update rule ... you should be able to Loop at your data_package in the start routine and assign recno (or rec_no) to an unassigned key figure in your update rules.
Loop at data_package.
idx = sy-tabix.
data_package-<key figure> = data_package-recno.
modify data_package index idx.
end loop.
Similar Messages
-
Standard report which gives Record count of ODS, Cube and Source system.
Hi-
Is there any standard report which gives the record count of ODS, Cube and Source system?
or
If any one has ABAP program which takes care of record count pls let me know.
Thanks in advanceI don't understand. You need to check the data loads. What for do you want a list of ODS, Cubes and sources systems?
You can use messages from process chains to monitor the data loads.
You can also use an abap program inside teh process chains to save data into a table and then an abap report to see if everything went OK.
But, thinking again, you may be able to use BW statistics to get some of the information you need. Check the help for BW statistics, it might give you an idea of what you can do.
Regards,
Diego -
TWO_index on same column
Hi All,
In One of my table i saw two index on same column , NORMAL and BITMAP. is it necessary . how it will increase/Decrease the performance .
select index_name,index_type,owner,table_name from dba_indexes where table_name='DS_ATTRSTORE';
INDEX_NAME INDEX_TYPE OWNER TABLE_NAME
EI_ATTRSTORE BITMAP ODS DS_ATTRSTORE
EI_ATTRSTORE_ORG NORMAL ODS DS_ATTRSTORE
EI_ATTRSTORE_ATTRVAL BITMAP ODS DS_ATTRSTORE
select count(*) from ODS.DS_ATTRSTORE;
COUNT(*)
14892879
some times iam getting some deadlock error in this table . i doubted that because of useless Normal index already Bitmap is there in table ..guess so ..
please help me on this.
Thanks,
Edited by: 826854 on Nov 27, 2012 2:31 AM
Edited by: 826854 on Nov 27, 2012 2:31 AM>
In One of my table i saw two index on same column , NORMAL and BITMAP. is it necessary . how it will increase/Decrease the performance .
select index_name,index_type,owner,table_name from dba_indexes where table_name='DS_ATTRSTORE';
INDEX_NAME INDEX_TYPE OWNER TABLE_NAME
EI_ATTRSTORE BITMAP ODS DS_ATTRSTORE
EI_ATTRSTORE_ORG NORMAL ODS DS_ATTRSTORE
EI_ATTRSTORE_ATTRVAL BITMAP ODS DS_ATTRSTORE
>
What you posted just shows the indexes; it doesn't show whether those are on the same column and what other columns might be included in each index.
Any DML on a BITMAP index will likely cause serialization and performance issues since at least two sets of rows need to be locked in order to do an insert or update. -
Record Store only reads one record problem
I have a problem where I can read and write a record to a records store, but i can not do this for multiple records as i am trying with below code. Any help is very welcomes thank you, I am very new to J2ME.
I have a J2ME midlet that calls the startRecordStore() method which create a record 1.
It uses a static int records and it increments it every time a new recordstore is created, well I am not entirely sure if i need to do this. Because I want to go through all the records created.
public void startRecordStore() {
// Incremenets records count
// Temporary example for this workshop only
records+=1;
try { rs = RecordStore.openRecordStore("StudentStore"+records+"", true);
catch (Exception err) {
Alert alr = new Alert("Error Creating", err.toString(), null, AlertType.WARNING);
alr.setTimeout(Alert.FOREVER);
display.setCurrent(alr);
}Then it calls the readData() method which reads the data from the 3 fields, something like this
for(int i=0;i<count;i++) {
ods.writeUTF(ReadDataString);
ods.writeUTF(ReadDataString[i+1]);
ods.writeInt(ReadDataInt[i]);
ods.flush();
// Put the whole write stream to a byte
ReadDataByte = os.toByteArray();
// finally add the fetchDataType to to a record store
rs.addRecord(ReadDataByte, 0, ReadDataByte.length);
os.reset();
os.close();
ods.close();
Then the WriteData() method is called displaying the records
PROBLEM it only displays the last record, instead of more then one record.
eg. StudentStore1, StudentStore2 etc etc ..
// create record enumerator referrence to the instance
re = rs.enumerateRecords(null,null,false);
// go through each records using enumerator
while(re.hasNextElement()) {
rs.getRecord(re.nextRecordId(), ReadInputData, 0);
buffer.append(ids.readUTF());
buffer.append("\n");
buffer.append(ids.readUTF());
buffer.append("\n");
buffer.append(ids.readInt());
buffer.append("\n");
Alert alr = new Alert("Currently Reading", buffer.toString(), null, AlertType.WARNING);
alr.setTimeout(Alert.FOREVER);
display.setCurrent(alr);
// CLOSE INPUT STREAM
is.close();Any idea thanks guyspublic void startRecordStore() {
records+=1;
try {
rs = RecordStore.openRecordStore("StudentStore"+records+"", true);
}Are you sure this is what you want to do?
I don't know where you're calling startRecordStore(), but you're creating a new record store for each "records".
Shouldn't you be just opening the record store "StudentStore", and them adding records to that store?
jc -
ODS - Number of Active Data Records count?
Hi,
I am having a ODS. In manage screen of ODS, i can able to see the records as shown bellow:
Transferred records: 352053
Added Records: 1836
But the number of entries in Active Data of ODS is only 471 records.
My question here is that why Added records (1836) are not equal to number of Active data records (471)? Where i am missing or is it correct?
Best Regards,
Venkata.Hi,
Have you completed the Activation of ODS data after uploading? If no see the entries in NEW records' table of ODS.
If you have activated already,still there is a chance to have different count, because of no of records with same value of KEY fields but exist in different packets.
With rgds,
Anil Kumar Sharma .P
Message was edited by:
Anil Kumar -
Hi Gurus,
Could you please tell me the name of the tables to find the Total count of
1) Cubes
2) ODS
3) Queries (Report)
4) No of total users,
in BW system.
Thanks
NishaHi,
Table name
No of total users USR02
Cubes RSRREPDIR
Queries RSRREPDIR
Hope this helps... -
Dsatsource /ODS/Cube for Open PR and Open PO"
Dear Experts
I want to build a report in which I need to show "Open PR and Open PO" but I could not locate these fields in the BW CUBE / ODS / DATASOURCES. Can anybody tell me where I can find these fields..........
Dinesh SharmaDear,
There is no specific standard data source is not available to fetch us "Open PO" or "Open PR". first vll talk about PO.
For open PO,
case - 1
Need to report count of all PO's which are in open status.
Case-2
Need to report TBQ ( to be delivered Qty ) against each over due PO.
Basically we have - EKKO - HEADER , EKPO - ITEM AND EKET - SCHEDULE LINE ( GRC - GOODS RECEIVED ) is available,
so create a view, take all these three tables EKKO, EKPO and EKET.
EKPO
1 DELIVERY COMPLETED INDICATOR ELIKZ
1 DELETION INDICATOR IN PD LOEKZ
1 ARTICLE NUM MATNR
1 SITE WERKS
X PO DOCUMENT NUM EBELN
PURCHASING ORDER QUANTITY MENGE
PURCHASING ORDER UOM MEINS
NET ORDER VAL IN PUR ORDER CURRENCY NETWR
NET PRICE IN PURCHASING DOC IN DOC CURRENCY NETPR
no PRICE UNIT PEINH
X ITEM NUMBER OF PURCHASING DOCUMENT EBELP
EKKO
DATE ON WHICH RECORD WAS CREATED AEDAT
PURCHASING DOCUMENT DATE BEDAT
DELIVERY DATE EQ_EINDT
RELEASE INDICATOR PURCHASING DOC FRGKE
RELEASE STATUS FRGZU
0PO_UNIT PURCHASING DOCUMENT NUM EBELN
CURR KEY WAERS
EKET
QUANTITY OF GOODS RECEIVED WEMNG
PURCHASING DOC NUM EBELN
ITEM NUM OF PURCHASING DOC EBELP
Logic - create a generic DS, by view, FIRST send the data to DSO, there mention a field like TDQ ( to be deliver qty ), TDQ = po qty - goods received qty. -
create a cube above DSO, set a filter, allow only those records who has TDQ <>0, so your cube contains only pending PO.
hope it helped u.
Thanks, -
Data in the cube is showing wrong when compared with ODS
Hello BW Gurus,
We have a waste report in production planning on Cube and ODS separately. The same info package loads both targets (which means same infosource) but when we run a report on Cube, the records are showing multiple entries (i.e. Key Figures are not matching when compared to ODS) where as the ODS records are showing correctly as it was in R/3. There are totally 6 key figures out of which 4 pulled from R/3 and 2 are populated in BW.
An Example:
Waste report in PP run for plant 1000 for 12/2005 and process order 123456. The operational scrap should be 2.46% and the component scrap should be 3.00% for material 10000000. The report is showing 7.87% for planned operational waste % and 9.6% for planned component waste %. These values are not correct. The ODS values for order 123456 matched the data in R/3 for component and operational scrap.
There is a Start routine to the ODS and also to the cube. I am not good at ABAP so requesting your Help.
<b>Here is the ODS Code:</b>
tables: /BI0/PPRODORDER.
loop at data_package.
select single COORD_TYPE
PRODVERS
into (/BI0/PPRODORDER-COORD_TYPE,
/BI0/PPRODORDER-PRODVERS)
from /BI0/PPRODORDER
where PRODORDER = data_package-PRODORDER
and OBJVERS = 'A'.
if sy-subrc = 0.
if /BI0/PPRODORDER-COORD_TYPE = 'XXXX'
or /BI0/PPRODORDER-COORD_TYPE = 'YYYY'.
data_package-PRODVERS = space.
else.
data_package-PRODVERS = /BI0/PPRODORDER-PRODVERS.
endif.
endif.
if data_package-calday = space
or data_package-calday = '00000000'.
if data_package-TGTCONSQTY NE 0.
data_package-calday = data_package-ACTRELDATE.
endif.
endif.
modify data_package.
endloop.
<b>Here is Cube Code:</b>
tables: /BI0/PPRODORDER,
/BIC/ODS.
TYPES:
BEGIN OF ys_mat_unit,
material TYPE /bi0/oimaterial,
mat_unit TYPE /bi0/oimat_unit,
numerator TYPE /bi0/oinumerator,
denomintr TYPE /bi0/oidenomintr,
END OF ys_mat_unit.
DATA:
l_s_mat_unit TYPE ys_mat_unit,
e_factor type p decimals 5.
loop at data_package.
select single COORD_TYPE
PRODVERS
into (/BI0/PPRODORDER-COORD_TYPE,
/BI0/PPRODORDER-PRODVERS)
from /BI0/PPRODORDER
where PRODORDER = data_package-PRODORDER
and OBJVERS = 'A'.
if sy-subrc = 0.
if /BI0/PPRODORDER-COORD_TYPE = 'XXX'
or /BI0/PPRODORDER-COORD_TYPE = 'YYY'.
data_package-PRODVERS = space.
else.
data_package-PRODVERS = /BI0/PPRODORDER-PRODVERS.
endif.
endif.
if data_package-calday = space
or data_package-calday = '00000000'.
if data_package-TGTCONSQTY NE 0.
data_package-calday = data_package-ACTRELDATE.
endif.
endif.
data_package-agsu = 'GSU'.
data_package-agsu_qty = 0.
select single gr_qty
base_uom
into (/BIC/ODS-gr_qty,
/BIC/ODS-base_uom)
from /BIC/ODS
where prodorder = data_package-prodorder
and material = data_package-material.
if sy-subrc = 0.
if /BIC/ODS-base_uom = 'GSU'.
data_package-agsu_qty = /BIC/ODS-gr_qty.
else.
SELECT SINGLE * FROM /bi0/pmat_unit
INTO CORRESPONDING FIELDS OF l_s_mat_unit
WHERE material = data_package-material
AND mat_unit = 'GSU'
AND objvers = 'A'.
IF sy-subrc = 0.
IF l_s_mat_unit-denomintr <> 0.
e_factor = l_s_mat_unit-denomintr /
l_s_mat_unit-numerator.
multiply /BIC/ODS-gr_qty by e_factor.
data_package-agsu_qty = /BIC/ODS-gr_qty.
ENDIF.
else.
CALL FUNCTION 'UNIT_CONVERSION_SIMPLE'
EXPORTING
INPUT = /BIC/ODS-gr_qty
NO_TYPE_CHECK = 'X'
ROUND_SIGN = ' '
UNIT_IN = /BIC/ODS-base_uom
UNIT_OUT = 'GSU'
IMPORTING
OUTPUT = DATA_PACKAGE-gsu_qty
EXCEPTIONS
CONVERSION_NOT_FOUND = 1
DIVISION_BY_ZERO = 2
INPUT_INVALID = 3
OUTPUT_INVALID = 4
OVERFLOW = 5
TYPE_INVALID = 6
UNITS_MISSING = 7
UNIT_IN_NOT_FOUND = 8
UNIT_OUT_NOT_FOUND = 9
OTHERS = 10.
endif.
endif.
endif.
modify data_package.
endloop.
some how the AGSU qyt is not populating in the cube and when I dbug the code, I could see a clean record in the internal table but not in the cube.
your suggestion and solutions would be highly appreciated.
thanks,
Swathi.Hi Swathi,
May be you might want to look into the way the % is being calculated in the cube. If the formula involves counting the no. of records, then you will also be counting the -ve records that are posted in the cube unless you have had a compression on the cube. that might give you wrong numbers.
Doniv -
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!) -
ODS Activation is taking much time...
Hi All,
Some times ods activation is taking much time. Generally it takes 30 mins and some times it take 6 hours.
If this activation is taking much, then if i check sm50 ...i can see that there is a piece of code is taking much time.
SELECT
COUNT(*) , "RECORDMODE"
FROM
"/BIC/B0000814000"
WHERE
"REQUEST" = :A0 AND "DATAPAKID" = :A1
GROUP BY
"RECORDMODE"#
Could you please let me know what are the possiblites to solve this issue.
thanksHello,
you have 2 options:
1) as already mentioned, cleanup some old psa data or change log data from this psa table or
2) create a addtional index for recordtype on this table via Tcode se11 -> indexes..
Regards, Patrick Rieken. -
Issue in counting open invoices
Hi All,
I am facing an issue which could be common but i am getting the correct count for open invoices.
We have following scenario :
Assume, we are loading an invoice(INV1) which was open(determined by item status = O) yesterday and loaded the same into ODS and to the cube yesterday itself.
As we want to see the invoices which are open as of that particulat day.
we have a CKF defined with value = 1 and aggregation : counter of all values, reference characteristic : 0REFERENCE.
I run the report and I see open invoices = 1, which is correct.
Now,the invoice which was open yesterday was cleared and paid today.
Now , I loaded the data to ODS and then to the cube.
In the cube, I have three entries like
Invoice Item Status Amount
INV1 O(Open) 100
INV1 O(Open) -100
INV1 C(Cleared) 100
Since, this invoice is cleared today, when i run the report , i should get invoice count "Zero" but I am getting the count as "1" and the amount "0".
The CKF which was created is getting the count as "1" even though it is cleared.If the invoice is cleared, it should not be counted.
Anyone has any suggestions ?
Regards,
Jeevanokay - a number of issues here
The two item statuses of O will cancel each other out and be deleted if you have zero elemination on the cube and run the next compression
The negative zero was generated by the change log of the ODS when the item status = C cleared document came in
You always run the open items as at a point in time using two RKFs added together in one CKF
RKF1 is item status = O AND posting date <= key date of query
RKF2 is cleared date > key date of query AND posting date <= key date of query
Thus you can always restate the open items which have been subsequently cleared back to a point in time (ie historical aged debt reports etc..)
You must not just use item status = O
Now how to do the counts..
I normally put a counter onto the cube and negate the counter when the changelog negative O record (so the two Os cancel each other out) and then just add up the values of the counter as per the RKFs above
However there is another option but it still involves a change to the data model
The counts are based on the uniqueness of a document number
The full key of a uniqieness of an AR or AP document number in SAP is...
Company Code, Fiscal Year, Document Number, line item
(the line item is due to one AP document being split across many lines due to installment plans with different net due dates or partially allocated cash across many outstanding line items)
The other items have to be considered in uniqueness because SAP allows you to configure number ranges per company code wither with internal or external numbering and these ranges can be year specific - hence the full key is required
You cannot just count document number as this will give a false result as the same document numebr can be used in multiple years within the same company code AND across company codes as well (so group reporting of outstanding counts will be affected as well)
So you have to create a new infoobject that is called "Document Full Key" - that concatenates Company Code, Fiscal Year, Document Number, line item into one object string
You then put that in yoru cube and update it via the transformation rules
Then you can create the RKFs above and do a count all values based on the characteristic "Document Full Key" - then create a few more RKFs to do the splits of net due date and the offsets required for -30 -60 etc as per normal
Sorry for the bad news - but if you want to do it properly - I don;t think you have another other choice but the two options above..
But then what do I know! -
How to get unique ID'd count in report
HI ,
I have following data in ods.
ID Degree Field Counter
12 Grad Computers 1
12 PG Computers 1
13 Grad Electronics 1
14 PG Computers 1
I need a report to display the number of ID's with computers field.
In the above example Id 12 has two records so the count is coming as 3.(12 ID two times and 14 ID).
But I have to display only unique ID's.I have to have count 2(12ID and 14 ID).
How can I achieve unique ID's count in report.
Edited by: SAP Consultant on Aug 6, 2011 7:24 AMHi,
Create a RKF and restrict it with Field "Computer" and key figure as count, after that in properties of RKF you can set "Calculate result as" option to "Count of all values".
And if you want to get it across ID's then create an exception aggregation on this RKF and set reference characteristics as "ID".
Regards,
Durgesh. -
Count no. of records for a particular customer in the query?
Hi,
1)Can anybody guide as to how do we count the number of records for a particular customer. E.g.
C1 has placed 2 orders
C2 has placed 4 orders
C3 has placed 5 orders
so in all the ODS has 11 records. Now while designing the query we need to ensure that we show only the Customers who have placed more than 3 orders. What could be logic to solve this kind of a problem?
2) Is there a way that we can access the structure and data of the ODS in ABAP code say one of the includes in a user exit?
The requirement says there could be N number of cases opened and closed in one month. Now we need to calculate the average number of days taken to close a case? Any ideas on the possible solution.
Thanks
RBHi Rajat,
Take a calculated key figure rename it as Count , go to the properties of that calculated key figure on the left hand side not at the columns side in the properties click on the button Enhance which is shown in the down left side, in the exception aggregation part select "count all values <>0" , take the reference character as customer Id . Now go to the Customer character which is in rows go to properties and select "Normalise to" combo box in that select "Query result" now u will get the exact result which ur looking for . -
How to manage the same counter based on Order Number and Order Items
Hi All,
we need some help to build an infocube and a query as described in the following scenario.
ODS 1 (Order Numbers aggregated at month level) defined as:
- Order Month
- Customer
- Counter
ODS 2 (Order Items aggregated at month level) defined as:
- Order Month
- Customer
- Product
- Counter
We would like to build an InfoCube that allows us to create a query through which we are able to compare:
- ODS 1 - Counter, that means the number of orders without considering the product
- ODS 2 - Counter, that means the number of orders where a specific product is included
For example:
ODS 1:
Order Month........Customer........Counter
200701...............20001.............10
200701...............20002.............5
ODS 2:
Order Month.............Customer...................Product..........Counter
200701.....................20001.......................A....................1
200701.....................20001.......................B....................10
200701.....................20002.......................A....................4
200701.....................20002.......................C....................5
The desired query should show the following result
Ord Month.Customer..Product.....Counter....Counter
.................................................(ODS2).....(ODS1)
200701......20001.......A..............1..............10
200701......20001.......B..............10.............10
200701......20002.......A..............4..............5
200701......20002.......C..............5..............5
Do you have any idea how to get this result?
Thanks
Kind RegardsHi Valeria,
Have a look,
<a href="http://sapbwneelam.blogspot.com/2007/08/sap-tables.html">How to... Count the occurrences of a characteristic</a>
<a href="http://sapbwneelam.blogspot.com/">More Docs .....</a>
Hope it Helps
Srini -
Hello BI Gurus,
I have a BI report where we require to have values in the following format..
For Plant: X
OVERALL Sep-07 Oct-07 Nov-07 Dec-07 Jan-08 Feb-08
Total No of Machines 1 0
Scenario is as follows:
When i move machine from one plant to another . i.e for example : in September 08, I had 2 machines for the given plant in the report. Now let us say this machine was moved from Plant X to Plant Y in month of February08, report shows the correct status that one machine is moved from this plant to another. This report is based out of ODS, where it shows records for Sep 07 and Feb 08, so it will show machine count proper for these 2 months, but logically, as this machine was present in the same plant from Oct 07 to Jan 08, the report should denote its presence and give the record count as 1 in the following manner.
For Plant: X
OVERALL Sep-07 Oct-07 Nov-07 Dec-07 Jan-08 Feb-08
Total No of Machines 1 1 1 1 1 0
Customer wants to see this trend for a year, starting from the month he enters at the time of query execution, let us say : feb 08, so report shd go up to March 07 (in the above example, i have just shown till Sep 07, but it will be till March 07).
So the count for these machines should reflect properly when report is executed. I believe, count for these months can be calculated with virtual key figure ??
In ODS, there will be just 2 records, showing
Machine Calmonth Count
X Sep 07 1
X Feb 08 0
Problem lies with the other months for which there is no movement of machine in that month..
Thanks in advance
Regards,
Vipul.Hi,
Thanks for reply.
In report ME80 and ME2L no where we are getting report on header level. All counts are including line items.
User dont have authorizations to see tables.
Is there anyother reports???
Thanks
Nilesh
Maybe you are looking for
-
How can I solve LOV , TAB problem in Portal 3.0.6.6.5
Hi All, I have certain doubts which i have summed up below. i hope you can explain/clarify me these doubts. 1) I have two lov in form one related to another.I clicked the first LOV (either combobox or popup) and inserted value in that field.When I am
-
Can anyone tell me if it's possible to have multiple instances of TOAD running? If I try and start it twice, it just maximizes my existing one. Thanks for the help.
-
Droid4 POWER BUTTON NOT WORKING
The power button on top of my Droid 4 is suddenly not working? The only way to turn it on is to slide out the keyboard. I can't turn it off, it won't power down. The phone is a year and half old. This is so frustrating, does anyone have any idea h
-
Word 03 to Acro 8: Lines around images
On MSWord files (book with small b/w line drawing cartoons)saved to Acrobat 8, lines appear around some images, but only when printed. Very frustrating. Who's clever enough to explain and fix this? Thanks.
-
My iphone won"t open. There is a message on the screen that states that iphone is not backed up. when I click the ok button nothing happens. It was workin until today.