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.

Similar Messages

  • Read data from SharePoint using ABAP sql command

    We need to read data from a SharePoint site and update the sap object services with the information. There is a lot of information on how to put data into Sharepoint from SAP, but we need to get data from SharePoint and put it into SAP. Is it possible to retrieve data from SharePoint using sql command in ABAP program? If it is possible, what do we need to do to have SAP recognize where to get the SharePoint data?
    Richard Newman

    Hi Newman,
    You can use native sql in your abap code to read data from SharePoint's database. But I would suggest you to generate a SharePoint webservice which can provide you the neccessary data so that you can consume this webservice in ABAP
    (Will be quite faster than native sql).
    Regards,
    Ozcan.

  • 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.

  • Reading data from DLL in ABAP ?

    Hi PPl,
    Is it possible to read data in ABAP from DLL , if yes how??
    thanks ,
    sachin

    see whether this can help u
    Re: How to call a FrontEnd DLL in ABAP Program

  • How to read data from a file that is already open by another program

    Hey..
    I have made IV, where I'm trying to read data from a log file, that is being updated by another program while my IV runs.
    To be clear, this program writes data continuously to this file and I want to read from the file in LV at the same time.
    The problem is that LV reports an error when I'm trying to read the log file, even if I use to "read only" mode.
    I believe that the program that is producing the file, have some kind of lock on the file. I have tryed to copy the file and then reading from the copied file, but LV throws already an error when I try to copy the file.
    Has anyone tryed this, and found a solution.?
    Additional info: The program that produces the file is STM Studio 
    Best Regards
    Allan

    Hi Alha,
    when that file is locked by the other program you can't do anything about that - apart from quitting that other program. Probably this isn't an option to you…
    Best regards,
    GerdW
    CLAD, using 2009SP1 + LV2011SP1 + LV2014SP1 on WinXP+Win7+cRIO
    Kudos are welcome

  • Read data from MDM For Lookup and Flat table using MDM ABAP API

    Hi,
    I have requriment to read data from MDM from FLAT and Lookup table using MDM ABAP API. My design  is like this ,
    I have one ITEMS (Main table in MDM) and inside that i have one Lookup flat table ITEM_TYPE , my requriment is to read Item number and its related Item type.
    From ABAP.
    Please help if any body has any idea.
    Regards,
    Shyam

    HI Guys,
    I found my solution by myself. Below is the solution , hope this will help others:-
    Retrieve data from MDM  using MDM ABAP API.
    Step- 1. Create structure in SAP with the same name as that of MDM field code for MDM Main table.
    Step-2. Create another structure in SAP having all  lookup fields of MDM , fieldname in ECC must be same as that of MDM field
    code.
    Step-3.Create structure in SAP for  individual lookup field(Single Field only)   with the same name as MDM Field code.
    Step-4.
    DATA: IT_QUERY            TYPE STANDARD TABLE OF MDM_QUERY,  "MDM_QUERY_TABLE,
          WA_QUERY            TYPE  MDM_QUERY,
          WA_CDT_TEXT         TYPE  MDM_CDT_TEXT,
          IT_RESULT_SET_KEY   TYPE  MDM_SEARCH_RESULT_TABLE,
          WA_RESULT_SET_KEY   TYPE  MDM_SEARCH_RESULT,
          WA_STRING           TYPE  STRING.
    DATA:<Internal table> TYPE STANDARD TABLE OF <SAP Str Having all LOOKup Fields>    
    DATA: :<Internal table>TYPE STANDARD TABLE OF <SAP Str one LOOKup field>,
         <Workarea> LIKE LINE OF :<Internal table>.
    *PASS LOGICAL OBJECT NAME.
    V_LOG_OBJECT_NAME = 'Logical object name defined in Customization'.
    Define logon language, country & region for server
    WA_LANGUAGE-LANGUAGE = 'eng'.
    WA_LANGUAGE-COUNTRY = 'US'.
    WA_LANGUAGE-REGION = 'USA'.
    TRY.
        CREATE OBJECT LR_API
          EXPORTING
            IV_LOG_OBJECT_NAME = V_LOG_OBJECT_NAME.
    ENDTRY.
    CONNECT to repository. Apply particular logon language info
    CALL METHOD LR_API->MO_ACCESSOR->CONNECT
      EXPORTING
        IS_REPOSITORY_LANGUAGE = WA_LANGUAGE.
    *NOW PASS ITEM NO AND GET KEY FROM MDM.
    CLEAR WA_QUERY.
    WA_QUERY-PARAMETER_CODE  = <MDM FIELD CODE>. "Field code
    WA_QUERY-OPERATOR        = 'EQ'. "Contains
    WA_QUERY-DIMENSION_TYPE  = 1. "Field search
    WA_QUERY-CONSTRAINT_TYPE = 8. "Text search
    WA_STRING                = <Field Value>.
    GET REFERENCE OF WA_STRING INTO WA_QUERY-VALUE_LOW.
    APPEND WA_QUERY TO IT_QUERY.
    CLEAR WA_QUERY.
    *PASS ITEM NUMBER AND GET RELATED KEY FROM MDM.
    TRY.
        CALL METHOD LR_API->MO_CORE_SERVICE->QUERY
          EXPORTING
            IV_OBJECT_TYPE_CODE = <MDM Main Table>
            IT_QUERY            = IT_QUERY
          IMPORTING
            ET_RESULT_SET       = IT_RESULT_SET_KEY.
      CATCH CX_MDM_COMMUNICATION_FAILURE .
      CATCH CX_MDM_KERNEL .
      CATCH CX_MDM_NOT_SUPPORTED .
      CATCH CX_MDM_USAGE_ERROR .
      CATCH CX_MDM_PROVIDER .
      CATCH CX_MDM_SERVER_RC_CODE .
    ENDTRY.
    Pass record id into keys.
    LOOP AT IT_RESULT_SET_KEY INTO WA_RESULT_SET_KEY.
      WA_KEYS = WA_RESULT_SET_KEY-RECORD_IDS.
    ENDLOOP.
    WA_RESULT_SET_DEFINITION-FIELD_NAME = <Look field name>.
    APPEND WA_RESULT_SET_DEFINITION TO IT_RESULT_SET_DEFINITION.
    CALL METHOD LR_API->MO_CORE_SERVICE->RETRIEVE
      EXPORTING
        IV_OBJECT_TYPE_CODE      = <MDM Main Table>
        IT_RESULT_SET_DEFINITION = IT_RESULT_SET_DEFINITION
        IT_KEYS                  = WA_KEYS
      IMPORTING
        ET_RESULT_SET            = IT_RESULT_SET.
    LOOP AT IT_RESULT_SET INTO
            WA_RESULT_SET.
    *PASS KEYS INTO MAIN TABLE TO GET Structure for FALT or Look up Table
      TRY.
          CALL METHOD LR_API->MO_CORE_SERVICE->RETRIEVE_SIMPLE
            EXPORTING
              IV_OBJECT_TYPE_CODE = <MDM Main Table>
              IT_KEYS             = WA_KEYS
            IMPORTING
              ET_DDIC_STRUCTURE =<SAP Strct having all Look up fileds of MDM>         
      ENDTRY.
      LOOP AT <SAP Strct having all Look up fileds of MDM> INTO <Work area>.
        CLEAR WA_KEYS.
        APPEND <Work area>-field name TO WA_KEYS.
        CALL METHOD LR_API->MO_CORE_SERVICE->RETRIEVE_SIMPLE
          EXPORTING
            IV_OBJECT_TYPE_CODE = <MDM Lookup table name>
            IT_KEYS             = WA_KEYS
          IMPORTING
            ET_DDIC_STRUCTURE   = <Single Structure in SAP For Lookup field>.
        READ TABLE <Single Structure in SAP For Lookup field>. INTO <Work Area> INDEX 1.
    Here you can get the value of realted lookup fields associated with main table data.
      ENDLOOP.
    ENDLOOP.
    LR_API->MO_ACCESSOR->DISCONNECT( ).
    Edited by: Shyam Babu Sah on Nov 24, 2009 4:52 AM

  • Read data from Inbound ABAP proxy.Experts.

    Hi

    Hi Experts,
    I want to read data from a inbound proxy.
    Data is inside a deep structure as input.
    Inside that 6 fields are there , out of those 6 i am able to read data from 5 fildes which are of type string 1 field QUANT is there which is of  "Proxy Table Type (generated)" having data type as string.
    Now whenever i tried to assign this to any field or variable of type string or char it gives error as "can not be converted to type of" that quant field.
    Please help thanks in advance.

  • Read data from SAP R/3 Class-System

    Hello,
    first of all sorry when I posted this into the wrong subforum, but I wasn't sure about that. My Question is how to read data from the Classystem I have specified in my ABAP report.
    The goal is to read data from my individual class-system as well as data from MM and write them to a table that is to be read by another report. But right now I can't find information about the class system and abap. Maybe you know some tutorials or blogs about right that topic you can suggest?

    What class system have you specified in your report?
    Normally a class can be used by declaring a variable of type of the class in question, if this class can be instantiated this is. If your class can't be instantiated, but it has only class methods, you can call this method directly.
    But there is a lot more to this ABAP Object Oriented Programming, than just this short explanation. Search on SDN for some ABAP OO Tutorials.
    some links:
    http://help.sap.com/saphelp_nw2004s/helpdata/en/c3/225b5654f411d194a60000e8353423/frameset.htm
    http://www.sapgenie.com/abap/OO/
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/b6cae890-0201-0010-ef8b-f970a9c41d47
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/1591ec90-0201-0010-3ba8-cdcd500b17cf
    Transacation ABAPDOCU.

  • Function module to read data from a SPO

    Hi guys,
    Inside a transformation a have a rule, ABAP routine type, in wich I need to read data from a SPO (semantically partitioned object). Is there an ABAP function module or Class that allows to read data from a SPO?
    The SPO from wich I need to read the data is DSO based.
    Thanks in advance.
    David.

    Hi David,
    The normal procedure is using Function Module RSDRI_INFOPROV_READ. However, according to the documentation it only works for DSOs, InfoCubes and MultiProviders.
    Could you access as a work-around a MultiProvider? Or use any logic to first determine which PartProvider of the SPO-based DSO or InfoCube is required and then use the Function Module to read the data?
    Best regards,
    Sander

  • How to fetch published data from portal using ABAP

    Hello,
    I have a file published in the portal (with broadcaster). Now I want to use this file in an ABAP program. I can't call the web address directly because my program can't handle the Portal authentication. So I have two questions:
    - is there any way to call Portal-websites which require authentication from ABAP?
    or
    - how can I directly get access to the file without detour over the Portal (where is the place in file system).
    Thank you very much!
    Martin

    Hello Adrian,
    Thank you very much for your reply.
    > You can publish the report in MHTML format using the
    > BEx Broadcaster to a mapped drive  (completely
    > independent of the portal)  then you could pick this
    > up from your ABAP program if you have access to that
    > share.
    What do you mean with "mapped drive" - <a href="http://http://help.sap.com/saphelp_erp2005vp/helpdata/en/42/e915d951f23ee0e10000000a1553f6/frameset.htm">this</a>? I guess I could choose this drive in broadcaster at "export document in any folder" (don't know exactly English label because my system is in German language...)?
    > I dont really see the value of publishing the report
    > to KM if all you are wanting to do is read this back
    > into your ABAP program.  Why are you wanting to
    > publish the report to the portal in the first place?
    I need to get the image of a BW-chart in ABAP because I want to use it in SAP Interactive Forms by Adobe (I have an ABAP program to fetch my data and create the form). I could create my own chart of the data with the Internet Graphics Service but this would be a lot of work. You can create this charts very easily using the Chart Designer which i.e. is included in the Web Application Designer. If you create a Web Site containing a chart you can access this via browser and you have the chart as an image (created from current data). I tried simply to call this website with ABAP but I can not "log in" and so I have no access to this page. Because of this I had the idea to use the broadcaster to automatically publish this Web Application when my data were updated. If I use MHTML my chart-image is saved separately. This just would work for me. And now I want to get this image as a binary with ABAP.
    I hope you understand my problem.
    Martin

  • Read data from serial port or TCP port of frontend PC

    Hello Friends,
    I have requirement to read data from device connected to frontend PC which will provide meter reading data.
    Vendor has given me two option.
    1. Device can be connected to seiral port and data transfer will be done through MODBUS RTU protocol.In that case data need to capture from serial port.
    2. Device can be connected to TCP port and Socket program can be provided for data transfer. In that case SAP will act as client and communicate with TCP port.
    There will be multiple workstation with individual meters connected to them.
    I am aware of text file interfacing through front end tools using custom code using VB,JAVA or others.
    Is there any solution availble  to achieve above things using  ABAP other than text file , like direct communication?
    I am using ECC 6.0.

    Hello,
    Socket programming in not available on ABAP, but you may use RFC for the same.
    Use the below links for more details
    [Link 1|http://help.sap.com/printdocu/core/print46c/en/data/pdf/BCFESDE2/BCFESDE2.pdf]
    [Link 2|http://forums.sdn.sap.com/thread.jspa?threadID=1820233]
    Regards,
    Abhishek

  • Reading data from infocube

    Hi all,
    We have an infocube which contains some figures like number of days, number of hours etc. We should calculate some indicators on them, something like:
    Ind = Hours1 * 100 / Hours1 + Hours2
    where Hours1 and Hours2 are figures which come from two different records, with codes 1 and 2.
    We are not using BEx, but some other reporting tool which takes quite a long time over it. So we were asked to write an ABAP program which should read the data out of the InfoCube and calculate these indicators on basis of such fomulas.  Writing a Transfer Rule with the InfoCube as DataSource proved not to be such a good idea because data is split in packages for the upload, so a subroutine within the transfer rule might not be able to find the records with codes 1 and 2 within the same package and that gives errors.
    The question is: does anyone know of programs/functions/classes which could do the job? so read data from the infocube and eventually update it back into the infocube after the calculations?
    Thanks in advance,
    Ioana

    Hi Ioana,
    maybe Analysis Process Designer (APD) can solve your problem. In an APD process you can read the data from any InfoProvider, calculate your key figures in an ABAP routine and write the result to an ODS. This ODS has to be transactional and can't be directly reported, but you can report the ODS data by defining an InfoSet on it; you can also write the ODS data to any cube via the data mart interface. The data package split shouldn't be a problem in the APD process because you can define a partitioning characteristic in the APD routine.
    The APD is available in BW 3.x via transaction RSANWB.
    Martin

  • Read data from xml files and  populate internal table

    Hi.
    How to read data from xml files into internal tables?
    Can u tell me the classes and methods to read xml data..
    Can u  explain it with a sample program...

    <pre>DATA itab_accontextdir TYPE TABLE OF ACCONTEXTDIR.
    DATA struct_accontextdir LIKE LINE OF itab_accontextdir.
    DATA l_o_error TYPE REF TO cx_root.
    DATA: filename type string ,
                 xmldata type xstring .
    DATA: mr      TYPE REF TO if_mr_api.
    mr = cl_mime_repository_api=>get_api( ).
    mr->get( EXPORTING  i_url     = 'SAP/PUBLIC/BC/xml_files_accontext/xml_accontextdir.xml'
                  IMPORTING  e_content = xmldata ).
    WRITE xmldata.
    TRY.
    CALL TRANSFORMATION id
          SOURCE XML xmldata
          RESULT shiva = itab_accontextdir.
      CATCH cx_root INTO l_o_error.
    ENDTRY.
    LOOP AT itab_accontextdir INTO struct_accontextdir.
        WRITE: / struct_accontextdir-context_id,
               struct_accontextdir-context_name,
               struct_accontextdir-context_type.
        NEW-LINE.
        ENDLOOP.</pre>
    <br/>
    Description:   
    In the above code snippet I am storing the data in an xml file(you know xml is used to store and transport data ) called 'xml_accontextdir.xml' that is uploaded into the MIME repository at path 'SAP/PUBLIC/BC/xml_files_accontext/xml_accontextdir.xml'.
    The below API is used to read a file in MIME repo and convert it into a string that is stored in ' xmldata'. (This is just a raw data that is got by appending the each line of  xml file).
    mr = cl_mime_repository_api=>get_api( ).
    mr->get( EXPORTING  i_url     = 'SAP/PUBLIC/BC/xml_files_accontext/xml_accontextdir.xml'
                  IMPORTING  e_content = xmldata ).
        Once the 'xmldata' string is available we use the tranformation to parse the xml string that we have got from the above API and convert it into the internal table.
    <pre>TRY.
    CALL TRANSFORMATION id
          SOURCE XML xmldata
          RESULT shiva = itab_accontextdir.
      CATCH cx_root INTO l_o_error.
    ENDTRY.</pre>
    Here the trasnsformation 'id ' is used to conververt the source xml 'xmldata' to resulting internal table itab_accontextdir, that have same structure as our xml file 'xml_accontextdir.xml'.  In the RESULT root of the xml file has to be specified. (In my the root is 'shiva'). 
    Things to be taken care:
    One of the major problem that occurs when reading the xml file is 'format not compatible with the internal table' that you are reading into internal table.  Iin order to get rid of this issue use one more tranformation to convert the data from the internal table into the xml file.    
    <pre>TRY.
          CALL TRANSFORMATION id
            SOURCE shiv = t_internal_tab
            RESULT XML xml.
        CATCH cx_root INTO l_o_error.
      ENDTRY.
      WRITE xml.
      NEW-LINE.</pre>
    <br/>
    This is the same transformation that we used above but the differnce is that the SOURCE and RESULT parameters are changed the source is now the internal table and result is *xml *string. Use xml browser that is available with the ABAP workbench to read the xml string displayed with proper indentation. In this way we get the format of xml file to be used that is compatable with the given internal table. 
    Thank you, Hope this will help you!!!
    Edited by: Shiva Prasad L on Jun 15, 2009 7:30 AM
    Edited by: Shiva Prasad L on Jun 15, 2009 11:56 AM
    Edited by: Shiva Prasad L on Jun 15, 2009 12:06 PM

  • Reading data from View

    HI all,
    Can anyone help me please. I want to read data from view with below simple program
    Report zread_view.
    DATA: it_t053 TYPE TABLE OF V_T053,
               wa_t053 like line of it_t053.
    *SELECT * INTO TABLE it_t053 from v_t053.*
    LOOP AT it_t053 INTO wa_t053.
      WRITE: / wa_t053-KURZT.
    ENDLOOP.
    But when activating this message is show:
    'V_T053" is not defined in the ABAP Dictionary as a table, projection view, or database view.
    Need for anyone help...?
    Thanks,
    Ramses

    hi,
    which view you are accessing in the program? you can able to access only database view and projection view from prgram.
    the view which you are using in the program is niether database view nor projection view. that is why you are getting that error message ''V_T053" is not defined in the ABAP Dictionary as a table, projection view, or database view".
    hope this will help you.
    Regards,
    Kiran

  • How to retrieve modeinfo[n].context_id_uuid from inside an ABAP program ?

    If you login to an SAP session and then create another session via the system menu option (not a second login), transaction SM04 will show two different values for the parameter:
    modeinfo[n].context_id_uuid
    I need to know how to retrieve the value of this parameter from inside an ABAP program.
    This question is related to the one Rich and Naren and I were discussing - about how to create a unique shared buffer memory id that will distinugish between a two sesssions of a single user who happens to be "MIGO'ng" twice.
    Thanks for whatever answer anyone can provide ...
    djh
    Note: also posted in ABAP General ...

    Rich answered in ABAP general:
    REPORT ZRICH_0001 .
    type-pools: thfb.
    data: context_id type THFB_CONTEXT_ID.
    CALL FUNCTION 'TH_GET_CONTEXT_ID'
    IMPORTING
       CONTEXT_ID       = context_id .
    write:/ context_id .

Maybe you are looking for