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

Similar Messages

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

  • Timeout when retrieving document from Content Server

    Dear experts,
    after the migration of an R/3 Enterprise system with a file-based Content Server (CS without database) we experience significant delays when a document shall be retrieved from the Content Server and displayed.
    The repository, from which documents are retrieved, has the following properties:
    Document Area = ArchiveLink
    Storage Type = HTTP content server
    Obviously the delay is caused by time-outs when R/3 tries to access the content sever.
    The RFC trace recorded during the document retrieval contains the following entries:
    Trace file opened at 20100825 104048 CEST SAP-REL 640,0,304 RFC-VER 3
    Trace file opened at 20100825 104115 CEST SAP-REL 640,0,304 RFC-VER 3
    End of trace *****
    ======> CPIC-CALL: 'ThSAPCMRCV' : cmRc=20 thRc=456
    Timeout beim Verbindungsaufbau (Partner vorhanden ?)
    ABAP Programm: SAPLSCMS_CLTFC (Transaction: )
    Called function module: RFC_PING
    User: TSI0403 (Client: 007)
    Destination: SAPCMS (handle: 4, , {4C74C1A6-BD3B-3B59-E100-00001A5F0A18})
    SERVER> RFC Server Session (handle: 1, 41571399, {4C74D031-BD2C-3B58-E100-00001A5F0A18})
    SERVER> Caller host: cimpd38_MPD_38
    SERVER> Caller transaction code: MIR4 (Caller Program: CL_GOS_TOOLBOX_VIEW===========CP)
    SERVER> Called function module: GOS_EXECUTE_SERVICE
    Error RFCIO_ERROR_SYSERROR in abrfcpic.c : 3268
    CPIC-CALL: 'ThSAPCMRCV' : cmRc=20 thRc=456
    Timeout beim Verbindungsaufbau (Partner vorhanden ?)
    Error RFCIO_ERROR_MESSAGE in abrfcio.c : 1660
    ======> CPIC-CALL: 'ThSAPCMRCV' : cmRc=20 thRc=456
    Timeout beim Verbindungsaufbau (Partner vorhanden ?)
    ABAP Programm: SAPLSCMS_FE_RFC (Transaction: )
    Called function module: RFC_PING
    User: TSI0403 (Client: 007)
    Destination: SAPHTTP (handle: 6, , {4C74C1B4-BD3B-3B59-E100-00001A5F0A18})
    SERVER> RFC Server Session (handle: 1, 41571399, {4C74D031-BD2C-3B58-E100-00001A5F0A18})
    SERVER> Caller host: cimpd38_MPD_38
    SERVER> Caller transaction code: MIR4 (Caller Program: CL_GOS_TOOLBOX_VIEW===========CP)
    SERVER> Called function module: GOS_EXECUTE_SERVICE
    Error RFCIO_ERROR_SYSERROR in abrfcpic.c : 3268
    CPIC-CALL: 'ThSAPCMRCV' : cmRc=20 thRc=456
    Timeout beim Verbindungsaufbau (Partner vorhanden ?)
    Error RFCIO_ERROR_MESSAGE in abrfcio.c : 1660
    I wonder why R/3 first attempts to contact the Content Server via the SAPCMS RFC destination rather than using HTTP (SAPHTTP)? - The connection tests for both RFC connections are successful.
    Is there a way to instruct R/3 to go via the SAPHTTP RFC destination as the first choice and NOT via SAPCMS when documents shall be retrieved and displayed?
    Thank you,
    Rainer Walter
    Edited by: Rainer Walter on Sep 3, 2010 3:07 PM

    Hi Ravindra,
    thank you for looking into this problem. The Content Server is not based on SAP DB/MaxDB. The repositories are represented as plain directory structures in a file system.
    My issue is that R/3 is not using the SAPHTTP RFC connection as first choice although the repository is flagged as "HTTP Content Server" but uses another RFC destination instead. When this attempt is timed out, R/3 eventually picks the appropriate RFC destination. So it takes a considerable amount of time until a requested document is finally retrieved from the repository in the Content Server.
    I am confused because the system where I experience this behaviour has been built from a system copy of a production system, and the Content Server for this new system has been built from scratch. In the original production system, no timeout is found when users are retrieving documents, and obviously the original R/3 system is using SAPHTTP right away. The original production system and the new system built from a system copy are accessing different Content Servers.
    I am looking for a way to instruct the new R/3 system to immediately use the SAPHTTP connection when talking to the Content Server, and I would be grateful for a hint where I can configure this to get rid of these timeouts.
    Best regards,
    Rainer

  • Retrieving Entry Point =True,Roles programatically and retrieving their URL

    Hi Team,
    I want to retrieve the roles whose entry point is equal to true using WebDynpro, And display their names.
    When i am trying to display any role name it is displaying with underscores, like if it is content administration role it is displaying like content_admin_role.
    I want it to display it just similar name which will display in portal, like content administration how can i do this?
    And for each and every role i want to bring the role URL correspond to it.
    I tried this and reached upto some extent but not able to open the role perfectly.
    I used the below code for getting the names of the roles.
    Iterator rit = null;
         try
         IWDClientUser clientUser = WDClientUser.getCurrentUser();
         IUser user = clientUser.getSAPUser();
         rit = user.getRoles(true);
         IRoleFactory rfact = UMFactory.getRoleFactory();
         while (rit.hasNext()) {
         String roleName = (String) rit.next();
         IRole role = rfact.getRole(roleName);
         wdComponentAPI.getMessageManager().reportSuccess("Role names1..."+role.getDisplayName().toString());
         wdComponentAPI.getMessageManager().reportSuccess("Role names2..."+role.getUniqueName().toString());
         //wdComponentAPI.getMessageManager().reportSuccess("Role names3..."+rfact.getRolesOfUser(unique,true));
    Also suggest me to retrieve the URL's of respective roles, and it should navigate to that perticular role when i open that URL in browser.
    Thanks in advance.
    Bala

    Hi,
    First of all you want to distinguish the pcd roles from the LDAP roles. To do that you use a IRoleSearchFilter like this:
    IRoleSearchFilter searchFilter = null;
    try {
    searchFilter = roleFact.getRoleSearchFilter();
    searchFilter.setDisplayName("*", SearchAttribute.LIKE_OPERATOR, false);
    ISearchResult result = roleFact.searchRoles(searchFilter);
    if (result.getState() == ISearchResult.SEARCH_RESULT_OK) {
    while (result.hasNext()) {
    String RoleName = (String) result.next();
    IRole role = roleFact.getRole(RoleName);
    You also need to check if the role is assigned to the user, so get the user's roles and compare them to the ones you got from the search result.
    In order to get name correctly use:
    role.getDescription();
    To see if Entry Point = True you do something like this:
    IPcdContext targetobject =(IPcdContext) initialContext.lookup(role.getUniqueName());
    Object object = targetobject.getAttributes("").get("com.sap.portal.pcd.role.EntryPoint");
    if (object instanceof IPcdAttribute) {
    IPcdAttribute att = (IPcdAttribute) object;
    boolean b = att.getBoolean();
    To get the URL of the role you should use:
    string RoleUrl = "http://<server>:<port>/irj/portal?NavigationTarget=ROLES://" + role.getUniqueName().substring(4);
    Best regards,
    Avishai Zamir

  • 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

  • Cannot Retrieve referenced URL in wscript file from Local System Account, but not other accounts on the computer.

    Hello,
    I have a WScript File that includes an external resource (js file).
    It works on one computer and it does not work on another computer.
    If I run this file from a normal admin command prompt everything runs fine on both computers.
    If I run this file from the Local System account using PsExec it runs fine on one of the computers and throws an error "Cannot Retrieve referenced URL" on the other computer.
    The reason I want it to run from the Local System account is that it is executed from a Windows Service.
    Is there some setting or some way for the IE cache to get corrupt on the Local System account or something like that?

    JRV,
    You are by far the worst 'support' person I've ever seen. If you aren't going to be thoughtful in providing support, don't pretend. If you're going to pretend, leave your condescension on the shelf. You have provided no thoughtfulness whatsoever to his issue,
    and have in no way improved the discourse. You are arrogant and condescending without exhibiting any intelligence whatsoever. I'm impressed Matt kept calm through your demeaning, counterproductive diatribes.
    Matt,
    First I'd check UAC settings, because I believe that can change how elevation works substantially.
    Second, I would check the versions of wscript.exe on both machines, both in System32 and SysWow, and I'd check for updates bypassing WSUS to make sure there's not something silly going on there (totally a shot in the dark, catch-all theory).
    Have you made any headway in the last few weeks?
    -John
    This is not a support forum and it is not for assistance in fixing broken configurations.  It is a scripting forum. The OP proved that the issue is not the script but the environment it is running in.  You should not get mad just because you are
    not getting satisfaction.
    ¯\_(ツ)_/¯

  • How to retrieve the Conversation ID in ABAP

    Does anyone know how to retrieve a conversation ID in ABAP?
    You can retrieve the reference ID from SXMSPMAST but how do you retrieve the conversation ID?
    Table names? FM?
    ABAP not Java or UDF
    All suggestions welcome.
    Regards,
    Nay

    As I said in my question, I am not asking for how to retrieve the conversation ID in a UDF. Please read my question....
    I am asking, given a specific message ID, how can I retrieve the conversation id for that message ID on the ABAP stack - e.g. with a function module, what table names etc.
    thanks, Nay

  • Retrieve the default content access account for search through code

    Hi there,
           Does anyone have the code to retrieve the default content access account (crawl account) for the MOSS search? I tried looking into Microsoft.Sharepoint.Search.Adminstration.SearchService namespace. It has a "crawlaccount" property but not sure how to initialize it.
    Thanks,
    Kish

    try:
    using Microsoft.Office.Server.Search.Administration;  
    using Microsoft.SharePoint;  
       using (SPSite site = new SPSite("http://basesmcdev2/sites/tester1"))  
                    SearchContext context = SearchContext.GetContext(site);  
                    Content content = new Content(context);  
                    return content.DefaultGatheringAccount;  
    http://www.certdev.com

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

  • 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

  • I recently upgraded computer to windows 7.  When I open itunes I am able to see my music library, but unable to play.  Gives an error message of "Could not be found".  How do I retrieve my library contents?

    I recently upgraded computer to Windows 7.  When I open itunes I am able to see my music library, but unable to play.  Gives an error message of "Could not be found".  How do I retrieve my library contents?

    Hello ehoff5,
    I would be concerned too if I was not able to play my music in iTunes.  It sounds like the music files may be in a location that iTunes is not expecting.  I recommend reviewing the following articles to locate you music files on your computer:
    iTunes: Finding lost media and downloads
    http://support.apple.com/kb/ts1408
    Where are my iTunes files located?
    http://support.apple.com/kb/ht1391
    Thank you for using Apple Support Communities.
    Best,
    Sheila M.

  • URL Content Rule with SSL

    Hi
    I have two different ssl services on the same servers. One service is published with standard 443 port and 444 port.
    I would like to balance those services with two different contents. They should have the same VIP address and the standard ssl port (443 tcp). Then, the difference between both contents would be the url.
    content 1
    url "//myserver.com/APL1/*"
    vip address 192.168.1.1
    port 443
    add service service1_443
    add service service2_443
    content 2
    url "//myserver.com/APL2/*"
    vip address 192.168.1.1
    port 443
    add service service1_444
    add service service2_444
    I've tried it but it doesn't work.
    Have I done anything wrong?
    Regards

    the main purpose of SSL is security.
    So, what is security ?
    Securit means you don't want other person/devices to see the content of your traffic.
    If nobody can see the content, this includes the CSS.
    So, the CSS is unable to see the URL which is part of the content.
    Your solution can't work.
    Unless you install an ssl module with the key of the server so the module can decrypt the traffic.
    Regards,
    Gilles.

  • How do i retrieve the url for external window

    Hi forum
    I have created a new application in my existing proj. In the existing proj i have a button on click of which i need to call the view of the new application i hv used the following code, but i dnt know how to retrieve the url for this new application.
    IWDWindowInfo windowInfo =(IWDWindowInfo) wdComponentAPI.getComponentInfo().findInWindows("AgencyFee_ReportsPrinterFriendlyWindow");
         IWDWindow window = wdThis.wdGetAPI().getComponent().getWindowManager().createExternalWindow(url, window name, false);
    Thanks & Regards
    Jaspreet Kaur

    Hi,
    If you have an application associated this window you can create the URL as mentioned below
      WDDeployableObjectPart deployableObjectPart = wdComponentAPI.getDeployableObjectPart();
           try {
              WDURLGenerator.getApplicationURL(deployableObjectPart);
         } catch (WDURLException e) {
              // TODO Auto-generated catch block
              e.printStackTrace();
    OR      
         try {
              String url = WDURLGenerator.getApplicationURL("<deployableObjectName>", "<applicationPartName>");
         } catch (WDURLException e) {
              // TODO Auto-generated catch block
              e.printStackTrace();
         IWDWindow window = wdComponentAPI.getWindowManager().createNonModalExternalWindow(url , "title");
         window.show();
    Regards
    Ayyapparaj

  • Retrieve ICM url

    hi, is there a way to retrieve the url of an ICM cached object, if you 'lost it'.
    background. activex controls are blocked in IE these days preventing then to run without user 'click to activate and use this control'. that ruins most of the interaction you can get from controls specially if the page has to be reloaded as the control will then have to be reactivated each time.
    this is specific for the phtmlb:ganttChart rendering that this happens.
    however there might be an easy fix. during the rendering of the control it puts the svg graphic file in the ICM cache, then renders it on the current page like this :
    <embed src="/sap/bc/bsp/sap/sbspext_phtmlb/238084D3CD28DA4687A0FD58332F4374.svg" height="
          298
          px" width="
          657
          px" type="image/svg+xml" pluginspage="http://www.adobe.com/svg/viewer/install/"></embed>
    what i would do, would be to grab that svg file, put it into a js script and then embed that on my page instead. that would eliminate the click to active issue (known workaroudn that works on any type of active x control).
    so ... how do i get a hold of the url that is in the ICM cache. i can se its there with the monitor, is there any way to retireve it, something that binds it to my current IE session or something.
    anyone got any suggestions?

    recoded the phtmlb extension to fit my needs. no need to read out the ICM path anymore.
    there is another post showing how that was done.
    Message was edited by: Christian Hasselbalch

Maybe you are looking for

  • Tag name: "embed" not found.... ?

    Every time i insert a swf file into my html file with DwCS3 generate this code: <embed src="flash/topheader.swf" quality="high" pluginspage=" http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-sho

  • User profile corrupted can i recover thunderbird emails?

    My user profile of my computer has been corrupted. I have had to create a new username and am currently copying all my files from the c drive of my old user profile to my new user profile. When I open mozilla thunderbird, it doesn't recognize that I

  • Export parameter REALLY work in message mapping???????

    I wrote a java version transformation and it worked good with export parameter. However I can not work it out in graphical message mapping. I refered http://help.sap.com/saphelp_nwpi71/helpdata/en/43/c3e1fa6c31599ee10000000a1553f6/frameset.htm. In PI

  • Error in WorksSpace when retrieving schedule batchs

    All, Hope I can get some help. I scheduled a batch report in WorkSpace from an essbase source. As the batch was running the Essbase server got rebooted. As a result when I try to see the items in batch scheduler I get the error NESTED EXCEPTION ; JAV

  • Using 2 file systems to place archive logs

    We currently have LOG_ARCHIVE_DEST parameter set to place archive logs to /u10 file system. However it no longer has enough space and system admin added second dedicated file system /u11 to place archive logs. So we would like to start using both of