Performance: reading huge amount of master data in end routine
In our 7.0 system, each day a full load runs from DSO X to DSO Y in which from six characteristics from DSO X master data is read to about 15 fields in DSO Y contains about 2mln. records, which are all transferred each day. The master data tables all contain between 2mln. and 4mln. records. Before this load starts, DSO Y is emptied. DSO Y is write optimized.
At first, we designed this with the standard "master data reads", but this resulted in load times of 4 hours, because all master data is read with single lookups. We redesigned and fill all master data attributes in the end routine, after fillilng internal tables with the master data values corresponding to the data package:
* Read 0UCPREMISE into temp table
SELECT ucpremise ucpremisty ucdele_ind
FROM /BI0/PUCPREMISE
INTO CORRESPONDING FIELDS OF TABLE lt_0ucpremise
FOR ALL ENTRIES IN RESULT_PACKAGE
WHERE ucpremise EQ RESULT_PACKAGE-ucpremise.
And when we loop over the data package, we write someting like:
LOOP AT RESULT_PACKAGE ASSIGNING <fs_rp>.
READ TABLE lt_0ucpremise INTO ls_0ucpremise
WITH KEY ucpremise = <fs_rp>-ucpremise
BINARY SEARCH.
IF sy-subrc EQ 0.
<fs_rp>-ucpremisty = ls_0ucpremise-ucpremisty.
<fs_rp>-ucdele_ind = ls_0ucpremise-ucdele_ind.
ENDIF.
*all other MD reads
ENDLOOP.
So the above statement is repeated for all master data we need to read from. Now this method is quite faster (1,5 hr). But we want to make it faster. We noticed that reading in the master data in the internal tables still takes a long time, and this has to be repeated for each data package. We want to change this. We have now tried a similar method, but now load all master data in internal tables, without filtering on the data package, and we do this only once.
* Read 0UCPREMISE into temp table
SELECT ucpremise ucpremisty ucdele_ind
FROM /BI0/PUCPREMISE
INTO CORRESPONDING FIELDS OF TABLE lt_0ucpremise.
So when the first data package starts, it fills all master data values, which 95% of them we would need anyway. To accomplish that the following data packages can use the same table and don't need to fill them again, we placed the definition of the internal tables in the global part of the end routine. In the global we also write:
DATA: lv_data_loaded TYPE C LENGTH 1.
And in the method we write:
IF lv_data_loaded IS INITIAL.
lv_0bpartner_loaded = 'X'.
* load all internal tables
lv_data_loaded = 'Y'.
WHILE lv_0bpartner_loaded NE 'Y'.
Call FUNCTION 'ENQUEUE_SLEEP'
EXPORTING
seconds = 1.
ENDWHILE.
LOOP AT RESULT_PACKAGE
* assign all data
ENDLOOP.
This makes sure that another data package that already started, "sleeps" until the first data package is done with filling the internal tables.
Well this all seems to work: it takes now 10 minutes to load everything to DSO Y. But I'm wondering if I'm missing anything. The system seems to work fine loading all these records in internal tables. But any improvements or critic remarks are very welcome.
This is a great question, and you've clearly done a good job of investigating this, but there are some additional things you should look at and perhaps a few things you have missed.
Zephania Wilder wrote:
At first, we designed this with the standard "master data reads", but this resulted in load times of 4 hours, because all master data is read with single lookups.
This is not accurate. After SP14, BW does a prefetch and buffers the master data values used in the lookup. Note [1092539|https://service.sap.com/sap/support/notes/1092539] discusses this in detail. The important thing, and most likely the reason you are probably seeing individual master data lookups on the DB, is that you must manually maintain the MD_LOOKUP_MAX_BUFFER_SIZE parameter to be larger than the number of lines of master data (from all characteristics used in lookups) that will be read. If you are seeing one select statement per line, then something is going wrong.
You might want to go back and test with master data lookups using this setting and see how fast it goes. If memory serves, the BW master data lookup uses an approach very similar to your second example (1,5 hrs), though I think that it first loops through the source package and extracts the lists of required master data keys, which is probably faster than your statement "FOR ALL ENTRIES IN RESULT_PACKAGE" if RESULT_PACKAGE contains very many duplicate keys.
I'm guessing you'll get down to at least the 1,5 hrs that you saw in your second example, but it is possible that it will get down quite a bit further.
Zephania Wilder wrote:
This makes sure that another data package that already started, "sleeps" until the first data package is done with filling the internal tables.
This sleeping approach is not necessary as only one data package will be running at a time in any given process. I believe that the "global" internal table is not be shared between parallel processes, so if your DTP is running with three parallel processes, then this table will just get filled three times. Within a process, all data packages are processed serially, so all you need to do is check whether or not it has already been filled. Or are you are doing something additional to export the filled lookup table into a shared memory location?
Actually, you have your global data defined with the statement "DATA: lv_data_loaded TYPE C LENGTH 1.". I'm not completely sure, but I don't think that this data will persist from one data package to the next. Data defined in the global section using "DATA" is global to the package start, end, and field routines, but I believe it is discarded between packages. I think you need to use "CLASS-DATA: lv_data_loaded TYPE C LENGTH 1." to get the variables to persist between packages. Have you checked in the debugger that you are really only filling the table once per request and not once per package in your current setup? << This is incorrect - see next posting for correction.
Otherwise the third approach is fine as long as you are comfortable managing your process memory allocations and you know the maximum size that your master data tables can have. On the other hand, if your master data tables grow regularly, then you are eventually going to run out of memory and start seeing dumps.
Hopefully that helps out a little bit. This was a great question. If I'm off-base with my assumptions above and you can provide more information, I would be really interested in looking at it further.
Edited by: Ethan Jewett on Feb 13, 2011 1:47 PM
Similar Messages
-
Calendar app in iPhone use relatively huge amount of cellular data
I'm using a 500MB plan, so my cellular data is very limited. Each month I will check which app on my iPhone used most of the cellular usage, and the built-in Calendar always used the highest amount of cellular data.
I already set the Calendar to sync to "Events 2 Weeks Back" only, and I installed Sunrise calendar and only use it to create new task, edit task, etc. So far Sunrise calendar is the only calendar app that directly access my iCloud calendar. So I can make a comparsion between the two.
I reset the cellular statistics a week ago. Today, the usage of Calendar and Sunrise are as follows:
Calendar: 23.9 MB
Sunrise: 581 KB
They are displaying the same amount of information, the only difference I think is Calendar use Push to keep updating itself, so it consumes this relatively huge amount of data. (>90MB each month!)
I tried disable the cellular usage of Calendar in the past, but then I cannot see the most up-to-date information in the Notification Center. So at last I have to re-enable it again.
Does anyone have similar problem? Is there any solution? Thank you!!!Hi Robert,
Thank you for the comments but I somehow think we are miscommunicating.
1) I have no problem backing up the phone locally (or to icloud if I wanted to)
2) I have no problem turning on or off cellular data usage for any app on the phone
3) I have no problem seeing what apps are enabled or how much cellular data they use
My problem is the following
APPLE's Notes app used 2.7 GIGABYTES of cellular data (before I disabled cellular data for this app) despite the fact I wasn't even using the app. I didn't change any setting for Notes, I didn't do anything with it except create one note on October 15. It would seem to me that this excessive usage is a bug or oversight in Apple's design of the app.
The purpose of this post is to warn others of the potential issue and to see if this issue has been observed by anyone else and if there are any actual fixes. Disabling cellular data for the app is a work-around ... but will the problem begin again if cellular data is re-enabled?
Your suggestion of erasing all content and settings and then restoring the phone from the backup sounds extreme but would it solve the specific problem of excessive cellular data usage and if so .. why? -
Read document attached to master data value
Hello.
I'm using FM RSOD_DOC_MAST_CHANGE to attach files to master data values. But I don't know how to read attached document(( Does anybody know?Hi.
Take a look at [following thread|Document read functionality;.
Regards. -
Huge number of Master data errors
Hi All,
I have a situation. Actaully in our project data records with special characters for master data (0CUSTOMER here) are being edited every day and manually loaded. (note: no provision of RSKC). what happened a day back is unknowingly someone triggered a full load and data with error records from Day 1 is now there till the PSA along with the latest data. now untill and unless the data is corrected and reloaded new data won't get updated. So can anybody please suggest me the quickest way of getting out of this mess. I mean to remove the old data which is already there and get the latest data only from the PSA. Otherwise i need to manually correct around 7000 records!
Please help. Do tell me if you need more clarifications.
Thanks in advance!Hi
If it's possible speak to business poeple if they want that invalid characters.If they say yes then allow into BW on RSKC.
Just delete reuest and goto PSA and update datatarget immediatly.
Regards,
Chama. -
Issues In Reading Attribute Values From Master Data
Hi All,
I have a requirement where, i need to read an attribute value from master data. I have a characteristic YCSTATMCG (AT Cost Group Code) which is the master data from where i have to read the attribute, 0PROFIT_CTR (Profit Center). The attribute thus read, has to be populated into another characteristic, YPROFIT_C. But YCSTATMCG referes to another characteristic, YCSTCG. Here is the FOX Code I wrote with YPROFIT_C as the changing characteristic and 0AMOUNT as keyfigure.
DATA V_ATCP TYPE YCSTATMCG.
DATA V_PROFIT TYPE YPROFIT_C.
DATA V_PROFITC TYPE YPROFIT_C.
DATA V_AMOUNT TYPE F.
V_ATCP = OBJV().
MESSAGE I020(YCO_CFT) WITH V_ATCP.
V_AMOUNT = {0AMOUNT, # }.
V_PROFIT = ATRV('0PROFIT_CTR' , V_ATCP).
MESSAGE I020(YCO_CFT) WITH V_PROFIT.
{0AMOUNT, V_PROFIT} = V_AMOUNT.
But this is not working. The ATRV() function is not reading the attribute values at all. Any solutions and suggestions is highly valued.
Thanks in advance
SwaroopHi,
even i have the same situation.
i just want the attribute value of a char to be populated into another characteristic in the planning query.
my question is whether i should populate the keyfigure field also in the FOX code.
if so should i populate both 0amount and 0quantity fields as i have 2 keyfigure fields.
Thanks for your help
Nishanth -
No Source Fields(But wants to read attributes of another master data infoob
Hi
Im planning to use the 2LIS_03_BF datasource. I have two master data infoobjects(0PRODVERS_ATTR, 0MAT_PLANT_ATTR).
Im loading data from 2LIS_03_BF in DSO . But this datasource doesn't contains the source fields for master data infoobjects 0PRODVERS_ATTR, 0MAT_PLANT_ATTR.
So hw can i read the attributes of these master data infoobjects. please let me know
kumarHi
You can write a routine for this purpose we call it lookup in bw terms ie if the field isnt present in the source then you can take the values from the other targets may it be ods or master data and the selection is based on the keyfields in both the targets ie source field and the target from which the field has to be picked.
lets say i want customer Number from the MD Customer and i dont have customer number in the souce field so i will write a routine in the start routine to select customer number from customer master data put the field in the internal table and then write a update routine in the field customer number that reads the values into the work area from the internal table and then put the result in the result field from work area.
below is the syntax.
TYPES:BEGIN OF t_custnumber,
***declare the fields u will be using including the keyfileds in the souce**
customer number type /bic/0customer number
END OF t_custnumber.
........internal table to read data into......
DATA : i_custnumber.TYPE STANDARD TABLE OF t_custnumber.
work area to read data from internal table
DATA : wa_custnumber TYPE t_custnumber,
select
customer number
x
y
from table customer
into i_custnumber
where
x= x of data package ie below ods (source)
y = y of data package ie below ods (source)
The above routine comes in the start routine
Now for the update routine
read table i_custnumber into wa_custnumber with key
x= x of comm_strucute ie below ods (source)
y = y of comm_strucute ie below ods (source)
Result =wa_custnumber-customer number
in start routine the souce table is called as data package but in case of update routine the same souce table is termed as communication structure thus comm_strucuture.
hope this is handy information assign points if applicable
thanks
puneet -
How to read master data in transformation routine?
Hi gurus,
I am loading data from 0HR_PA_0 data source.
I have 2 fields in the DS: PERNR (Personal Number) and CALMONTH (Calendar year/month).
I need to read 0EMPLOYEE's attribute 0ENTRYDATE and count the difference between Entry date and Calendar year/month.
Could you please help me with it? I don't know ABAP that much, so I am not able to write it by myself...
Regards,
DorotaHi Dorota ,
I guess your main problem is how to get difference of two dates in no of days.Please find following code for the same .
I am asumming that you want days difference from 01 date of month .If not then it can be changed as per requirement.Here the variable datediff will give you output in no of days .
data :v_date1 like sy-datum ,
v_date2 like sy-datum ,
datediff(6) type n.
v_date1 = '20100301'.
v_date2 = sy-datum.
datediff = v_date1 - v_date2 .
If you please clear some point I can help you to write code .My questions :
1) where you want to write this code .(start/end routine etc)
2) What will be your start day value (1st day of month) or date value from 0ENTRYDATE.
ex : 0ENTRYDATE = 20101223
CALMONTH = 201003
so we need day value for calmonth that can be 01 or 23 (as in 0ENTRYDATE).
Hope this will help .
Regards,
Jaya -
Look up at master data in update routine
Hi all,
I am loading from flat file in to an infocube. My transaction data comes in the format Subcategory, Area,Date, Sales qty,UOM. But my infocube should be filled with Category,Subcategory,Region,Area,Date,SalesQty,UOM. My business requirements want me to model Category, Subcategory,Region area as characteristics of dimension. ie I cannot model Category as navigational attribute of Subcategory and Region as navigational attribute of Area.
But I can get the master data file for Subcategory in Sucategory, Category format and Area in Area, Region format. So when I load the transaction data I can make a table lookup on these master data table and fill the required fields.
But the problem is I donot have much experince in ABAP routines.
Can any one help me with a sample start/update routine on how to do this.
Any help will be appreciated.
Regards,
AmithAmith,
Actually, you may everything do in a start routine of the URs (including lookup itself).
There is no need to declare internal table in a global part of routine and then read values in routines.
The code may look the following. (Don't have the system on hand. So, some syntax may require some modification.)
TABLES: <Your Master Data Table>.
DATA: wa_temp TYPE DATA_PACKAGE_STRUCTURE OCCURS 0 WITH HEADER LINE,
wa_md TYPE <Your Master Data Table> OCCURS 0 WITH HEADER LINE.
SELECT * FROM <Your Master Data Table> INTO wa_md.
SORT wa_md ASCENDING BY <Basic Char Key>.
LOOP AT DATA_PACKAGE INTO wa_temp.
READ TABLE wa_md WITH KEY <Basic Char Key> = wa_temp-<Basic Char Key>.
wa_temp-<YourLookupIO> = wa_md-<YourLookupAttribute>.
MODIFY DATA_PACKAGE FROM wa_temp.
ENDLOOP.
Best regards,
Eugene -
To populate data using end routine
Hello,
In the end routine I need to populate the org unit with data from 0hrposition object which gets populated from the source field assigment.
Could anyone help me in writing the code in BW 7 END Routine
InfoObject: 0ORGUNIT Organizational Unit.
ORGUNIT TYPE /BI0/OIORGUNIT,
InfoObject: 0HRPOSITION Position.
HRPOSITION TYPE /BI0/OIHRPOSITION,
Thank you
AnimaHI Anima,
Check here.....
https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/e73bfc19-0e01-0010-23bc-ef0ad53f2fab
Regards,
Vijay. -
Huge amount of backup data on Mac HD even though I use Time Machine on an external HD
When looking at the storage tab on "about this mac", there is a huge (290 Gb) chunk of backup data, even though I use Time Machine to back up on an external hard drive. Does anyone know how to just keep backups restrained to the external hard drive? I have no idea where this 270 Gb chunk of data is even stored on my Mac HD. Any advice would be greatly appreciated.
zachnasty19 wrote:
do you know how to remove the snapshot backups? I can't find where they're stored.
open Terminal in the Utilities folder. Copy and paste "sudo tmutil disablelocal" without the quotes and hit enter. You may be asked to enter your admin password. After that, the "backups" will immediatley be gone. -
I have a huge amount of "documents & data" in memory after I synced. What is this?
What makes up the "documents & data" part on my phone memory?
This phone is not using the cloud. The usage shows messages is using the biggest chunk. I have delegated all messages, but it is still there.
-
Hi All,
LV 8.5.1 + DSC
In my project I need to save many scalar parameters to file and also read them. There is about 100 logical parameter groups and inside those groups there is about 10 to 50 parameters. Every parameter have own describe name e.g. "TAG1_measurement_upper_limit". Parameter type is string and length about 1 to 7 characters.
In my first solution I made a typedef rings for every parameter group. This structure is not good because when there is a new parameter I must update many things manully. This means that number of parameters can vary. One good thing in this structure that it is documenting my code very effcient. I also like to keep my code simply as possible so I wan't write and read all parameters by using only two VIs. All parameters were saved to one CSV-file. Every column is one parameter group and every row is certain parameter. So there are many empty "cells" in this structure.
I have consired different structures as database, CSV-file etc.. Does anyone thought this same issue before? Is there efficient way to solve this issue.
-JimValues of FP variables can be easily captured.
1. Create a reference to the pane of the FP.
2. With that reference you can fetch all the controls(/indicators) on the FP.
NOTE: make sure that the label of the control/indicators is unique and have a distinct pattern e.g. IOgrp_IOitem_parameter (use caption for user viewing and label in blockdiagram)
3. Using the label naming pattern you can store them in a file.
The label can also be used to restore the value of the control.
1. Read the file
2. Get all control references
3. For each value in the file
3a. Find label name in control references
3b. if found set value
Regards,
André
Using whatever version of LV the customer requires. (LV5.1-LV2012) (www.carya.nl) -
Hi All ,
In Case of reading huge amount of record from BPC Cube from BADI code , performing calculations and writing back huge amount of data into the cube , It takes lot of time . If there is any suggestion to read the data from Cube or writing data into the cube using some Parallel Processing methods , Then Please suggest .
Regards,
SHUBHAMHi Gersh ,
If we have a specific server say 10.10.10.10 (abc.co.in) on which we are working, Then under RZ12 we make the following entry as :
LOGON GROUP INSTANCE
parallel_generators abc.co.in_10 ( Lets assume : The instance number is 10 )
Now in SM59 under ABAP Connections , I am giving the following technical settings:
TARGET HOST abc.co.in
IP address 10.10.10.10
Instance number 10
Now if we have a scenario of load balancing servers with following server details (with all servers on different instance numbers ) :
10.10.10.11
10.10.10.13
10.1010.10
10.10.10.15
In this case how can we make the RZ12 settings and SM59 settings such that we don't have to hardcode any IP Address.
If the request is redirected to 10.10.10.11 and not to 10.10.10.10 , in that case how will the settings be.
I have raised this question on the below thread :
How to configure RZ12 and SM59 ABAP connection settings when we have work with Load Balancing servers rather than a specific server .
Regards,
SHUBHAM -
Reporting on master data customer and bad performances : any workaround ?
Hello,
I've been asked to investiguate on bad performances encountered when performing reporting
on the specific master data zcustomer.
Basically this master data has a quite similar design that 0customer, there are 96000 entries in the master data table.
A simple query has been developed : the reporting is done on the master data zcustomer and its attributes : no key figure, no calculation, no restriction ...
Nevertheless, the query can not be executed .. the query runs around 10 minute in rsrt, then the private memory is exhausted and then a short dump is generated.
I tried to buid a very simple query on 0customer, this time, without the attributes ... and it took more than 30 sec before I get the results.
I checked the queries statistics :
3.x Analyzer Server 10 sec
OLAP: Read Texts : 20 sec
How is it that it is so long to performthe reporitng on those master data, while in the same time If i try to display the content in SAP by choosing "maintain master data", I have an immediate answer.
I there any workaround ?
Any help would be really appreciated.
thank you.
RaoulHi.
How much data have you got in the cube?
If you make no restrictions, you are asking the system to return data for all 96.000 customers. That is one thing that might take some time.
Also, using the attributes of this customer object, fx making selection or displaying several of them, means that the system has to run through the 96.000 records in masterdata to know what goes where in the report.
When you display the masterdata, you are by default displaying just the 250 or so first hits, and you are not joining against any cube or sorting the result set, so that is fast.
You should make some kind of restriction on other things than zcustomer (time, org.unit, version, etc, to limit the dataset from the cube, but also a restriction on one of the zcustomer attribs, with an index for that maybe, and performance should improve.
br
Jacob -
Hi Community,
since Friday my iPhone 4 startet using huge amounts of mobile data and rapidly wastes battery lifetime (50% in 3 hous!) It also gets quite warm even when I don't use it at all.
I suspect an app does this, because in flight mode battery is ok.
How do I find out which app is to blame without having to uninstall all apps?
Thanks for your help.
Kind regards
NymphenburgYou need to look into using the SQL*Loader utility:
http://download-west.oracle.com/docs/cd/B10501_01/server.920/a96652/part2.htm#436160
Also, Oracle supports BULK inserts using PL/SQL procedures:
http://download-west.oracle.com/docs/cd/B10501_01/appdev.920/a96624/05_colls.htm#28178
Maybe you are looking for
-
Mail not showing accounts after ios 7 update on iPhone 5
After the ios 7 update to my iPhone 5 mail does not show my accounts. Specifically there is nothing below the word Accounts. The rest is working fine and still connected to my three accounts. However it no longer shows accounts.
-
Custom MIRO and GRN duty value difference
Dear Guru's When MIRO is done, the custom duty clearing for INR 6,821,482.80. When GRN is done for above, the Custom Duty clearing in GRN doc is for INR 6,828,297.31. There is a difference of INR 6,814.51, small difference in each custom duty betwee
-
Quicktime movie not displaying properly
Hi, Can anyone help?, I have inserted an mpg into a page using the "plugin" symbol (is this correct?), and although it displays correctly when i preview in browser, after i upload it to my server and click on the link, it goes to the page, hangs ther
-
I am having issues with the address book in iphone 4s ios 7. it won't let me add and adress for a new contact. anybody has an idea of what's wrong and the solution ?
-
How to sort a list of strings, without methods and stuff just simple code?
Hi How to sort a list of strings, without methods and stuff just simple code? Thanks in adavance!!