Selecting Data from DSO via ABAP Routine

Hello,
i dont know how to solve my special requirements with sap bw. Maybe you have some idea.
I have a row of data in my DSO, which is like:
Date               ObjectA     ObjectB          Amount
2014 08 18     testA          testB              1000
2014 08 19     testA          testC              500
2014 08 20     testA          testB              2000
I want to have a key figure in my reports, which shows a special smoothed average per day of the past 3 months for each day-object combination.
The formula how the average is calculated, should be neglected in that example.
Date               ObjectA     ObjectB          Amount     smoothed average
2014 08 18     testA          testB              1000          900
2014 08 19     testA          testC              200            150  
2014 08 20     testA          testB              2000          950
2014 09 20     testA          testB              3000          1000
My first idea was that I have to create that key figure in the transformation from DSO to my cube, because there is no option for that advanced calculations in queries.
So I need access to all the data in my DSO while i am in an abap environment in the transformation routine. I need that because i have to do calculations from data in the past. How can I achieve this? Or are there other ways to solve my requirements?
I hope you can help.
Best regards
Simon

You should utilize the start routine or end routine functionality of a 7.x transformation.
You can read from the DSO active table which has the naming convention: /BI0/A + dsoName + 00 (business content dso) or /BIC/A + dsoName + 00.
For example in end routine:
//local data declaration
DATA: lt_dso TYPE standard table of /bic/azfi_o0100.
FIELD-SYMBOLS: <fs_dso> type /bic/azfi_o0100.
//get data
SELECT *
FROM /bic/azfi_o0100
INTO table lt_dso
FOR ALL ENTRIES IN RESULT_PACKAGE
WHERE objectA = objectA AND
               objectB = objectB.
SORT lt_dso BY objectA objectB.
//populate result package
LOOP AT RESULT_PACKAGE ASSIGNING <result_fields>.
READ TABLE lt_dso ASSIGNING <fs_dso>
WITH KEY objectA = <result_fields>-objectA
                  objectB = <result_fields>-objectB
binary search.
//do calculation...
<result_fields>-zsmoothavg = ...
ENDLOOP.

