How to access HttpServletRequest from Web Dynpro

Hi,
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.
    Regrads
    Rajesh

    Hi,
    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
    i.e
      WDPortalNavigation
          .navigateAbsolute("link",[parameters]);
    Since your passing parameters, you build url in both the cases.
    Ram

  • Access files from Web Dynpro component

    Hi,
    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?
    Thanks,
    Kizza

    Hi,
    You can follow the Creating the JCO connections in the Content Administrator section in the following
    help.sap.com [link|http://help.sap.com/saphelp_nw70/helpdata/EN/f8/bdfe80d9a3b048a5fb32a7d149774e/content.htm].
    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.
    Regards,
    Alka.

  • 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:
    http://www8.hp.com/us/en/support-topics/mobile-printing/how-to-print-mobile-devi 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.
    Regards
    vijay

    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.
    Regards
    vijay

    Hi
    you can use function module
    data   ls_input_container  TYPE swr_cont.
    data   lt_input_container  TYPE TABLE OF  swr_cont.
    CALL FUNCTION 'SAP_WAPI_START_WORKFLOW'
        EXPORTING
          task            = ptask
        IMPORTING
          return_code     = lv_return_code
          new_status      = lv_new_status
        TABLES
          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 *
    Regards,
    Arvind
    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:
    try{
    URL url = new URL("Some Url");
    HttpURLConnection.setFollowRedirects(false);
    HttpURLConnection connection = (HttpURLConnection) url.openConnection();
    connection.connect();
    wdComponentAPI.getMessageManager().reportSuccess("Response code ="+connection.getResponseCode());
    }catch(Exception e){
    wdComponentAPI.getMessageManager().reportSuccess("Exception");
    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
    Sundeep
    Edited by: Sundeep Sethi on Feb 18, 2008 9:07 AM
    Edited by: Sundeep Sethi on Feb 18, 2008 10:23 AM

    Hi,
      Check this code from /thread/5242768 [original link is broken] if it works.
    try{
    URL myurl = new URL("http://calendar.google.com");
    URLConnection connection = myurl.openConnection();
    if(connection instanceof HttpURLConnection) {
    HttpURLConnection httpConnection = (HttpURLConnection) connection;
    HttpURLConnection.setFollowRedirects(true);
    httpConnection.setRequestMethod("HEAD");
    httpConnection.connect();
    System.out.println("Response = "+httpConnection.getResponseCode());
    catch(Exception e) {
    // print exception
    Regards,
    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.
    Thanks.
    Mithun

    Hi Mithun,
    Have you check this?
    http://help.sap.com/saphelp_nw70ehp2/helpdata/en/f8/872806981d4411b5ce51a00207ed31/content.htm
    and also go through..
    How to print in a web dynpro application
    Print button
    Cheers,
    Kris.

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

    Hi,
    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
    tom

    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.
    Regards,
    Srinivasan Subbiah

  • Web Service access from WEB Dynpro

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

    hi
    Check for the methods like setuser and set password for your webservice
    Request_<webservicename> request=new Request_<webservicename>();
        wdContext.nodeRequest_<webservicename>().bind(request);
        wdContext.currentRequest_<webservicename>Element().modelObject()._setUser("sdnuser");
         wdContext.currentRequest_<webservicename>Element().modelObject()._setPassword("sdnuser");
         wdContext.node<webservicename>Request().current<webservicename>RequestElement().setRequest(company);
         try
                   wdContext.currentRequest_<webservicename>Element().modelObject().execute();
         catch (Exception e) {
              wdComponentAPI.getMessageManager().reportWarning("Exception:"+e);
    Hope this helps,
    Regards,
    Arun

  • Connecting to SAP from Web Dynpro

    Hi,
    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
    PG

    hi pg
    Just go thru this example which describes how to connect to SAP from web dynpro application.
    http://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/webas/webdynpro/tutorial on accessing abap functions in web dynpro - 4.htm
    thanks
    kris

  • 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
      2010(200,101).
                        Can some one tell me how to solve this....
    Regards
    Sankar

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

  • 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.
    phoneNo
    cellNo
    emailID.
    Another entity service called "Person" is created. This contains the following attributes.
    personId
    personName
    personAddr
    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
    APerson
         |_ 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.setCellNo("9092130156");
    contact.setEmailID("[email protected]");
    contact.setPhoneNo("432258");
    contact.getAspect().sendChanges();
    ls.add(contact);
    person.setRelatedModelObjects("contactsRef",ls);
    person.setPersonID("9999");
    person.setPersonName("xyz");
    person.setPersonAddr("ABC, KOL");
    wdContext.nodeAPerson().bind(person);
    person.getAspect().sendChanges();
    CAFServiceFactory.getServiceFacade(idendityDefinition.class);
    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
    Chandan
    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.
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/cef4f43e-0d01-0010-db84-ede25c874115.
    award points if  info is helpful
    Regards,
    Anish

  • 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,
    Steffen
    REPORT that is called with Batch Input from Web Dynpro:
    call function 'ZFM_GENERATE_EXPORT'
      exporting
        it_detail_record     = lt_records
        is_export            = gs_export
      importing
        ev_string            = gs_export-document
        et_dataset           = data_tab
      exceptions
        parameter_is_initial = 1
        others               = 2.
    if sy-subrc <> 0.
    endif.
    concatenate '\\SERVER\EXPORT\' gs_export-filename into lv_filename.
    call function 'GUI_DOWNLOAD'
      exporting
        filename                = lv_filename
      tables
        data_tab                = data_tab
      exceptions
        file_write_error        = 1
        no_batch                = 2
        gui_refuse_filetransfer = 3
        invalid_type            = 4
        others                  = 5.
    if sy-subrc <> 0.
      exit.
    endif.

    HI,
    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: com.sap.engine.services.webservices.jaxrpc.exceptions.InvalidResponseCodeException: 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.
    Regards,
    Diego.

    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();
    wdContext.nodeRequest_MI_outTurnoverDetailsDisplay_MI_outTurnoverDetailsDisplay().bind(req);
    req._setUser("username");
    req._setPassword("password");+
    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

  • Java code not working in Jsp page....

    I like to say to myself "there is no magic" when I come to a perplexing situation, today is one of those times. The following code when executed from the java class retrieves all the specified objects from the database and displays the requested attr

  • Float/Untab Document Windows

    Is there any way to make it possible to float document windows properly, like you can for every other piece of the software? By that I mean not locked within the parent window of the app. This was the default for dreamweaver for the longest time, the

  • Alert Message for Scehuled messages

    Hello, Can we get alert email for scheduled messages in Integration Engine? If yes how to get that? Regards, Ansar.

  • Adobe not opening audio files directly anymore.

    Hi folks. I have a slight problem when opening up wav files in Audition. For some reason after udating Windows Media Player, it tried to take over as the default program to open WAV files. So, I went into add/remove programs and tried to reset Auditi

  • MacBook Pro EFI Firmware Update 2.0

    Hello, I receive regular updates of the "MacBook Pro EFI Firmware Update 2.0" software. Each time I download, restart and let the update install. Each time it says update istalled succesfully... Yet each time I get the upgrade notice. Worse now, iTun