How to access HttpServletRequest from Web Dynpro

How could I get HttpServletRequest from Web Dynpro. I used the following code
IWDRequest req = WDProtocolAdapter.getProtocolAdapter().getRequestObject();
HttpServletRequest hreq = (HttpServletRequest) reg;
but it's throwing ClassCastException.
Is there any other way?
Thank you

I am building an application based on IPC API. I need to pass HttpSession as a parameter to initialize some IPC objects. Mainly trying to create IPCClient object.

Similar Messages

  • How to call jsp from web dynpro app.

    Hi Frndz,
    How can I call a JSP from my web dynpro(and here i don't want to redirect to JSP ),I want to call a JSP which can show a message window as alert on top  of WDP view.
    Here am using CE 7.2 SP1, and my requirement is to call the model(back end) for every minute interval and need to give alert that how many new records r added.With WDP java i haven't find any option to give alert r notifications about new records added, so am thinking to call JSP where I will pass the parameter which can show a alert r notification(like FACEBOOK n outlook notifications).
    Please share any ideas ti achieve this,
    Thanks in advance.

    If your application should open in a new url, then you can use link to url action to open jsp.
    You can also use EPCF navigation api to call any pcd page as well external links
    Since your passing parameters, you build url in both the cases.

  • Access files from Web Dynpro component

    I need to access files from a Web Dynpro component but I couldn't find any information. Has anyone done this?
    My questions are:
    1. Can I pack these files into the WD component so they can be deploy together?
    2. And what API should I use to access these files?

    You can follow the Creating the JCO connections in the Content Administrator section in the following [link|].
    For the RFC_ERROR_COMMUNICATION error, you can check if the system sapmsR3D is defined in your
    SAP Logon pad or in the hosts file under Drivers -> etc folder.

  • From my iPad I can print wirelessly in my office, but how do I print remotely via the web through my HP ePrint printer.  It is set up with an email address but i don't know how to access it from my iPad.

    I can print wirelessly in my office from my iPad, but how do I print remotely via the web to my HP ePrint printer.  The printer is set up with an email access address but I don't know how to access it from my iPad.

    Read through this for some information on how to do this: ces-ipad-iphone.html

  • Regarding how to pass the data from web dynpro to workflow

    hi gurus,
    how to pass the data from web dynpro to workflow.

    Check this [thread|SAP_WAPI_START_WORKFLOW;

  • How to pass the data from web dynpro to workflow.

    hi gurus,
    how to pass the data from web dynpro to workflow.

    you can use function module
    data   ls_input_container  TYPE swr_cont.
    data   lt_input_container  TYPE TABLE OF  swr_cont.
          task            = ptask
          return_code     = lv_return_code
          new_status      = lv_new_status
          input_container = pinput_container
          message_lines   = lt_message_lines
          message_struct  = lt_message_struct.
    where you pass the data in imnternal table "pinput_container" as
      ls_input_container-element = 'KUNNR'.
      ls_input_container-value = ls_skna1-kunnr ."wd_this->lv_kunnr.
      APPEND ls_input_container TO lt_input_container .
      ls_input_container-element = 'CLUSER'.
      ls_input_container-value = lv_cluser.
      APPEND ls_input_container TO lt_input_container .
      ls_input_container-element = 'BUKRS'.
      ls_input_container-value = lv_bukrs. " youe value as per requirement.
      APPEND ls_input_container TO lt_input_container .
      ls_input_container-element = 'VKORG'.
      ls_input_container-value = ls_sknvv-vkorg. " youe value as per requirement
      APPEND ls_input_container TO lt_input_container .
      ls_input_container-element = 'VTWEG'.
      ls_input_container-value = ls_sknvv-vtweg. "youe value as per requirement.
      APPEND ls_input_container TO lt_input_container .
      ls_input_container-element = 'SPART'.
      ls_input_container-value = ls_sknvv-spart. "youe value as per requirement.
      APPEND ls_input_container TO lt_input_container .
    *Also Forgot to mention where ptask is your workflow ID *
    Edited by: Arvind Patel on May 14, 2010 7:38 AM

  • How to get the Response Code when a URL is launched from Web Dynpro

    Hello Experts,
    I have a Web Dynpro Application in which in one of its views i have an IFrame UI element in which i will show a resource stored somewhere ..
    But before showing it i want to check if the resource actually exists. For this i have to check the HTTP Response code from Web Dynpro Application without setting it in the Iframe..
    I am using the following code to get the Response Code:
    URL url = new URL("Some Url");
    HttpURLConnection connection = (HttpURLConnection) url.openConnection();
    wdComponentAPI.getMessageManager().reportSuccess("Response code ="+connection.getResponseCode());
    }catch(Exception e){
    Now the Problem is whatever response Code occurs 403 (for No Proper Authorization), 404 (for Resource not found) etc..
    i always get Response Code=  500 (which is for Internal Server Error) shown in the messgae i have printed.
    Please let me know the correct way of getting the Response Code from Web Dynpro.
    Also my resource is lying on a SAP Portal 6.4
    Best Regards
    Edited by: Sundeep Sethi on Feb 18, 2008 9:07 AM
    Edited by: Sundeep Sethi on Feb 18, 2008 10:23 AM

      Check this code from /thread/5242768 [original link is broken] if it works.
    URL myurl = new URL("");
    URLConnection connection = myurl.openConnection();
    if(connection instanceof HttpURLConnection) {
    HttpURLConnection httpConnection = (HttpURLConnection) connection;
    System.out.println("Response = "+httpConnection.getResponseCode());
    catch(Exception e) {
    // print exception
    Harini S

  • How to open print dialog from web dynpro abap application

    Hi experts,
            I have a web dynpro application with several views and onone of the view there is a button that should open print dialog with printers list and all other options (standard print dialog we see in windows). I did reserach on SDN and came to now that this is a limitation of web dynpro abap. I did find some code also but unfortunately our current version of ABAP(7.0) do not support the code I found. I am not able to find any proper solution for this. Could someone please let me know how I can open a print dialog by clicking on a button in web dynpro abap? Any sample code or any information would be greatky appreciated.

    Hi Mithun,
    Have you check this?
    and also go through..
    How to print in a web dynpro application
    Print button

  • CE 7.1 - How to call CAF services from Web Dynpro

    whats the suggested way to call caf services from web dynpro?
    Of course I can use the Web Service model. But can I call caf directly?
    I read something about caf web dynpro model, but I cannot find it in nwds 7.1. On some older tutorial it was in context menu of caf project, but it seems to be removed.
    best regards

    Hi ,
    The standard way is to use the web service model.
    You have to expose the the services as web service and then you can use the wsdl url in the Adaptive web service model option.
    The above option will be available when you click the Model in the webdynpro application and the click create new model.
    Hope it helps you.
    Srinivasan Subbiah

  • Web Service access from WEB Dynpro

    I have requirement to pass the values from web dynpro to .NET cross application can any body guide me?

    Check for the methods like setuser and set password for your webservice
    Request_<webservicename> request=new Request_<webservicename>();
         catch (Exception e) {
    Hope this helps,

  • Connecting to SAP from Web Dynpro

    I am new to web dynpro, but have downloaded the java sneak preview edition and worked through it a bit. I understand that we have to use JCo to connect to SAP from Java Web dynpro, . Is it true?
    What about web dynpro for ABAP? Can we use normal select statements to connect to SAP? How is it exactly done in that case?
    Thanks in advance

    hi pg
    Just go thru this example which describes how to connect to SAP from web dynpro application. on accessing abap functions in web dynpro - 4.htm

  • Calling adobe form from Web Dynpro ABAP

    Hi Friends,
                        This is the following error, which i got when i tested my application. Calling adobe form from Web Dynpro ABAP.
      WebDynpro Exception: ADS: Request start time: Tue Nov 16 14:00:22 YEKT
                        Can some one tell me how to solve this....

    Please refer to this same link in forum
    WebDynpro Exception: ADS: Request start time, start Interactive Form
    WebDynpro Exception: ADS: Request start time

  • CAF DB Update for CAF Entity Service from Web Dynpro

    Hi all,
    I have created an entity service in CAF called “Contacts’ which contains the following attributes.
    Another entity service called "Person" is created. This contains the following attributes.
    contactsRef. (Cardinality -> 0..n , Relational Type -> Composition)
    That means Contacts entity service is used within Person entity service. Now it is working fine within CAF service browser. Now the Web Dynpro DC of CAF application is used within another custom Web Dynpro DC project. I want to store data from Web Dynpro.
    Within the context of component controller of  Web Dynpro the structure is like
         |_ personId
         |_ personName
         |_ personAddr
         |_ contactsRef       
                    |_ phoneNo (Under contactsRef)
                    |_ cellNo (Under contactsRef)
                    |_ emailID (Under contactsRef)
    So I have written the following code within web dynpro custom method.
    APerson person = PersonServiceProxy.create();
    java.util.List ls = new ArrayList();
    for(int i=0; i<4;i++)
    AContacts contact = ContactsServiceProxy.create();
    contact.setEmailID("[email protected]");
    person.setPersonAddr("ABC, KOL");
    After saving the data from Web Dynpro I am trying to test it from CAF service browser. But I am getting only the parent row. I mean only the value of personId, personName and personAddr fields which I have stored from Web Dynpro. But no value is coming within the table for Contacts entity service for composition relation.
    Could anybody help me how can I solve my problem?
    Thanks & Regards
    Message was edited by:
            Chandan Jash

    Hi Chandan,
    Can you do person.getRelatedModelObjects() and get the contact object, to check whether it is null, also check in the CAF DB whether the data you entered is present.
      I am not sure the code is actually adding the contact model object to person.
    Go thru this SDN Blog on usage of the CMI API's, there is a link for CMI documentation in it which might help you get the right code for adding the contact object.
    award points if  info is helpful

  • Trigger File Generation to a Server from Web Dynpro Application

    Hi Everybody! Hope you had a good new years eve
    Is it possible to generate a File on a Server outgoing from Web Dynpro?
    I tried to use GUI_DOWNLOAD. But as I couldn't use the GUI_DOWNLOAD from the Web Dynpro, I wrote a Report "ZCMI_EXPORT_FILE" that generates a Text-File. When I start the Report by myself, the file gets generated. All fine.
    To be able to generate the File from Web Dynpro, I created a Batch Input Function Module, that I call in the Web Dynpro. The File is not created and it does not show any errors.
    Do you have any idea how i can get this working? I'd also be happy with a different approach.
    Best Regards and Thanks,
    REPORT that is called with Batch Input from Web Dynpro:
    call function 'ZFM_GENERATE_EXPORT'
        it_detail_record     = lt_records
        is_export            = gs_export
        ev_string            = gs_export-document
        et_dataset           = data_tab
        parameter_is_initial = 1
        others               = 2.
    if sy-subrc <> 0.
    concatenate '\\SERVER\EXPORT\' gs_export-filename into lv_filename.
    call function 'GUI_DOWNLOAD'
        filename                = lv_filename
        data_tab                = data_tab
        file_write_error        = 1
        no_batch                = 2
        gui_refuse_filetransfer = 3
        invalid_type            = 4
        others                  = 5.
    if sy-subrc <> 0.

    GUI_DOWNLOAD does not get's executed in the Backgroud.
    there is no way to do it as a background job.. create the folder.. transfer the file to the application server in the backgorund using OPEN DATASET... use the tcode CG3Y to download the file from the app server to your folder..

  • Authorization error calling a XI web service from Web Dynpro

    Hi all,
    I'm trying to communicate to XI from a Web Dynpro application but I get an Unauthorization error (401).
    I've generated a WSDL in XI and import it to web dynpro as a new Model. But when a I call the web service, the exception "Service call exception; nested exception is: Invalid Response Code: (401) Unauthorized." appears.
    I don't know how to pass the right user and password from Web Dynpro, I've tried the web service from SOAP client tools and it works fine.
    I'll apreciate any help.

    Hola mi  nombre es Luis,
    Creyendo que eres español te escribo en tal idioma.
    He visto que a ti también te devolvía un error de autentificación 401, y que lo subsanaste, pero a mi con la solución que te dieron no me vale, ya que implemento el código que te ofrecieron para arreglarlo y ahora me da un fallo de "Server Error" poniendo en usuario y password, los correspondientes a XI.
    +Request_MI_outTurnoverDetailsDisplay_MI_outTurnoverDetailsDisplay req=new Request_MI_outTurnoverDetailsDisplay_MI_outTurnoverDetailsDisplay();
    No sé si es que ese usuario y contraseña son otros distintos.
    Si pudieras ayudarme, te lo agradecería.
    Un saludo, Luis

Maybe you are looking for