Calling CFM from Ajax Display

I am using a demonstration of a CF Organization Chart (downloaded from http://www.cfdan.com/index.cfm?tag=CFOrgChart).
There has been some customization (increasing the number of fields on the database from 2 to 7, for example) and overall, it works great.
I have built a ColdFusion front end that allows the user to view the chart, add, change and delete the various nodes.  Dan's example includes teh capability to perform the same functions from the org chart itself by clicking on two icons that appear on mouse over, and teh edit by double-clicking the node box.  Again it works.
Now the problem:
When I perform any of the add/change/delete functions from the org chart display screen, it doesn't jump to the CFM Form page for the data entry, but kind of incorporates it into the org chart.  See my screen shot for an example:
The stuff in the center (blue banners) should be a new page...

sockerdad wrote:
When I perform any of the add/change/delete functions from the org chart display screen, it doesn't jump to the CFM Form page for the data entry, but kind of incorporates it into the org chart.
The stuff in the center (blue banners) should be a new page...
That is the usual intention of using AJAX.  The purpose for the creation of the xmlHttpRequest() was to be able to make HTTP requests in JavaScript and handle it behind the scenes, so that the entire web pages does not need to be refreshed.
If you do NOT want this, then I would probably not bother with AJAX functionality.

Similar Messages

  • Calling CFM from CFC

    Greetings to all
    I not enough work with ColdFusion.
    My question: How I can receive function parametres in *.CFM file  from a *.CFC component?
    OR
    How I can calling functions in CFM from Flex Application?
    For example:
    In CFM:
    <cffunction>
    <cfreturn HelloVariable>
    </cffunction>
    How I can recieve HelloVariable in my Flex Application?
    Sorry for my English

    In your cfc, add a cfinclude to the cfm file and then you have access to the function.

  • Unable to call webmethod from Ajax Jquery

    i write one webmethod in application page(.aspx) and i am trying to call that method from  jQuery AJAX call but evry time page load method will call. insted of Webmethod. please help.
    CS page
    [System.Web.Services.
    [WebMethod]
    publicstaticvoidtemp()
    Js page
     $.ajax({
            type: "POST",
            url: 
    "../TPCIP.Web/WebPages/EmailSend.aspx/temp"
            data:'{"promo":"'+ pcode
    +'", "uid":'+ hid
    +'}',
            dataType:"json",
            contentType:"application/json; charset=utf-8",
    success:
    function(msg) {
                        alert(
    "Failed to send Email");
                        window.close();

    Hi,
    Per my understanding, you want to call the method through jQuery dynamically, but not just in the page loaded event.
    Here is a demo about how to call the page method when there is button clicking, you can take it for a try in your environment to see if this is what you want:
    In .aspx page:
    <%@ Assembly Name="$SharePoint.Project.AssemblyFullName$" %>
    <%@ Import Namespace="Microsoft.SharePoint.ApplicationPages" %>
    <%@ Register Tagprefix="SharePoint" Namespace="Microsoft.SharePoint.WebControls" Assembly="Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
    <%@ Register Tagprefix="Utilities" Namespace="Microsoft.SharePoint.Utilities" Assembly="Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
    <%@ Register Tagprefix="asp" Namespace="System.Web.UI" Assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" %>
    <%@ Import Namespace="Microsoft.SharePoint" %>
    <%@ Assembly Name="Microsoft.Web.CommandUI, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
    <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ApplicationPage1.aspx.cs" Inherits="PageMethodDemo1.Layouts.PageMethodDemo1.ApplicationPage1" DynamicMasterPageFile="~masterurl/default.master" %>
    <asp:Content ID="PageHead" ContentPlaceHolderID="PlaceHolderAdditionalPageHead" runat="server">
    </asp:Content>
    <asp:Content ID="Main" ContentPlaceHolderID="PlaceHolderMain" runat="server">
    <div>
    Your Name :
    <asp:TextBox ID="txtUserName" runat="server"></asp:TextBox>
    <input id="btnGetTime" type="button" value="Show Current Time"
    onclick = "ShowCurrentTime()" />
    </div>
    <script src="/_layouts/PageMethodDemo/jquery-1.10.2.min.js" type="text/javascript"></script>
    <script type = "text/javascript">
    function ShowCurrentTime() {
    $.ajax({
    type: "POST",
    url: "ApplicationPage1.aspx/GetCurrentTime",
    data: '{name: "' + $("#<%=txtUserName.ClientID%>")[0].value + '" }',
    contentType: "application/json; charset=utf-8",
    dataType: "json",
    success: OnSuccess,
    failure: function (response) {
    alert(response.d);
    function OnSuccess(response) {
    alert(response.d);
    </script>
    </asp:Content>
    <asp:Content ID="PageTitle" ContentPlaceHolderID="PlaceHolderPageTitle" runat="server">
    Application Page
    </asp:Content>
    <asp:Content ID="PageTitleInTitleArea" ContentPlaceHolderID="PlaceHolderPageTitleInTitleArea" runat="server" >
    My Application Page
    </asp:Content>
    In .aspx.cs file:
    using System;
    using Microsoft.SharePoint;
    using Microsoft.SharePoint.WebControls;
    namespace PageMethodDemo1.Layouts.PageMethodDemo1
    public partial class ApplicationPage1 : LayoutsPageBase
    protected void Page_Load(object sender, EventArgs e)
    [System.Web.Services.WebMethod]
    public static string GetCurrentTime(string name)
    return "Hello " + name + Environment.NewLine + "The Current Time is: "
    + DateTime.Now.ToString();
    The solution structure as below:
    How it works in the browser:
    Best regards
    Patrick Liang
    TechNet Community Support

  • I am facing issue in Receiving incoming calls, Name not getting displayed though the same has been saved in my phone book!! I have done sync from Windows contacts.. please help if some1 knows how to rectify the issue...

    I am facing issue in Receiving incoming calls, Name not getting displayed though the same has been saved in my phone book!! I have done sync from Windows contacts.. please help if some1 knows how to rectify the issue...

    Has your carrier been having issues with Call Display? Do the telephone numbers come up when people call, or does it just show 'Unknown Number' or 'Blocked' ?

  • When i rendering large table from Ajax using jquery that table not Displaying and not throwing any error also. why ? in IE 8,9,10

    Hi,
    when i rendering large HTML table from Ajax using jquery , table not displaying in browser why ? but visible in  chrome and mozilla.

    Hi,
    Post questions about html, css and scripting for website developers to the IE Web Development forum.
    http://social.msdn.microsoft.com/Forums/ie/en-US/home?forum=iewebdevelopment
    Include with your question a link to your website or a mashup that shows the issue.
    If you are using the file: protocol.... MSIE browsers have security restriction for running active content from the file system.
    Regards.
    Questions regarding Internet Explorer 8, 9 and 10 and Internet Explorer 11 for the IT Pro Audience. Topics covered are: Installation, Deployment, Configuration, Security, Group Policy, Management questions. If you are a consumer looking for answers or to
    raise a question, it's highly recommended you head on over to http://answers.microsoft.com/en-us
    Rob^_^

  • Secure AJAX calls made from a JSR 168 portlet

    I am investigating methods to secure AJAX calls made from a JSR 168 portlet to a servlet using the Direct Web Remoting framework (DWR) and Weblogic Portal. The portlet can have more than one instance and different entitlements depending on the desktop it is available from. The Portal has several desktops and does not require the user to authenticate for some of the desktops.
    So far the only method I have come up with is to pass a token from the portlet to the servlet which indicates the entitlements the user should have to access the documents from the portlet and check in the servlet if the User has the appropriate global roles to access the documents.

    no , that doesn't work, the token passed can be modified by a malicious user (unless the token is random or signed)
    You need to store the desktop(s) the user is on in probably the HttpSession and read that from the servlet and make the decisions accordingly.
    regards
    deepak

  • Calling report from form. Need PDF output

    I am calling a report from a form using RUN_PRODUCT. I need to display the form in PDF format. When the user clicks the button in the form to run the report, acrobat reader should open up and the report displayed there. Please help.
    Thanks

    Thanks for the response. The first part worked. I am able to get the output in PDF format. In the 2nd part where I want to open acrobat and display the output, I am having some trouble with the code. When I compile, it says
    win_api_environment.read_registry must be declared. Is there some package I need to attach?
    Also, in the After reports trigger, how do I pass vFile (I am assuming this is the PDF file name)?
    Thanks
    The first thing you'll want to do is pass parameters to the report IE DESTYPE, DESNAME and DESFORMAT where these could be FILE, 'c:\temp\report' and PDF.
    Then, you can try this piece of code I wrote (with some help from other people at Metalink and here) sometime back. Now, I call it from forms, but in your case, you'd have to run it in the after report trigger. Since with RUN_PRODUCT you don't know when the report is finished, if you did it from the form, it wouldn't work correctly.
    PROCEDURE OPEN_PDF(vFile IN VARCHAR2)
    IS
    vcServerApp varchar2(40);
    vcServerTag varchar2(600);
    vcCommand varchar2(2000);
    iArgPos pls_integer;
    dummy NUMBER;
    BEGIN
    -- 1 get the Server App for .PDF files
    vcServerApp := win_api_environment.read_registry('HKEY_LOCAL_MACHINE\SOFTWARE\CLASSES\.PDF','',true);
    -- 2 get the executable
    vcServerTag := 'HKEY_LOCAL_MACHINE\SOFTWARE\CLASSES\'||
    vcServerApp||'\SHELL\OPEN\COMMAND';
    vcCommand:= win_api_environment.read_registry(vcServerTag,'',true);
    -- 3 Sort out how to specify the Filename
    iArgPos:= instr(vcCommand,'%1');
    if iArgPos = 0 then --no substitution Var on the command line
    vcCommand := vcCommand||' '||vFile;
    else
    vcCommand := substr(vcCommand,1,(iArgPos-1))||
    vFile||substr(vcCommand,(iArgPos+2));
    end if;
    -- 4 Run using Winexec (or Host if preferred).
    win_api_shell.winexec(vcCommand);
    EXCEPTION
    when no_data_found then
    abortt('Acrobat Reader was not found! Please consult with your help desk to install it and try again.','N');
    END;
    Chad
    I am calling a report from a form using RUN_PRODUCT. I need to display the form in PDF format. When the user clicks the button in the form to run the report, acrobat reader should open up and the report displayed there. Please help.
    Thanks

  • Contact name not showing in call/sms log even when I call/sms from my address book.

    Two things have changed on my phone recently.
    1. I ran the latest update 4.3.2
    2. My phone was not showing all the contacts in my address book that is in my Mobile Me account. Mobile me had 166 contacts. The iPhone 4 had 136. I I unchecked the syncing of my contacts on my phone. This removed all the contacts from my phone. Then I check the syncing options again. All 166 appeared on the phone.
    I'm not sure which of the two caused the issue but now anytime someone who calls their name does not appear on the display or log, just their number. I can even call people from my address book and the display shows that I am calling them with their name and photo on display. However, in the call log the name does not show just their number.  This applies for text messages. I send a message directly from within the contact card in the address book and in my text log it shows only the number and not the name.
    I've turned the phone off and on a couple of times.
    I would appreciate any advice.
    Cheers

    Thanks iraghib,
    In the end I reset my phone to factory settings. I created a back up of my address book and ical. Reset the phone and did a sync again. This fixed it all. I didn't need to use the backups but is was nice to know they were there. I felt entering the various passwords for all my installed apps was a much better deal than adding the international area code to the 166 contacts I have in my address book.
    Good luck. And thanks for the post.

  • Call tcode from alv report and passing  group of values

    hi all .
    i want to call tcode from alv report and passing an internal table or group of values to a selection option of that t code ? how
    ex. passing group of GL to fbl3n and display the detials of all .
    thank you

    Dear,
    You have done a small mistake
    --> rspar_line-option = 'EQ'.
         rspar_line-HIGH = PDATE-HIGH.
    u r passing "high" value and in "option u r passing "EQ" so how it will work!!!
    So if u r passing only 1 date or more dates like 01.01.2010 , 15.02.2010 , 10.03.2010 then pass
    rspar_line-selname = 'SO_BUDAT'.
    rspar_line-kind = 'S'.
    rspar_line-sign = 'I'.
    rspar_line-option = 'EQ'.
    rspar_line-LOW = PDATE-HIGH.
    APPEND rspar_line TO rspar_tab.
    or if u r passing low & high date means in range like 01.01.2010 to 30.01.2010, then pass
    rspar_line-selname = 'SO_BUDAT'.
    rspar_line-kind = 'S'.
    rspar_line-sign = 'I'.
    rspar_line-option = 'BT''.
    rspar_line-LOW = PDATE-LOW.
    rspar_line-HIGH = PDATE-HIGH.
    APPEND rspar_line TO rspar_tab.
    try above code , hope it helps...
    i think u cannot use "call transaction using bdcdata" in ur case bcoz as u said in ur 1st post u want to display the details of all but still if u want to use then u should pass all parameters in  loop.
    PROGRAM
    DYNPRO
    DYNBEGIN
    FNAM
    FVAL
    ex:-
    LOOP AT GT_TEMP INTO GS_TEMP.
    CLEAR bdcdata_wa.
    bdcdata_PROGRAM = 'SAPXXXX'.
    bdcdata_DYNPRO = '1000'.
    bdcdata_DYNBEGIN = 'X'.
    bdcdata_wa-fnam = '''.
    bdcdata_wa-fval = ''.
    APPEND bdcdata_wa TO bdcdata_tab.
    CLEAR bdcdata_wa.
    bdcdata_PROGRAM = ''.
    bdcdata_DYNPRO = ''.
    bdcdata_DYNBEGIN = ''.
    bdcdata_wa-fnam = 'SD_SAKNR'.
    bdcdata_wa-fval = GS_TEMP-GLACCOUNT.
    APPEND bdcdata_wa TO bdcdata_tab.
    CLEAR bdcdata_wa.
    bdcdata_PROGRAM = ''.
    bdcdata_DYNPRO = ''.
    bdcdata_DYNBEGIN = ''.
    bdcdata_wa-fnam = 'BDC_OKCODE'.
    bdcdata_wa-fval = 'XXX'.
    APPEND bdcdata_wa TO bdcdata_tab.
    ENDLOOP.
    try above code if u r using call transaction...
    Edited by: mihir6666 on Jul 9, 2011 3:10 PM
    Edited by: mihir6666 on Jul 9, 2011 3:11 PM
    Edited by: mihir6666 on Jul 9, 2011 3:13 PM

  • Calling Report from Menu (Oracle Forms 10g)

    We have the applications in Forms6i & Reports 6i (Client Server) and migrating to Forms 10g and Reports 10g. We have the menu, from that menu we are calling all the forms and Reports. For especially Reports earlier we user RUN_PRODUCT but now 10g it is not working. How can call the report using RUN_REPORT_OBJECT
    Important things we have some dynamic parameters (input) to the each report. That means when i called the report from the menu i need to get first parameter form to take the parameters and then can be run the report.

    Here is the code to call report from menu in 10g
    DECLARE
    pl_id ParamList;
    repid REPORT_OBJECT;
    v_rep varchar2(100);
    v_server VARCHAR2(100);
    rep_status varchar2(100);
    v_host VARCHAR2(100);
    BEGIN
         select rep_server into v_server from reports_data;
         select machine into v_host from reports_data;
    pl_id := Get_Parameter_List('tmpdata');
         IF NOT Id_Null(pl_id) THEN
         Destroy_Parameter_List( pl_id );
         END IF;
         pl_id := Create_Parameter_List('tmpdata');           
    Add_Parameter(pl_id,'P_C_CODE',TEXT_PARAMETER,:GLOBAL.COMPANY);
    Add_Parameter(pl_id,'P_B_CODE',TEXT_PARAMETER,:GLOBAL.BRANCH);
         repid := find_report_object('REPORTOBJ');
         SET_REPORT_OBJECT_PROPERTY(repid,REPORT_FILENAME,getpath||'E_VOUCHER_ENTRY.RDF');
              SET_REPORT_OBJECT_PROPERTY(repid,REPORT_COMM_MODE,SYNCHRONOUS);
              SET_REPORT_OBJECT_PROPERTY(repid,REPORT_DESFORMAT,'htmlcss');
              SET_REPORT_OBJECT_PROPERTY(repid,REPORT_SERVER,v_server);
              v_rep := RUN_REPORT_OBJECT(repid, pl_id);
              rep_status := REPORT_OBJECT_STATUS(v_rep);
              WHILE rep_status in ('RUNNING','OPENING_REPORT','ENQUEUED')
                   LOOP
                        rep_status := report_object_status(v_rep);
                             message('Running');
                   END LOOP;
              IF rep_status = 'FINISHED' or rep_status is NULL THEN
                   --Display report in the browser
                   WEB.SHOW_DOCUMENT('http://'||v_host||'/reports/rwservlet/getjobid'||substr(v_rep,instr(v_rep,'_',-1)+1)||'?'||'server='||v_server,'_blank');
              ELSE
                   null;
         END IF;
    END;

  • Want to call transactions from ALV list output

    Hi Guru's,
    I have a report which displays Open PR's, open PO's n their details with respect to material. wat i want to do is call transactions from this out put i.e i want a interactive output. if i click on particular PR i want the system to call that PR screen. how can i do this?? Plz help.

    REFER THIS
    EXPORTING
      I_INTERFACE_CHECK              = ' '
      I_BYPASSING_BUFFER             =
      I_BUFFER_ACTIVE                = ' '
      I_CALLBACK_PROGRAM             = ' '
      I_CALLBACK_PF_STATUS_SET       = ' '
      I_CALLBACK_USER_COMMAND        = 'USER_COMMAND '
      I_STRUCTURE_NAME               =
      IS_LAYOUT                      =
      IT_FIELDCAT                    =
      IT_EXCLUDING                   =
      IT_SPECIAL_GROUPS              =
      IT_SORT                        =
      IT_FILTER                      =
      IS_SEL_HIDE                    =
      I_DEFAULT                      = 'X'
      I_SAVE                         = ' '
      IS_VARIANT                     =
      IT_EVENTS                      =
      IT_EVENT_EXIT                  =
      IS_PRINT                       =
      IS_REPREP_ID                   =
      I_SCREEN_START_COLUMN          = 0
      I_SCREEN_START_LINE            = 0
      I_SCREEN_END_COLUMN            = 0
      I_SCREEN_END_LINE              = 0
      IR_SALV_LIST_ADAPTER           =
      IT_EXCEPT_QINFO                =
      I_SUPPRESS_EMPTY_DATA          = ABAP_FALSE
    IMPORTING
      E_EXIT_CAUSED_BY_CALLER        =
      ES_EXIT_CAUSED_BY_USER         =
    EXCEPTIONS
      PROGRAM_ERROR                  = 1
      OTHERS                         = 2
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
      TABLES
        T_OUTTAB                       =
    IF SY-SUBRC <> 0.
    ENDIF.
    AND THEN
                     rs_lineinfo type slis_lineinfo.
    FORM user_command5 USING r_ucomm LIKE sy-ucomm
                      rs_selfield TYPE slis_selfield.
    data : lv_date type char4.
    CLEAR : LV_DATE .
    CASE r_ucomm.
    WHEN '&IC1'.
          IF rs_selfield-fieldname = 'BELNR'.
        read table it_e into wa_e index rs_selfield-tabindex.
        if sy-subrc = 0.
        lv_date = wa_e-budat(4).
        endif.
        SET PARAMETER ID 'BLN' FIELD rs_selfield-value.
        SET PARAMETER ID 'BUK' FIELD s_bukrs-low.
        SET PARAMETER ID 'GJR' FIELD lv_date.
        call TRANsaction 'FB03' AND SKIP FIRST SCREEN.
        endif.
        ENDCASE.
    ENDFORM. "user_comm

  • How do I remove my caller id from my samsung convoy phone so that the person I call does not see my name?

    How do I remove my caller id from my samsung convoy phone so that the person I call does not see my name?

    MojaveMoon's solution will work if there is only one person you want to block your ID from; if you want to block your caller ID from everyone, you can go to your account online, go to Change Features, and scroll down till you see Caller ID block.  Instructions say that once this is activated, you can dial *82 before any # you WANT to display your number to, but all others will be blocked.
    If you are on a Family share plan, the account owner needs to log in and choose your line to activate this feature.

  • How do I retrieve call history from my iPhone 4S? It only seems to log for about a month and I need an earlier date?

    How do I retrieve call history from my iPhone 4S? It only seems to log for about a month and I need an earlier date?

    If you have backup of your files, you can get your call history back as long as you sync iPhone with iTunes frequently.
    OK, the first thing you are required to do is close the function of "prevent iPhone from syncing automatically." in iTunes, avoiding to sync iPhone again.
    Now, connect your iPhone to pc and open iTunes.
    iTunes> preferences> devices
    All the backup data in iTunes will be displayed.
    Then,click the File menu and select Devices > Restore from Back up
    your iPhone will restart and you can find them back.
    This method only can find back the latest history, to get back the old, you should turn to a third party program for help.

  • URGENT: Report parameter form set to yes in calling report from menu

    I have write this code for calling report from menu module. But where i put the code
    PARAMFORM='YES' to display the report parameter form in order to enter the parameter by user.
    DECLARE
    pl_id ParamList;
    repid REPORT_OBJECT;
    v_rep varchar2(100);
    v_server VARCHAR2(100);
    rep_status varchar2(100);
    v_host VARCHAR2(100);
    BEGIN
         select rep_server into v_server from reports_data;
         select machine into v_host from reports_data;
         pl_id := Get_Parameter_List('tmpdata');
         IF NOT Id_Null(pl_id) THEN
         Destroy_Parameter_List( pl_id );
         END IF;
         pl_id := Create_Parameter_List('tmpdata');           
    Add_Parameter(pl_id,'P_C_NAME',TEXT_PARAMETER,:GLOBAL.COMPANY);
    Add_Parameter(pl_id,'P_B_NAME',TEXT_PARAMETER,:GLOBAL.BRANCH);
    Add_Parameter(pl_id,'P_user',TEXT_PARAMETER,:GLOBAL.user);
         repid := find_report_object('REPORTOBJ');
         SET_REPORT_OBJECT_PROPERTY(repid,REPORT_FILENAME,getpath||'E_open_balance.RDF');
              SET_REPORT_OBJECT_PROPERTY(repid,REPORT_COMM_MODE,SYNCHRONOUS);
              SET_REPORT_OBJECT_PROPERTY(repid,REPORT_DESFORMAT,'htmlcss');
              SET_REPORT_OBJECT_PROPERTY(repid,REPORT_SERVER,v_server);
              v_rep := RUN_REPORT_OBJECT(repid, pl_id);
              rep_status := REPORT_OBJECT_STATUS(v_rep);
              WHILE rep_status in ('RUNNING','OPENING_REPORT','ENQUEUED')
                   LOOP
                        rep_status := report_object_status(v_rep);
                             message('Running');
                   END LOOP;
              IF rep_status = 'FINISHED' or rep_status is NULL THEN
              WEB.SHOW_DOCUMENT('http://'||v_host||'/reports/rwservlet/getjobid'||substr(v_rep,instr(v_rep,'_',-1)+1)||'?'||'server='||v_server,'_blank');
              ELSE
                   null;
         END IF;
    END;

    Jeneesh,
    SET_REPORT_OBJECT_PROPERTY(report_id,REPORT_OTHER,
    'paramform=YES
    what about this variable ?
    P_VAR1 = ........');

  • How to call url from abap in background

    Hi,
    I could open url but it opens browser window
    i saw several threads on how to cal url in background but no good answer
    kindly help
    thanks
    B

    Hi,
    Try the following (primitive) example, it calls an url and display the result on screen.
    Hope this will help you.
    <pre>
    REPORT  test.
          CLASS lcx_http_client DEFINITION
          Minimal Error Handling
    CLASS lcx_http_client DEFINITION INHERITING FROM cx_static_check.
      PUBLIC SECTION.
        INTERFACES:
          if_t100_message.
        DATA:
           mv_method TYPE string,                               "#EC NEEDED
           mv_subrc  TYPE i.                                    "#EC NEEDED
        METHODS:
          constructor
            IMPORTING iv_method TYPE string  OPTIONAL
                      iv_subrc  TYPE i       OPTIONAL
                      iv_msgid  TYPE symsgid DEFAULT '00'
                      iv_msgno  TYPE i       DEFAULT 162.
    ENDCLASS.                    "lcx_http_client DEFINITION
          CLASS lcx_http_client IMPLEMENTATION
    CLASS lcx_http_client IMPLEMENTATION.
      METHOD constructor.
        super->constructor( ).
        mv_method = iv_method.
        mv_subrc  = iv_subrc.
        if_t100_message~t100key-msgid = iv_msgid.
        if_t100_message~t100key-msgno = iv_msgno.
        if_t100_message~t100key-attr1 = 'MV_METHOD'.
        if_t100_message~t100key-attr2 = 'MV_SUBRC'.
      ENDMETHOD.                    "constructor
    ENDCLASS.                    "lcx_http_client IMPLEMENTATION
          CLASS lcl_http_client DEFINITION
          Facade for if_http_client
    CLASS lcl_http_client DEFINITION.
      PUBLIC SECTION.
        CLASS-METHODS:
          get_http_client_by_url
            IMPORTING iv_url           TYPE string
                      iv_proxy_host    TYPE string OPTIONAL
                      iv_proxy_service TYPE string OPTIONAL
                      PREFERRED PARAMETER iv_url
            RETURNING value(ro_http_client) TYPE REF TO lcl_http_client
            RAISING lcx_http_client.
        DATA:
          mr_http_client TYPE REF TO if_http_client.
        METHODS:
          send
            RAISING lcx_http_client,
          receive
            RAISING lcx_http_client,
          close
            RAISING lcx_http_client,
          get_response_header_fields
            RETURNING value(rt_fields) TYPE tihttpnvp,
          get_response_cdata
            RETURNING value(rv_data) TYPE string.
    ENDCLASS.                    "lcl_http_client DEFINITION
          CLASS lcl_http_client IMPLEMENTATION
    CLASS lcl_http_client IMPLEMENTATION.
      METHOD get_http_client_by_url.
        DATA: lv_subrc TYPE sysubrc.
        CREATE OBJECT ro_http_client.
        cl_http_client=>create_by_url( EXPORTING url                 = iv_url
                                                 proxy_host          = iv_proxy_host
                                                 proxy_service       = iv_proxy_service
                                       IMPORTING client              = ro_http_client->mr_http_client
                                       EXCEPTIONS argument_not_found = 1
                                                  plugin_not_active  = 2
                                                  internal_error     = 3
                                                  OTHERS             = 999 ).
        CHECK sy-subrc <> 0.
        lv_subrc = sy-subrc.
        RAISE EXCEPTION TYPE lcx_http_client EXPORTING iv_method = 'GET_HTTP_CLIENT_BY_URL' iv_subrc = lv_subrc.
      ENDMETHOD.                    "get_http_client_by_url
      METHOD send.
        DATA: lv_subrc TYPE sysubrc.
        mr_http_client->send( EXCEPTIONS http_communication_failure = 5
                                         http_invalid_state         = 6
                                         http_processing_failed     = 7
                                         http_invalid_timeout       = 8
                                         OTHERS                     = 999 ).
        CHECK sy-subrc <> 0.
        lv_subrc = sy-subrc.
        RAISE EXCEPTION TYPE lcx_http_client EXPORTING iv_method = 'SEND' iv_subrc = lv_subrc.
      ENDMETHOD.                    "send
      METHOD close.
        DATA: lv_subrc TYPE sysubrc.
        CALL METHOD mr_http_client->close
          EXCEPTIONS
            http_invalid_state = 10
            OTHERS             = 999.
        CHECK sy-subrc <> 0.
        lv_subrc = sy-subrc.
        RAISE EXCEPTION TYPE lcx_http_client EXPORTING iv_method = 'CLOSE' iv_subrc = lv_subrc.
      ENDMETHOD.                    "close
      METHOD receive.
        DATA: lv_subrc TYPE sysubrc.
        mr_http_client->receive( EXCEPTIONS http_communication_failure = 9
                                            http_invalid_state         = 10
                                            http_processing_failed     = 11
                                            OTHERS                     = 999 ).
        CHECK sy-subrc <> 0.
        lv_subrc = sy-subrc.
        RAISE EXCEPTION TYPE lcx_http_client EXPORTING iv_method = 'RECEIVE' iv_subrc = lv_subrc.
      ENDMETHOD.                    "receive
      METHOD get_response_header_fields.
        mr_http_client->response->get_header_fields( CHANGING fields = rt_fields ).
      ENDMETHOD.                    "get_response_header_fields
      METHOD get_response_cdata.
        rv_data = mr_http_client->response->get_cdata( ).
      ENDMETHOD.                    "get_response_cdata
    ENDCLASS.                    "lcl_http_client IMPLEMENTATION
    PARAMETERS: p_url   TYPE string DEFAULT 'http://www.google.com' LOWER CASE,
                p_phost TYPE string DEFAULT 'your_proxy_here'       LOWER CASE,
                p_pserv TYPE string DEFAULT '8080'                  LOWER CASE.
    *===================================================================================
    START-OF-SELECTION.
      TRY .
          DATA: gt_data          TYPE string_table,
                gv_data          TYPE string,
                gr_http_client   TYPE REF TO lcl_http_client,
                go_cx            TYPE REF TO lcx_http_client.
          "Initialize the http client
          gr_http_client =
            lcl_http_client=>get_http_client_by_url( iv_url           = p_url
                                                     iv_proxy_host    = p_phost
                                                     iv_proxy_service = p_pserv ).
          "Call the specified URL and retrieve data from the response
          gr_http_client->send( ).
          gr_http_client->receive( ).
          gv_data = gr_http_client->get_response_cdata( ).
          "Its over....
          gr_http_client->close( ).
          "Display result
          REPLACE ALL OCCURRENCES OF cl_abap_char_utilities=>cr_lf IN gv_data WITH cl_abap_char_utilities=>newline.
          SPLIT gv_data AT cl_abap_char_utilities=>newline INTO TABLE gt_data.
          LOOP AT gt_data INTO gv_data.
            WRITE: / gv_data.
          ENDLOOP.
        CATCH lcx_http_client INTO go_cx.
          MESSAGE go_cx TYPE 'S' DISPLAY LIKE 'E'.
      ENDTRY.
    </pre>

Maybe you are looking for

  • Query reg adding custom tags in SOAP Header - AXIS Receiver Adapter

    Hi All, I need to send custom tags as mentioned below to my traget webservice application. I think I can do this with Receiver AXIS adapter but not sure how it can be done. Can any of you suggest?                                               <WSCont

  • Connecting ethernet cable to macbook

    having wifi issues with MBA and wondering if internet can be acquired someway through a cable connection?

  • Can you buy a new battery for iphone4?

    Hello, I am having trouble with my battery on my iphone4. i have had it now for 2 and a bit years but the battery is no good, i hardly use it during the day as i am working bur it does not hold battery power. Can i replace the battery or do i need to

  • Question about gradient mesh tool

    Hello, I am using the gradient tool for the first time and when I touch on an object to lay a gradient, the mesh seems to choose a set of anchor points to anchor to.  If I want to anchor the gradient mesh to different points, how do I change them?

  • 56HM195 - "Auto Aspect Ratio" feature

    I've just picked up a used Toshiba 56HM195. It has a "Auto Aspect Ratio" feature (page 74 of the owner's manual), which when enabled should display windowboxed (black bars on all four sides) 4:3 images in "TheaterWide 2" display mode, which zooms in