Reading InfoCube contents in ABAP

Dear,
I'm reading the contents of an InfoCube using FM RSDRI_INFOPROV_READ. This works fine, characteristics & keyfigures are coming through, only when I want the currency keys and units, the returned itab (E_T_DATA) contains additional records in stead of the currencies and units filled in the corresponding entries. Probably beacuse units are in a separate dimension. Does anyone know how I can populate the currency keys & units in the same records as where the keyfigures are stored?
Thanx in advance for your help!
Regards,
Marco

Hi Lakshman,
1.Files in application server are called 'Sequential files'. they are also called as 'Dataset'.
2.To handle sequential file we can follow the below said procedures.
   a.  To open sequentioal file:
          OPEN DATASET <FILENAME> FOR { OUTPUT/INPUT/APPENDING}
          IN {TEXT MODE/BINARY MODE}
   b. To process ( reading/writing):
       TRANSFER <FIELD> TO <FILE NAME>,
       READ DATASET <FILENAME> INTO <FIELD>.
  c.  To close:
        CLOSE DATASET <FILENAME>
3. To see  the application files tcode: AL11
4. Download the files from application server to presentation server : CG3Y
5. Presentation server to application server : CG3Z
Regards,
Sakthivel.VT

Similar Messages

  • Reading WebDAV Content from ABAP

    Hello,
    I like to read WebDAV Content from SAP NetWeaver Portal KM with ABAP.
    For writing Content with WebDAV I found this post:
    A small working example of how to use the Abap webdav client to write files
    With Method GET_CONTENT from CL_SWDCL_NAMESPACE_CLIENT I can read single files, but what I need is a list with files and folders for a given path.
    I also tried to use the Interface IF_SWDCL_BASIC_SEARCH_CLIENT, but I only get HTML-Errorcodes 400 or 422 since I don't know which parameters I need.
    Maybe there is someone here who can help me to solve this problem.
    Thank you.

    Hello,
    I face the same problem, did you already find a solution you can share?
    Thanks in advance
    Stefan

  • Read IDOC content in abap program

    Hi all
    using IDOC number, i'd like to read informations containted in that IDOC.
    In EDI_* Function moduls i have found EDI_DOCUMENT_OPEN_FOR_EDIT
    The problem is that this FM is used to process IDOC to change its content. i supose that the IDOC is enqued when processed by this FM.
    Do you know any other way to access IDOC data content in READ mode
    Thank you in advance
    Regards

    Hi,
    You can use the following FM.
    IDOC_READ_COMPLETELY (Read IDoc Data)
    IDOC_TYPE_COMPLETE_READ (Read IDoc Structure and Segments)
    or
    read the idoc data from database table edid4 and edids (idoc status))and edidc (idoc control data).
    Regards,
    S.Velsankar

  • Read XML content in ABAP

    Hi Experts,
    I have a requirement, where I need to Parse the XML file after reading it from application server. Based on the data, I need to add some Tags to XML data.
    Can we achieve the solution in ABAP.
    Request your expertise.
    Thank you,
    Amit

    Hi Amit,
    Yes, you can achieve this in SAP either by creating a DOM representation of the XML document, or by the parser firing events as logical elements are encountered in a run through an XML document.
    Refer the following documents for more details.
    DOM-based method - Parsing an XML document DOM-based - Application Development on AS ABAP - SAP Library 
    Event Based - Parsing an XML document event-based - Application Development on AS ABAP - SAP Library 
    Refer this document for sample code - Parse an xml file and insert values in ABAP - ABAP Development - SCN Wiki
    Regards
    Anoop

  • Read message content in ABAP reporting

    Hi,
    We need to read the message payload content for reporting purposes. I suppose this data is contained in tables SXMSCLUP and SXMSCLUR. (field CLUSTD)
    The problem is that the content is in LRAW type.
    Do you know how to convert this type to get a comprehensive content?
    Thanks,
    Laurent.

    Hi,
    Please use the function module SCMS_BINARY_TO_XSTRING to convert this data.
    I have never tried it but probably this could help you out. Go through below discussion
    Tables for XI messages
    From http://help.sap.com/saphelp_nw04/helpdata/en/cf/21f2e5446011d189700000e8322d00/content.htm:
    RAW: Uninterpreted byte string. Fields of type RAW may have only a maximum length of 255 in tables. If longer raw fields are required in tables, you should select data type LRAW.
    There are some Java Classes for that..
    Just look into this..
    http://jakarta.apache.org/commons/codec/apidocs/org/apache/commons/codec/binary/BinaryCodec.html
    http://www.stanford.edu/group/coursework/docsTech/oracle/oracle/sql/RAW.html
    OR Try defining the message element type as xsd:base64Binary
    thanks
    Swarup

  • How to access Infocube content using an ABAP program

    Hi,
       I am trying to access infocube contents using a ABAP program in BW.
       It is easy to access ODS content as we have NEW DATA or ACTIVE DATA
       tables. Is there any way we can access Infocube content.
       I tried using the FACT table but it has only Keyfigure data.
    thanks
    arshad.

    Hi,
    I would suggest to use a transactionnal cube, even if you do not use BPS to feed it.
    Then, you create a layout in transaction BPS0 (~ similar to a query), and you can access the cube content by simply using the SAP function <b>API_SEMBPS_GETDATA</b>.
    This is easy and fast.
    Regards,

  • Reading HTML Content using Web Dynpro ABAP

    Hello,
    I was wondering if it is possible to read the content (HTML) behind a given URL using Web Dynpro ABAP.  If so, are there any functions available to parse the HTML ?   I have been asked to develop an application that requires going to a URL, reading the content, and formatting a table from that content for presentaion within Web Dynpro ABAP.  The HTML of the URL is nothing more than a "Table of Contents" to existing documentation ( Word Documents )
    Thank you for any help / advice you can provide
    Larry

    You can get the HTML returned in a table using fm RSFO_HTML_REQUEST2.
    Once you have that, you can convert it to a string using any number of methods. CL_RSR_WWW_RENDERER=>TABLE_TO_STRING should work fine.
    One option for parsing it would be to get it converted into an iXML object, but you might have to do quite a bit of manipulation first depending on what the html looks like. You can see more info here on iXML classes: [http://help.sap.com/saphelp_nw04/helpdata/de/86/8280ba12d511d5991b00508b6b8b11/frameset.htm|http://help.sap.com/saphelp_nw04/helpdata/de/86/8280ba12d511d5991b00508b6b8b11/frameset.htm]
    Otherwise I would just make use of find statements with regex patterns to sort through the html.

  • Restrict Data by Reading Infocube from ABAP

    Hi SDN Community
    I have written ABAP in order to read the contents of the ODS.  This code is in a BADI, and against a customer exit variable that is placed in the query.
    Is it possible to write similar ABAP code to query a cube
    and retrieve same Funct_loc1.
    Thank you.
    Simon
           Read Production Cube to determine all the Alternative Labels
           (Functional Locations)
               SELECT  Funct_loc1
                FROM   /bic/aearo_o5000
                INTO   lst_range-low
                WHERE  /BIC/ZDATIVAR = '0000000030'
                AND    /BIC/ZCCFUNCCD = ls_ccfunccode
                AND    /BIC/ZSOURSYS = 'CQ'
                AND    FISCYEAR = ld_fiscyear
                AND    SOURSYSTEM = ls_soursystem.
                lst_range-sign     = 'I'.
                lst_range-opt      = 'EQ'.
                append lst_range to e_s_export-e_t_range.
                lv_count = lv_count + 1.
               ENDSELECT.

    Hi Sunmit
    Thank you for your reply.
    I try "TEST" in SE37 on this function module but it fails to execute.
    I will try as you suggest to put this in ABAP code and see how it works.
    If you can provide sample code that would be much appreciated.
    Thank you.
    Simon

  • How to print PDF file content from ABAP in background?

    Hi,
    Is it possible to print PDF file content from ABAP in background?
    I have some PDF content which I need to print it, these PDF files are generated outside the SAP.
    Please have you any suggestions?
    Thank you
    Tomas

    <b><u>Solution:</u></b><br>
    <br>
    The target output device must support PDF print, this is only one limitation.<br>
    <br>
    REPORT  z_print_pdf.
    TYPE-POOLS: abap, srmgs.
    PARAMETERS: p_prnds LIKE tsp01-rqdest OBLIGATORY DEFAULT 'LOCL',
                p_fname TYPE file_table-filename OBLIGATORY LOWER CASE,
                p_ncopi TYPE rspocopies OBLIGATORY DEFAULT '1',
                p_immed AS CHECKBOX.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_fname.
      DATA: lv_rc     TYPE i,
            lv_filter TYPE string.
      DATA: lt_files TYPE filetable.
      FIELD-SYMBOLS: <fs_file> LIKE LINE OF lt_files.
      CONCATENATE 'PDF (*.pdf)|*.pdf|' cl_gui_frontend_services=>filetype_all INTO lv_filter.
      CALL METHOD cl_gui_frontend_services=>file_open_dialog
        EXPORTING
          file_filter             = lv_filter
        CHANGING
          file_table              = lt_files
          rc                      = lv_rc
        EXCEPTIONS
          OTHERS                  = 1.
      IF sy-subrc NE 0 AND lv_rc EQ 0.
        MESSAGE 'Error' TYPE 'E' DISPLAY LIKE 'S'.
      ENDIF.
      READ TABLE lt_files ASSIGNING <fs_file> INDEX 1.
      IF sy-subrc EQ 0.
        p_fname = <fs_file>-filename.
      ENDIF.
    AT SELECTION-SCREEN.
      DATA: lv_name   TYPE string,
            lv_result TYPE boolean.
      lv_name = p_fname.
      CALL METHOD cl_gui_frontend_services=>file_exist
        EXPORTING
          file                 = lv_name
        RECEIVING
          result               = lv_result
        EXCEPTIONS
          OTHERS               = 1.
      IF sy-subrc NE 0.
        MESSAGE 'Bad file!' TYPE 'E' DISPLAY LIKE 'S'.
      ENDIF.
      IF lv_result NE abap_true.
        MESSAGE 'Bad file!' TYPE 'E' DISPLAY LIKE 'S'.
      ENDIF.
    START-OF-SELECTION.
    END-OF-SELECTION.
      PERFORM process.
    FORM process.
      DATA: lv_name     TYPE string,
            lv_size     TYPE i,
            lv_data     TYPE xstring,
            lv_retcode  TYPE i.
      DATA: lt_file TYPE srmgs_bin_content.
      lv_name = p_fname.
      CALL METHOD cl_gui_frontend_services=>gui_upload
        EXPORTING
          filename                = lv_name
          filetype                = 'BIN'
        IMPORTING
          filelength              = lv_size
        CHANGING
          data_tab                = lt_file
        EXCEPTIONS
          OTHERS                  = 1.
      IF sy-subrc NE 0.
        MESSAGE 'Read file error!' TYPE 'E' DISPLAY LIKE 'S'.
      ENDIF.
      CALL FUNCTION 'SCMS_BINARY_TO_XSTRING'
        EXPORTING
          input_length = lv_size
        IMPORTING
          buffer       = lv_data
        TABLES
          binary_tab   = lt_file
        EXCEPTIONS
          failed       = 1
          OTHERS       = 2.
      IF sy-subrc NE 0.
        MESSAGE 'Binary conversion error!' TYPE 'E' DISPLAY LIKE 'S'.
      ENDIF.
      PERFORM print USING p_prnds lv_data CHANGING lv_retcode.
      IF lv_retcode EQ 0.
        WRITE: / 'Print OK' COLOR COL_POSITIVE.
      ELSE.
        WRITE: / 'Print ERROR' COLOR COL_NEGATIVE.
      ENDIF.
    ENDFORM.                    " PROCESS
    FORM print USING    iv_prndst  TYPE rspopname
                        iv_content TYPE xstring
               CHANGING ev_retcode TYPE i.
      DATA: lv_handle    TYPE sy-tabix,
            lv_spoolid   TYPE rspoid,
            lv_partname  TYPE adspart,
            lv_globaldir TYPE text1024,
            lv_dstfile   TYPE text1024,
            lv_filesize  TYPE i,
            lv_pages     TYPE i.
      CLEAR: ev_retcode.
      CALL FUNCTION 'ADS_SR_OPEN'
        EXPORTING
          dest            = iv_prndst
          doctype         = 'ADSP'
          copies          = p_ncopi
          immediate_print = p_immed
          auto_delete     = 'X'
        IMPORTING
          handle          = lv_handle
          spoolid         = lv_spoolid
          partname        = lv_partname
        EXCEPTIONS
          OTHERS          = 1.
      IF sy-subrc NE 0.
        ev_retcode = 4.
        RETURN.
      ENDIF.
      CALL FUNCTION 'ADS_GET_PATH'
        IMPORTING
          ads_path = lv_globaldir.
      CONCATENATE lv_globaldir '/' lv_partname '.pdf' INTO lv_dstfile.
      OPEN DATASET lv_dstfile FOR OUTPUT IN BINARY MODE.
      IF sy-subrc NE 0.
        ev_retcode = 4.
        RETURN.
      ENDIF.
      TRANSFER iv_content TO lv_dstfile.
      IF sy-subrc NE 0.
        ev_retcode = 4.
        RETURN.
      ENDIF.
      CLOSE DATASET lv_dstfile.
      IF sy-subrc NE 0.
        ev_retcode = 4.
        RETURN.
      ENDIF.
      CALL FUNCTION 'ZBAP_RM_PDF_GET_PAGES'
        EXPORTING
          iv_content = iv_content
        IMPORTING
          ev_pages   = lv_pages.
      lv_filesize = XSTRLEN( iv_content ).
      CALL FUNCTION 'ADS_SR_CONFIRM'
        EXPORTING
          handle   = lv_handle
          partname = lv_partname
          size     = lv_filesize
          pages    = lv_pages
          no_pdf   = ' '
        EXCEPTIONS
          OTHERS   = 1.
      IF sy-subrc NE 0.
        ev_retcode = 4.
        RETURN.
      ENDIF.
      CALL FUNCTION 'ADS_SR_CLOSE'
        EXPORTING
          handle = lv_handle
        EXCEPTIONS
          OTHERS = 1.
      IF sy-subrc NE 0.
        ev_retcode = 4.
        RETURN.
      ENDIF.
    ENDFORM.                    " PRINT

  • BI Content Datasources' ABAP Logic

    Dear Friends,
    Where and how can I find the BI Content Datasources' ABAP Logic. I am particularly looking for the code for 2LIS_03_BX, 2LIS_03_BF and 2LIS_03_UM.
    Thanks!

    Hi,
    Go to transaction RSO2 (Generic datasources) in ECC, put the datasource name in the transaction data field and click on display, then you will get a warning message at the bottom of the screen like below:
    datasource 2lis_03_bf is extacted using function module mcex_bw_lo_api
    likewise you can check for other datasources as well. Go to the function modules in SE37 and check the code there.
    Regards,
    Murali.

  • Retrieving an URL content in ABAP

    Hi Experts,
        I have to read the content of http://.......... URL content to ABAP. Is there any method or function module to read??
    Thanks and regards,
    Venkatraman.N.

    Hi!
    Take a look at the folliwing programms and examples:
    RSHTTP*
    They work really good.
    Best regards,
    Esteban

  • Read external mail through ABAP

    Hi All,
    i want read external mail ( say yahoo, gamil etc) through ABAP code with attachments.
    Thanks and regards
    JK

    Hi,
    Reading external email through pure ABAP won't be an easy task as far as I know. Because it needs user login and password authentication. Therefore it would be better to use something like cURL, which is a good tool for simulating a user's actions at a web browser. You can use cURL on a web server with php installed and after reading the emails pass the contents to ABAP.

  • FM to Read InfoCube

    Experts,
    Is there a Function Module in R/3 that can be used to Read an Infocube?
    Thanks.

    Hi,
    Check out the below threads:
    How to read data ?
    Re: Read data from 0BWTC_C02 via ABAP
    BW/read Infocube
    Sample code of  FM RSDRI_INFOPROV_READ
    FM Rsdri_Infoprovider_read
    The first thread has some sample code also.
    Thanks.

  • Reading PDF contents to Context

    Hi,
      How to read PDF contents in to context?
    Thanks
       Vinod V

    Hi,
    I have created a blog on uploading PDF Data to the View context.
    Reward if helpful.
    [/people/shruti.rathour/blog/2008/02/07/uploading-sap-interactive-form-on-the-abap-webdynpro-view]
    Thanks.

  • Read the content repository images

    Dear All,
    How can i read the content repository images. I have uploaded the image and assigned the image for the employee.I have used the Web dynpro ABAP for attaching the interactive form. Now my request is to download the images from the content server to the interactive form i.e. when the manager is trying to look his page, he needs to see his image in the Interactive form when others their corresponding image is need to be shown. how can i do that?
    Thanks
    Yogesh

    There is a particular case with sugested function, if content is generated on the fly by the server -php, cgi, etc.-
    In this case, http server doesn´t knows total size of response data, so response shows a chunked transfer-encoding header and data is parted in chunks, each one starting with it´s size, and following the data.
    HTTP/1.1 200 OK
    Date: Tue, 30 Apr 2013 12:43:41 GMT
    Server: Apache/1.3.31 (Win32) mod_fastcgi/2.4.1
    Connection: close
    Transfer-Encoding: chunked
    Content-Type: image/jpeg
    f49
    ÿØÿà  JFIF
    I´m using this function to decode parted response, with initial chunkedString with firs chunk size; in this case, f49:
    PartsSeparator="\r\n";
    function getPartedBody(partedBodyString) {
        var separatorPosition=partedBodyString.indexOf(PartsSeparator);
        var chunkSize=new Number("0x"+partedBodyString.substring(0,separatorPosition));
        separatorPosition+=PartsSeparator.length;
        var bodyString=new String("BINARY");
        bodyString="";
        if (chunkSize>0)
            bodyString=partedBodyString.substring(separatorPosition,separatorPosition+chunkSize)+
                getChunkedResponse(partedBodyString.substring(separatorPosition+chunkSize+PartsSeparator. length));
        return bodyString;
    Hope this helps
    regards

Maybe you are looking for

  • How to download pdf files right away?

    Background: Our company(Jinisys Software Inc.) targets hotel owners to download our brochure(pdf) about hotel management system. We have different pdf files on few of our webpages. I'd like to point out that adobe did a great job in displaying the pd

  • How can I download the original Apple version of Java 6 please?

    I have an iMac OSX 10.10.1 Yosemite with Java 1.8.0_25. How can I download the original Apple version of Java 6 please? All my attempts are referred to the latest version of Java, which I already have! Catch 22! Thanks

  • Deadline agent for a task

    Any table or function module available to get the deadline agent of a workitem ?  . Thanks, Sarath.

  • Passing values to modal popup

    Apexers, I need help with this modal popup, it works correctly but not passing values from page page1 to my page3. How do i pass these paramater values to page3, function modalWin() { if (window.showModalDialog) { window.showModalDialog("f?p=&APP_ID.

  • Hii everyone,I am using mac os 10.8.3 and its getting not responding every time.

    Hii guys ,I am using ma os 10.8.3 and my finder is getting not responding all the time ,I can hardly use the finder for 2 min and it gets jammed.after a few days vlc player,then safari and its continuing .Now i even cant open the Launch pad and the a