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.

Similar Messages

  • SRM 7.0 find transparent table name from Web dynpro Component

    Hi ,
    I am trying to find the transparent table name from Web dynpro component dictionary structure. I am working in SRM 7.0. Please let me know how to find the transpartent table for a field.
    Thanks,
    Monica

    hi,
    your question is very unclear and does not relate to performance.
    SRM uses webdynpro ABAP so the recommendation will not help.
    Do you need a technical UI element?
    Or the application table where the business data of an UI is stored???
    If it is the later, then you can use the SQL trace, change to element you are interested in, and trace it. The table should appear in the trace in connection which an UPDATE command. Still a bit cimbersome.
    Siegfried

  • Context from Web-Dynpro-Component-Interface & Customer Extention Fields

    Hello all,
    A main component uses a Web-Dynpro-Component-Interface and defines an external maping to it. Web-Dynpro-Component-Interface has a context and a window. At runtime implementaion of Web-Dynpro-Component-Interface is provided.
    All works fine, but how can i create an implementation with view which contains customer extention fields? Unfortunately only fields from context of Web-Dynpro-Component-Interface are visible. I can not even extend the context of Web-Dynpro-Component-Interface via enchancement framework.
    I assume, it is possible with dynamic programming, but why is it not possible in declarative way?
    thanks
    regards
    Paul

    Hello,
    I found this documentation:
    Implementation of Interfaces for Customer Developments
    Using interfaces in a Web Dynpro component benefits customers by giving them a clean basis for their own further developments. When creating a local development, you can implement a used interface in a separate component and add your own aspects to an application delivered by SAP.
    http://help.sap.com/saphelp_nw70/helpdata/en/a9/19eebc1e2943dbb2d443095d017ae9/content.htm.
    I think it must be a correct way to extend SAP programms with customer fields. Please reply, issue is very important.
    Regards
    Paul

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

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

  • Import data from excel/csv file in web dynpro

    Hi All,
    I need to populate a WD table by first importing a excel/CSV file thru web dynpro screen and then reading thru the file.Am using FileUpload element from NW04s.
    How can I read/import data from excel / csv file in web dynpro table context?
    Any help is appreciated.
    Thanks a lot
    Aakash

    Hi,
    Here are the basic steps needed to read data from excel spreadsheet using the Java Excel API(jExcel API).
    jExcel API can read a spreadsheet from a file stored on the local file system or from some input stream, ideally the following should be the steps while reading:
    Create a workbook from a file on the local file system, as illustrated in the following code fragment:
              import java.io.File;
              import java.util.Date;
              import jxl.*;
             Workbook workbook = Workbook.getWorkbook(new File("test.xls"));
    On getting access to the worksheet, once can use the following code piece to access  individual sheets. These are zero indexed - the first sheet being 0, the  second sheet being 1, and so on. (You can also use the API to retrieve a sheet by name).
              Sheet sheet = workbook.getSheet(0);
    After getting the sheet, you can retrieve the cell's contents as a string by using the convenience method getContents(). In the example code below, A1 is a text cell, B2 is numerical value and C2 is a date. The contents of these cells may be accessed as follows
    Cell a1 = sheet.getCell(0,0);
    Cell b2 = sheet.getCell(1,1);
    Cell c2 = sheet.getCell(2,1);
    String a1 = a1.getContents();
    String b2 = b2.getContents();
    String c2 = c2.getContents();
    // perform operations on strings
    However in case we need to access the cell's contents as the exact data type ie. as a numerical value or as a date, then the retrieved Cell must be cast to the correct type and the appropriate methods called. The code piece given below illustrates how JExcelApi may be used to retrieve a genuine java double and java.util.Date object from an Excel spreadsheet. For completeness the label is also cast to it's correct type. The code snippet also illustrates how to verify that cell is of the expected type - this can be useful when performing validations on the spreadsheet for presence of correct datatypes in the spreadsheet.
      String a1 = null;
      Double b2 = 0;
      Date c2 = null;
                        Cell a1 = sheet.getCell(0,0);
                        Cell b2 = sheet.getCell(1,1);
                        Cell c2 = sheet.getCell(2,1);
                        if (a1.getType() == CellType.LABEL)
                           LabelCell lc = (LabelCell) a1;
                           stringa1 = lc.getString();
                         if (b2.getType() == CellType.NUMBER)
                           NumberCell nc = (NumberCell) b2;
                           numberb2 = nc.getValue();
                          if (c2.getType() == CellType.DATE)
                            DateCell dc = (DateCell) c2;
                            datec2 = dc.getDate();
                           // operate on dates and doubles
    It is recommended to, use the close()  method (as in the code piece below)   when you are done with processing all the cells.This frees up any allocated memory used when reading spreadsheets and is particularly important when reading large spreadsheets.              
              // Finished - close the workbook and free up memory
              workbook.close();
    The API class files are availble in the 'jxl.jar', which is available for download.
    Regards
    Raghu

  • Web Dynpro component - Flat file upload

    Hi,
    We have a requirement to upload a flat file to Planning cube (real time cube) through Web Dynpro component.
    Web Dynpro component which we have developed is able to read the records from the flat file.
    Now, the issue is u201CHow can we save the records read from the flat file to planning cubeu201D?
    If anyone has worked on the similar requirement, pls reply. Thanks in advance.
    Note : We have a planning sequence which will be executed on the click of UPLOAD button.
                  This planning sequence has a filter on Infoprovider (cube which we are using for planning) and a planning function of type u201CFile uploadu201D in which we have defined the flat file format.
                  Aggregation level is made on Multiprovider which has 2 underlying cubes (One is realtime and other one is standard).
    Is there any function module in which we can pass the name of the flat file so that it will be uploaded in planing cube?
    Regards,
    Ankur

    You can deploy solution provided by Marc Bernard within following SDN's contribution:
    [u201CLoad a File into SAP NetWeaver BI Integrated Planningu201D |http://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/90cef248-29e0-2910-11bb-df8dece7e22c]
    This uses webdynpro functionality.

  • 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

  • No component usage created in enhanced web dynpro component

    Hi experts,
    I am facing the following problem:
    I'd like to enhance a web dynpro component in order to add a popup window. The popup is triggered by the process_event method. So far everything works just fine.
    But the popup needs to know some context attributes from the main component, and I cannot create a component usage in order to set the context mapping.
    Does anybody know how to solve this issue?
    Thanks and regards
    Jan Phillip Höft

    Hi!
    Thanks for your answers first of all.
    I need the popup to be a stand alone web dynpro component, so I guess the assistant class doesn't do the trick because I can not access it in the popup component.
    The popup is called when the business object is saved. So that the user is asked to notify other users that the document has changed. In this popup the user should fill in the message and click a button to send it and close the popup.
    So I tried the OBN approach as well but with two problems :
    1. I cannot close the popup component by coding (button click) because it has no direct parent component
    2. The save event is not run through properly so the document stays locked by the user. But I didn't look into this yet.
    So it would be perfect to have an embedded popup component which is based on a stand alone web dynpro application so it can be closed properly but it need at least access to the guid of the main component.
    Anybody got an idea for this?
    Thanks and regards
    Jan Phillip Höft

  • Error occurred when trying to access DC in web dynpro

    Hi,
    Have everyone ever encountered an error saying <b>"Unhandled exception caught in event loop"</b> when trying to access DCs in web dynpro?  I tried to add a new action to my main compnent after a used web dynpro component (DC) was added but the web dynpro would shut down automatically.  The web dynpro would shut down accidentally and automatically even when I clicked the interface controller.  Some times, the error log would repport "<b>org.eclipse.swt.SWTError: No more handles</b>"...it has driven me crazy.  I could not go further.  Can someone tell me what I have done wrong to get these errors?!!
    thanks,
    Zita

    Dear Zita,
    I error is related tot he message which you get "No more handles".
    This definitelly means that there is a bug and old files are not closed , thus the number of handles on OS level is exceeded.
    The exact way to debug the "handles" leak is with applying SAP JVM Profiler, using the I/O Analysis feature.
    http://www.sdn.sap.com/irj/scn/downloads?rid=/library/uuid/a0a67d7d-36e9-2a10-3a99-94fc8caaea0e
    Best Regards,
    Sylvia

  • Is it possible to serialize a web dynpro component controller?

    Hi,
    Is it possible to serialize a web dynpro component controller and deserialize it for use?
    I have one web dynpro application WDA1 for web dynpro component WDC1. And  another web dynpro application WDA2 for WDC2 will be opened in a new window triggered by a button action in WDC1.
    Iu2019d like to pass the object reference of WDC1 component controller to WDC2.
    I first tried to use a static member of a class object but found out that even the static member is initialized and set in WDC1, itu2019s still initial when I access it in WDC2.
    Then I searched the forum and found one article Passing Object ref to Webdynpro Application while calling from BSP screen .
    The recommended way is to serialize the object reference and store in a DB table, later on read it out and deserialize it for use.
    I tried serialization using the following code, but when itu2019s deserialized, the result is initial.
    Can anyone share some ideas on this?
    Serialize
      data: ostream type string,
               xslt_err type ref to cx_xslt_exception.
    ***** serialize model class
      try.
          call transformation id
          source model = wd_comp_controller
          result xml ostream.
        catch cx_xslt_exception into xslt_err.
      endtry.
    Deserialize
        data: istream type string,
              xslt_err type ref to cx_xslt_exception.
        istream = ls_db_sel-obj.
        data lr_wdc type REF TO ZIWCI_BY_WDC_SERIALIZE.
        try.
            call transformation id
            source xml istream
            result model = lr_wdc.
          catch cx_xslt_exception into xslt_err.
        endtry.

    When you say new window, I assume you mean new browser window. This is a separate user session then.  This is why the singleton pattern doesn't work.  Have you considered using a new dialog window instead of a new browser window.  It will be modal, but will share the same user session as the parent window.
    >Why do you choose this approach over cross-component usage ? component usage is the way webdynpro components are >to be reused.
    >You can also consider using Singleton OO pattern class to share data between these two components.
    Neither of these approaches will work if you are using separate browser windows. Such an approach results in two separate user sessions (perhaps even running on different application servers depending upon how you have load balancing setup) and therefore can't share data using either of these approaches.
    In general the idea of serialization and then writing the string ito a server cookie or other database table is sound.  I don't think you should try and serialize the component controller, however.  Serialization only saves and restores public attributes - not protected or private ones.  So in general a class has to be designed for serialization.  The component controller is much too complex and wasn't designed for such an operation. 
    I would suggest instead extracting the data you want to share out of component controller or context and serializing it into a custom class and passing that to the other component.

  • How to extract the content of a user uploaded txt file in web dynpro?

    Hi,
    I'm working on a java web dynpro component. This component consists of document upload field, where users should be able to upload .txt documents. These uploaded text documents should then be somehow read, and thir content displayed. I am already able to upload documents using the upload field, and store it in the context, but I'm still not able to extract the content of these text documents for displaying.
    Does anyone have any suggestions of how I could do this?
    Any help will be greatly appreciated!
    Thanks!

    Hi Alain,
        You can do through this document on how to upload/download files in Webdynpro.
    [https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/202a850a-58e0-2910-eeb3-bfc3e081257f]
    Once you have the uploaded file in your context if you are storing it as a byte array then convert it to a string using the String constructor String(byte[] bytes)  and then you can store this string in an attribute of type String which could be bound to a UI element (TextArea) to display the contents.
    If you are using an IWDResource then you will get an inputstream from which you can read the data and convert it to a string for display as mentioned above.
    Hope this helps.
    Sanyev

  • Pass Parameters to an external appl when launched from web dynpro ABAP .

    I want to Pass Paramaters to an external application when launced from Web dynpro ABAP . I have successfully launched an .exe file ( Notepad / eViewHSEditor ) from Web dynpro using the logic from Standard WD_TEST_APPL_ACFEXECUTE component  But I am unable to Pass paramters to the .exe file .
    example :-  I would like to pass parameters  text1 text2 in the arugement list and I expect it opens an untitled notepad and in the file it will have parameters text1 text2 . But it is behaving in a different way . Below are the detailed steps of what I have done .
    The steps that I followed :-
    1)  Right now I have created the white list Configuration for Notepad.exe
    2) I have created 1 and 2 postions both of type string and permission Legal .
    3) The Paramter Value is * for both 1 and 2 .
    4) I activated the whitelist and it generated an .XML file
    5)
              application = 'C:
    WINDOWS
    system32
    notepad.exe'.
              argument = 'text1 text2' .
              co_element :- I am reading the element from the conrtext .
          co_element = wd_context->get_lead_selection( ).
          co_element_stru-attribute_name = 'ERROR'.
          co_element_stru-element = co_element.
          wd_this->acf_method_handler->if_wd_acfexecute~execute( application =  application
                                                                 argumentlist = argument
                                                                 errorinformation = co_element_stru ).
    when i execute  the application , it is trying to launch a notepad with file  'text1  text2.txt'  and it doesn't have one , it is asking do you want to create .  If You yes, it will open notepad with name 'text1 text2.txt' . If you Pass abcd in the arugement list , if the file with name abcd.txt exists , it opens the notepad with that file name .

    You try to open notepad from your PC with the same command, you will the same result.
    start->run->notepad "test1 test2". You get the popup saying that "test1 test2" file is not existing. You can google it to find a way to pass the text while opening notepad and try to fit that in your WebDynpro argument. I doubt if it is possible though.

  • Editing application-j2ee-engine.xml file in Web Dynpro DC

    I'd like to set one of my web dynpro apps to automatically start whenever the J2EE engine is started.
    <a href="http://help.sap.com/saphelp_erp2005/helpdata/en/94/0a5b422f786255e10000000a155106/frameset.htm">This SAP Library document</a> states that you can do that in the application-j2ee-engine.xml file. However, I cannot find the application-j2ee-engine.xml file anywhere in my Web Dynpro DC. I've opened the DC in Web Dynpro Explorer view, Package Explorer view, Navigator view, J2EE DC Explorer view and J2EE Explorer view.
    Even after expanding all the folders in each view I still can't find the application-j2ee-engine.xml file.However if I search my '.dtc' folder on my hard drive I find the application-j2ee-engine.xml file in the following path:
    C:\...\.dtc\1\t\13AA2EFA530FEB42915442D10D7C71A6\gen_wdp
    How can I EDIT that file for a web dynpro component/app?
    Thanks!
    David
    Message was edited by: David Z. Pantich to include the link to the SAP Library document

    Hi Maksim. I understood that. It's just that I would prefer some method that doesn't require the developers to do something like extracting a file from the EAR file, changing the file and then putting it back in. As you probably know, some developers could handle it and some will most certainly make mistakes.
    When they do they come to my group and say "my app doesn't work" and then we have to spend time figuring out why.
    Plus, once the developers get used to doing things the automated way they're going to have a hard time remembering to do a manual step each time they do a build.
    I have heard that there may be some way to do something similar to this on Visual Administrator. I'm going to investigate that too.
    Thanks!
    David.

  • Web Dynpro component activation failed

    I tried to activate a web dynpro component and the activation failed. Have listed error messages from the request log and activation log. Do let me know what could be the issue. The application deployed successfully on my local J2EE.
    Request log details are as follows:
    ===== Processing =====
    BUILD DCs
         "hubbell.com/appl/ptl.wd.regtool" in variant "default"
              .. FAILURE: The build failed due to compilation errors. See build log for details. [result code: 202]
    ===== Processing =====  finished at 2005-11-29 00:09:48.813 GMT and took 18 s 899 ms
    ===== Post-Processing =====
    Check whether build was successful for all required variants...
         "hubbell.com/appl/ptl.wd.regtool" in variant "default"   FAILED
    ===== Post-Processing =====  finished at 2005-11-29 00:09:48.823 GMT and took 3 ms
    Change request state from PROCESSING to FAILED
    ERROR! The following problem(s) occurred  during request processing:
    ERROR! The following error occurred  during request processing:Activation FAILED due to build problems. See build logs for details.
    Activation log details are as follows:
    wdgen] [Info]    Initialize generation templates from configuration jar:file:/usr/sap/EDP/JC00/j2ee/cluster/server0/temp/CBS/79/.B/3223/DCs/sap.com/tc/bi/wd/_comp/gen/default/public/def/lib/java/SapWebDynproGenerationCore.jar!/WebDynproGenerationConfigurationCompiled.xml
        [wdgen] [Error]   com.hubbell.ptl.rgstr.app.Registration -->
       Application Registration: Component is missing
        [wdgen] [Error]   com.hubbell.ptl.rgstr.app.Registration -->
       Application Registration: Startup plug is missing
        [wdgen] [Error]   Generation failed due to errors (0 seconds)
    Build with ERRORS
    file:/usr/sap/EDP/JC00/j2ee/cluster/server0/temp/CBS/79/.B/3223/DCs/hubbell.com/appl/ptl.wd.regtool/_comp/gen/default/logs/build.xml:49: [Error]   Generation failed!

    There's obviously something missing in your WD DC: "Startup plug is missing". Your code has been checked-in to the inactive workspace. What you can do now is synchronize your DC with the server. You should get the same error then in your local NWDS and solve it.

Maybe you are looking for