Retrieving URL content in ABAP

Hi Experts,
    How can I retrieve the URL content of a website in ABAP.
    i.e., In a webpage if write click and press "View Source", the HTML source code will come. That source code I have to take with the aid of URL of the webpage. I know how to do this in Java & .NET. but I need in ABAP.
Thanks and regards,
Venkat

Hi,
check this.
link:[Re: Generate SAP Portal URL in ABAP;
hope u'll get some help.
Regards,
Sneha.

Similar Messages

  • 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 large Excel cell content using ABAP class i_oi_spreadsheet

    Hello,
    I am trying to read an excel file using ABAP methods of interface i_oi_spreadsheet.
    Unfortunetly some of my cells contain data that exceeds the 256 characters size.
    To retrieve the content of the excel speadsheet, I am using method get_ranges_data.
    Unfortunetly as the returned structure is of type soi_generic_table, the content of the cell is truncated to the maximum limit of 256.
    Is there a way to read cells with large content ??
    Thanks
    Regards
    Jean-Pierre

    Same problem for me on ECC 6.0. Hope for a solution.

  • EXC_BAD_ACCESS on device when getting URL contents

    Hi Guys
    I'm having an issue retrieving the contents of a URL, only when I am testing on the iPhone device itself.
    It works fine when I use the simulator but when testing on the device itself I get a EXC_BAD_ACCESS on the following line:
    NSString * example = [NSString stringWithContentsOfURL:nsURL];
    The device is a iPhone 4 with iOS 4.1
    Can someone please help as I have tried everything I can think of?
    Thanks in advance

    The error occurs when I call [NSString stringWithContentsOfURL:nsURL];
    The entire code is as follows:
    NSURL *nsURL = [NSURL URLWithString:@"http://www.mywebsite.com/xmlfeed.jsp"];
    NSString * example = [NSString stringWithContentsOfURL:nsURL];
    Only other thing I can add is that this code is running in a background thread when the app is launched and that the returned data is XML.
    I have also tried using TouchXML and the following line also has the same problem:
    CXMLDocument *xmlParser = [[[CXMLDocument alloc] initWithContentsOfURL:[NSURL URLWithString:@"http://www.mywebsite.com/xmlfeed.jsp"] options:0 error:nil] autorelease];
    The strange thing is that both options work 100% of the time on the simulator. Could there be a flag or option I need to set to allow the app to communicate with the network connection?

  • Problems while retrieving from content repository

    Hi,
    I am facing problems while retrieving documents stored the content repository. I have some pdf files as well as text documents stored in the content repository. I need to get retrieve the contents of the text files. My problem lies with how to retrieve the data from the files.
    I have used SCMS_URL_GENERATE, followed by the FM ''HTTP_GET''.  Though I  do get the File id , my problem is how to proceed from this point. Should i wriite an RFC ?
    Thanks and Regards,
    Anie

    Hi,
    I checked the code one again - SCMS_URL_GENERATE is used to send url to the user (to open file in web browser).
    SCMS_HTTP_GET code looks like this:
    CONCATENATE <ls>-vbeln space <ls>-optarcnr
      INTO lv_vbeln_obj
      RESPECTING BLANKS.
    SELECT SINGLE *
      FROM toa01
      WHERE sap_object EQ 'VBRK'
        AND archiv_id EQ co_arch
        AND ar_object EQ 'SDOINVOICE'
        AND object_id EQ lv_vbeln_obj.
    CALL FUNCTION 'SCMS_HTTP_GET'
      EXPORTING
        crep_id   = co_arch
        doc_id    = toa01-arc_doc_id
        comp_id   = 'data'
        length    = 0
        no_cache  = no_cache
      IMPORTING
        length    = comp-size
        mimetype  = comp-type
      TABLES
        data      = comp-bin
      EXCEPTIONS
        not_found = 1
        OTHERS    = 2.
      IF sy-subrc IS NOT INITIAL.
        PERFORM log_create USING <ls>-vbeln.
      ENDIF.
    IF comp-bin IS NOT INITIAL.
      CALL FUNCTION 'GUI_DOWNLOAD'
        EXPORTING
          bin_filesize = comp-size
          filename     = dstpc
          filetype     = 'BIN'
        TABLES
          data_tab     = comp-bin
        EXCEPTIONS
          OTHERS       = 1.
      IF sy-subrc IS NOT INITIAL.
        PERFORM log_create USING <ls>-vbeln.
      ELSE.
        MESSAGE s000(38) WITH 'Success'.
      ENDIF.
    ENDIF.
    Regards,
    Przemysław

  • Retrieve url parameters

    Hi All
    I need to retrieve all the parameters of the url, for example if the URL looks like
    http://www.mydomain.com/MyApp.html#firstName=Nick;lastName=Danger
    (example used: http://livedocs.adobe.com/flex/3/html/help.html?content=deep_linking_5.html )
    Anyway, the code to extract the parameters looks like
    then the parameters are extracted like
            private function init(e:Event):void {
                bm = BrowserManager.getInstance();               
                bm.init("", "Welcome!");
                /* The following code will parse a URL that passes firstName and lastName as
                   query string parameters after the "#" sign; for example:
                   http://www.mydomain.com/MyApp.html#firstName=Nick&lastName=Danger */
                var o:Object = URLUtil.stringToObject(bm.fragment, "&");               
                fName = o.firstName;
                lName = o.lastName;               
    However, the fName and lName remain empty. Any suggestion how to retrieve URL parameters ?
    cheers
    Luca

    Hi scaljeri...try this...it worked for me last week:
    protected function readQueryString():String{
              var urlParams:Dictionary = new Dictionary();
              if (ExternalInterface.available)
                   var fullUrl:String = ExternalInterface.call('eval', 'document.location.href');
                   var paramStr:String = fullUrl.split('?')[1];
                   if (paramStr != null)
                        var params:Array = paramStr.split('&');
                        var s:String;
                        for (var i:int=0; i < params.length; i++)
                             var kv:Array = params[i].split('=');
                             urlParams[kv[0]] = kv[1];
                             s =  kv[1];
                   return s;
              return null;
    yellow

  • 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

  • How to retrieve the content type used in a document library (C# - Client Model).

    Hello,
    I need to know if it's possible to retrieve the content type used in a document library, so I can know the columns active and used in this document library. I am using the Client Model in C#.
    Thanks

    First, retrieve your document library as a List object. Then, use the
    List.ContentTypes property to iterate through all the content types assigned to the list.
    Blog:
    blog.beckybertram.com |
    RSS | @beckybertram |
    SharePoint 2010: Six-in-One

  • Servlet retrieves pdf content stored in oracle and sends this content

    I have pdf content stored in an oracle database. The database column type is LONG RAW. I am retrieving the contents using jdbc's getBinaryStream. The content type is set to pplication/pdf. When the code is executed, the acrobat is launched but the content is not displayed. After analyzing the contents retrieved from the database, I discovered that characters were missing. I replicated the same code in a different language and it was working.
    Has anyone else encountered this problem? If so, how was it resolved.
    Any ideas or comments would be appreciated.
    z.

    What is the character set of the Oracle db that you are using. I would suggest that you try to set the char set to Unicode and try.

  • Url.Content on Azure

    I have an ASP.NET MVC 2 application that has page with a link to a pdf file
    <a href="<%= Url.Content("~/Downloads/test1.pdf") %>">test1</a>
    Downloads directory is at MVCApplication1/Downloads
    This works fine locally and on ISS, but returns a page not found when uploaded to Azure.

    Hi,
    Please check the below link as it has the same issue answered.
    http://stackoverflow.com/questions/5076846/url-content-on-azure
    Regards,
    Mekh.

  • Retrieve the content of the file in the indexed column

    In Oracle UltraSearch, how to retrieve the content of the file in the indexed colun cache_file_path.
    we try the flowing sql
    SELECT cache_file_path FROM mytable
    WHERE contains (mytable.cache_file_path, 'viet', 1) &gt; 0
    but we only have the cache_file_path column, not the content of the file were indexed.

    Please post on the UltraSearch forum.

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

  • URL encoding in ABAP

    Hi all,
    do you know an ABAP function to encode a string to pass in an url so that to get "http%253A%252F%252Fsap.com%252Fxi%252FAP%252FCRM%252FGlobal"
    I'm passing dynamicParameter via an URL from an ABAP to a Java WD appli. They are automatically decoded on java side, but I need to encode them on ABAP side.
    Thanks and regards,
    Marie-Pierre

    Hi,
    there is new function in ABAP for escaping characters in different formats, including URL/URI.
    Predefined escape function in ABAP
    Peter

  • ClassCastException when retrieving SOAP content

    I got a java.lang.ClassCastException: com.sun.xml.messaging.saaj.soap.dom4j.TextImpl
    when retrieving SOAP content.
    The code looks like:
    SOAPPart part = message.getSOAPPart();
    SOAPEnvelope envelope = part.getEnvelope();
    SOAPBody body = envelope.getBody();
    SOAPBodyElement bookElement = ( SOAPBodyElement ) body.getChildElements().next();
    SOAPElement isbnElement = ( SOAPElement ) bookElement.getChildElements().next();
    System.out.println( isbnElement.getValue() );
    The SOAP message as follows:
    <?xml version="1.0" encoding="UTF-8"?>
    <soapenv:Envelope soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/">
    <soapenv:Body>
    <ns1:getPrice xmlns:ns1="http://www.deitel.com/BookPrie.wsdl">
    <arg0 xsi:type="xsd:string">0130895601</arg0>
    </ns1:getPrice>
    </soapenv:Body>
    </soapenv:Envelope>
    Any help?
    Thanks in advance.

    I had a similar problem and solved it. Please look at http://forum.java.sun.com/thread.jsp?forum=331&thread=268806 .

  • Slow content retrieval from content repository on Weblogic8.1 portal server

    The performance of content retrieval from content repository on Weblogic8.1 portal
    server is very slow. Image retrieval takes too much time. Is there any solution
    or workaround to improve the performance.

    More information is required to help you.
    What is the time for retrieval? What is the time for the entire page load?
    What database are you using?
    How many Nodes are in the repository?
    What do the Node types (a.k.a. Object Classes) look like? How many
    properties per Node?
    If using Oracle or MSSQL, did you run statistics.sql?
    (http://google.bea.com/search?restrict=wlp81&ie=&q=statistics.sql&site=bea&output=xml_no_dtd&client=bea&access=p&lr=&btnG.y=0&btnG.x=0&ip=216.148.48.12&proxystylesheet=http%3A%2F%2Fdev2dev.bea.com%2Fimages%2Fdev2dev.xsl&oe=&filter=p)
    Have you adjusted or disabled the content caches?
    Greg
    Koshy Varghese wrote:
    The performance of content retrieval from content repository on Weblogic8.1 portal
    server is very slow. Image retrieval takes too much time. Is there any solution
    or workaround to improve the performance.

Maybe you are looking for

  • Cannot reduce file size with PDF X

    Hi, have created a 1 page document in pages that has some hi-res digital SLR shots, so 5pics has pushed file size to 21mb. I cannot email this around, so went help hunting and determined that pdfx was the answer to my dreams. It all works in principl

  • Report output in text format

    Using Report Builder 9.02. My customer wants to have the report output to be generated to a file (preferably text vs. RTF). Then they want to be able to open the output file in MS Word and be able to cut and paste selected pages of the report to anot

  • Downloading photos on phone with to pc.

    I have some photos taken a while on my old N70 that I want to put on my pc. Pc suite wont let me! It dosen't find them on my phone? I obviously downloaded them before on to my old pc but that is now dead. Can I still pull them off the phone onto my n

  • Different CFCHART output in CF7 and CF9

    Hi, I'm testing CF9 (at the moment I'm on CF7) and I notice that the output of charts with multiple chartseries  in CF9 is wrong. The chart is displayed multiple times. See my code: <cfquery name="select_kp" > select  id,code, name from cdb_request_s

  • Focus for the JSlider

    Hi there! I'm making a GUI with many buttons, sliders, chekcboxes and so on. The problem is that I don't want any "focus border" to be painted on the item that currently has the focus. For JButtons I use the method setFocusPainted(false) which works