Similar Messages

  • Read Data From DSO - In ABAP Program

    HI Friends,
    Can any one tell how to read Data from a DSO in a Abap Program on BI System itself......
    Which is the better way to read data from DSO in Abap Program... Is it
    1. Reading Data Directly From the Active Table Of the DSO ... or
    2. Reading Data From DSO....
    In case of reading data from DSO.... Which function module is used to do this work....When i searched the forum i came across 2 function Modules.... BAPI_ODSO_READ_DATA_UC and RSDRI_INFOPROV_READ..... Please let me know which one should be used....
    Regards,
    Shyam.

    Hi Shyam,
    The active content of any ods will be stored in the database tables( SE11) with the naming convention /BIC/A<odsname>00 for Custom-defined DSO and /BI0/A<odsname>00 for Business content delivered DSO.
    For example if the technical name of the ods is TEST , then the active content table name in SE11 will be /BIC/ATEST00.
    You can write your own program to read the contents of this database table.
    Regards,
    Krishna.

  • Select data from database via XML

    I want to select data for display and insert data to tables via XML, and I want
    to do this from a browser.
    I am using "Oracle8i Enterprise Edition Release 8.1.7.4.0" on HP-UX server
    with "JServer Release 8.1.7.4.0.".
    The oracle documentation says I need the following in order to do this.
    1. XML-SQL Utility
    2. XML Parser for Java, V2
    3. JDBC driver
    4. JDK
    5. A Java compliant web server
    6. XSL Servlet
    How do I verify, if the above software list is available in my environment.
    What are all available within the database and what are other software I need to
    install.
    Thanks
    Pushparaj

    It's a classpath problem. Either you mistyped the class name, or you don't have the class in your classpath. I think Oracle's drivers come in db12.zip or db12.jar or some such. Whatever that jar or zip file is, it has to be in your classpath, but it's not.
    Or it is in your classpath, but you're in an appserver context where the classloader that the container provides for your app uses something other than the classpath variable. For instance, in tomcat, the jar file would be uder webapps/yourApplication/WEB-INF/lib I think.

  • Extract last date from DSO - Number ID through ABAP

    Hi everyone.
    I want to delete some records that i dont want to write to DSO through ABAP routine (transformation or DTP). For example, I am reading a number id and a date (yyyymmdd), but for that number I have many dates, and I wanna store the maximun date from all of them. For example:
    ID      Date
    111   20111020
    222   20111021
    333   20111025
    444   20111105
    555   20111102
    In DSO i want to store '444 20111105'. i tried this with a delta extraction , but the DSO receive any record. It seems the transformation read the DSO at random.
    Appriciate your response
    Thanks
    Ignacio

    Perform a "selective delete".
    Right click on DSO and goto Manage.  Next, goto the Contents Tab.  Then click on the selective delete button.  This will ask you what criteria to use for the deletion.  Enter your time restrictions and your'e good to go.
    Cheers,
    B

  • Deleting selected data from an Infocube in BW using ABAP program?

    Hi Everybody,
                       I have to create a ABAP program in SE38 which, on execution will delete selected data from a Cube in BW module. How to achieve it. Is there any function module that can do so? Eagerly waiting for your suggestions.
    Regards,
    Pulokesh

    select the records from the cube or  ods and put in to one internal table.
    and then u can delete the records

  • RFC FM that will select data from other system

    Hi ABAP Gurus,
    Good day.
    Do you have any documentation  on how to develop RFC FM that will be able select data from tables in other SAP system that you can share with me?  How about sample FMs?  Thanks in advance!
    Best regards.
    Brando Braganza

    HI Brando,
    see the below Function modules which help to fetch data from another system ..
    RFC_READ_TABLE                " External access to R/3 tables via RFC
                                                  "this function module is used for table which is having max 40 fields and unlimited records..
    RFC_GET_TABLE_ENTRIES      "Read table entries unlimited fields and data
    * call the FM like this
    *     Calling RFC to get Table entries from Destination 'AVP'
          CALL FUNCTION 'RFC_GET_TABLE_ENTRIES'  DESTINATION 'AVP'
    Regards,
    Prabhudas
    Edited by: Prabhu Das on May 12, 2009 10:52 PM

  • Issue when uploading Sales data from DSO to Cube.

    Dear All,
    I have an issue when I am uploading Sales data from DSO to Cube.  I am using BI 7.0 and I have uploaded all sales document level data to my DSO.  Then I use a transformation rule to calculate the Sales Value when I am doing DTP to cube.  Cube has customer wise aggregation data.
    In DSO I have NetPrice(KF) and Delivered_QTY(KF).  I do a simple multiplication routine in the transformation from DSO to Cube.
    RESULT =   SOURCE_FIELDS-NET_PRICE * SOURCE_FIELDS-DLV_QTY .
    At the moment I use Active Table(With out Archive) on the DSO to get the data since this is my first load.
    Issue is that the figure (Sales Value) in the cube is incorrect. I am getting a very large values which is impossible.
    Can someone please help me.
    Shanka

    Hi,
    are you sure that cube has customer wise aggregated data..since it will always aggregate the values of the key figures for the same set of characters...
    did you checked the values for the key figures as well and if even they are inflated or is the problem with this key figure only.
    During the data load the records may aggregates first for the same values of characters and then multiplication will be happening....if that is the case then you may have to multiply the values before storing it in the data package and then let it aggregate....can be achived through start routine...
    but first verify if other key figures are also having the same issue.
    Thanks
    Ajeet

  • Issue in Data from DSO to DSO Target with different Key

    Hello All,
    I am having Issue in Data from DSO to DSO Target with different Key
    Source DSO has Employee + Wage + Post numner as key and Target has Employee + Wage Type as key.
    DSO semantic grouping works like Group By clause in sql, is my understanding right ?
    Also if someone can explain this with a small example, it would be great.
    Many Thanks
    Krishna

    Dear, as explained earlier your issue has nothing to do with semantic grouping .
    Semantic grouping is only usefull when you have written a routine in the transformation for calculations and in error handling .
    Please go through this blog which explains very clearly the use of semantic grouping .
    http://scn.sap.com/community/data-warehousing/netweaver-bw/blog/2013/06/16/semantic-groups-in-dtp
    Now coming to your above question
    DSO 1
    Employee WageTyp Amount
    100          aa          200
    200          aa          200
    100          bb          400
    100          cc          300
    If we have semantic group as Employee .   If we have Employee as key of the target DSO and update type as summation .
    then target DSO will have
    Emp                Amount
    100                 700
    200                 200
    In this case Wage type will be the last record arriving from the data package . If the record 100  cc  300 is arrivng last then wage type will be cc .
    2) Case 2
    DSO 1
    Employee WageTyp Amount
    100          aa          200
    200          aa          200
    100          bb          400
    100          aa          300
    if we do Semantic grouping with Emp and Wage Type   If we have Employee and wage type as key of the target DSO and update type as summation .
    then target DSO will have
    Emp     Wage      Amount
    100          aa          500
    200          aa          200
    100          bb          400
    Hope this helps .

  • Unable to load data from DSO to Cube

    Good morning all,
    I was trying to load data from DSO to Cube for validation. Before loading the new data, I deleted all from DSO and Cube. They contain no request at all. Cube has "Delta Update". First DSO was loaded 138,300 records successfully. Then Activated the DSO. The last when I clicked Exectue (DSO --> Cube), it loaded 0 record. I was able to load the data yesterday. What might be the reasons for this situation?
    Thank you so much!

    Hi BI User,
    For loading delta upload into the data target, there should be an initialization request in the data target with same selection criteria.
    So..first do the initialization and perform delta upload into the cube.
    Regards,
    Subhashini.

  • Regarding  Loading the data from DSO to cube.

    Hello Experts,
    I have DSO which loads data from psa  using 7.0 tranformation (using DTP).  And i have a cube which loads the data from that DSO using 3.x transfer rules. Now i have deleted the init request for a infopack before load the data into DSO. But when i load the data from DSO to cube by  right click on DSO -> click On Additional Functions -> update the 3.x data to targets, It is giving me an error like 'Delete init. request REQU_4H7UY4ZXAO72WR4GTUIW0XUKP before running init. again with same selection
    Please help me with this.
    i want to load the data in the init request to cube..
    Thanks

    Hi Shanthi,
    Thanks For reply. I have already deleted the init request from source system to DSO and then i have tried still i am getting the error.
    Thanks

  • DTP load data from DSO to CUBE can't debug

    Hi,all expert.
    I met a problem yestoday.
    When I load data from datasource to DSO,and debug the start routine,it was ok.But when I load data from DSO to CUBE,and debug the routine,it got an error like this:
    inconsistent input parameter(parameter:<unknow>,value <unknown>)
    message no: RS_EXCEPTION 101.
    I don't know why,PLZ help me,thank you very much.

    Hi,
    An alternative way to do this is to have a small code for infinite loop in your start routine. And when you start the load goto SM50 and debug the process which is executing the load, from there you can close the infinite loop and carry on with the debugging. Please let me know if you require further information.
    Thanks,
    Arminder

  • Issue while loading of data from DSO to InfoCube

    Hi Experts,
    Can you tell me what might root casue if data is coming into DSO from R3 its correct and fine as required but while loading it to InfoCube from DSO its showing wrong data like some of Line Items that were closed were shown open in Cube AND also KF values were not right
    Also there is no Routine code involved b/w DSO and InfoCube.
    Thanks in adv .
    NP

    Hope you didnt delete some req from DSO without deleting change log . This might cause inconsistency.
    If so , delete data from dso by right click delete data  and reload .

  • How to select data from a PL/SQL table

    Hi,
    I am selecting data from database after doing some screening i want to store it in a PL/SQL table (temporary area) and pass it to oracle reports.
    Is there any way to select the data from a PL/SQL table as a cursor. Or is there any other way of holding the temporary data and then pass it back as a cursor.
    Regards
    Kamal

    A PL/SQL "table" is anything but a table. Whoever came up with this term in PL/SQL to describe what is known as dynamic arrays (the correct programming terminology that existed since the 70's if not earlier and what is used in all other programming languages I'm familiar with)... well, several descriptions come to mind and none of them are complimentary.
    You cannot "select" from a PL/SQL dynamic array as it is not a table within the Oracle context of tables.
    Thus you need to convert (cast) a PL/SQL dynamic array into a temporary Oracle data set/table in order to select from it. This is in general a Bad Idea (tm). Oracle tables and SQL and concurrency controls and all that are especially designed for processing data. PL/SQL arrays is a very simplistic data structure with very limited usage. Why would you want to use that in SQL via a SELECT statement when you can use Oracle tables (or proper temp tables) instead? Besides that, it is also slow to cast a dynamic PL/SQL array into an Oracle SQL data set structure (context switching, copying of memory, etc).
    The proper way to use PL/SQL to generate data sets for use via the SQL engine is pipelined table functions.
    This is not to say that you should never use PL/SQL arrays and casting in SQL.. simply that you need to make sure that this is the correct and scalable way to do it. And that will also always be an exception to the rule when you do.

  • Error in uploading data from DSO to Infocube in 3.5(rsa1old)

    While uploading data from DSO to Infocube, I selected Initial update option
    In schedule tab when I clicked start, an error occured it says:
    Delete init request
    REQU_D4YTAGX8PEOUQJLSKOEPH9EV before running
    init. again with same selection.
    Can anyone let me know how should I delete that request.
    Thanks,
    Soujanya.

    Hi,
    Go to RSRQ and enter the request then execute. This should bring you to Monitor u2013 Administration Workbench. From there you will see the InfoSource (usually has u201C8u201D as a prefix). Get the InfoSource name. Go to RSA1 to find the InfoSource. From here it gets a bit tricky. Go to the datasource and drill down to the related InfoPackage. Go to Infopackage scheduling. Then go  to Scheduler Menu, the Initialization Options for Source System should be open. You can see from there the request with error. Let me know if this answers your question.
    Regards,
    JD Datuin

  • Select data from database tables with high performance

    hi all,
    how to select data from different database tables with high performance.
    im using for all entries instead of inner joins, even though burden on data base tables is going very high ( 90 % in se30)
    hw to increase the performance.
    kindly, reply.
    thnks

    Also Check you are not using open sql much like distict order by group by , use abap techniques on internal table to acive the same.
    also Dont use select endselect.
    if possible use up to n rows claus....
    taht will limit the data base hits.
    also dont run select in siode any loops.
    i guess these are some of the trics oyu can use to avoid frequent DATA BASE HITS AND ABVOID THE DATA BASE LAOD.

Maybe you are looking for