Caching in Web Dynpro Java

Hi Experts,
I am trying to develop a web dynpro for java application based on RFC model.
I am using an RFC that brings the Countries and States from the R/3 and will be used as dropdowns in the views controllers.
The question is:
I would like to cache the Countries and States in my web dynpro application. The idea is not to execute the model everytime. The model should be executed only once. I would like to store these countries and states in a local java dictionary or etc. and use them for UI element designing.
Is there any way to do this in Web Dynpro Java? I would like to follow a better approach to avoid performance problems.
I do not want to follow this approach: executing the model in the wdInit method of the controller. Executing this model in this method also causes performance problems. Because the model is brining approx 1540 records from R/3.
Please advice.

Hi All,
Thank you for the suggestions.
I am a beginer in wd java. i am starting with amit's suggestion.
Step 1: Execute RFC to fetch data preferably use doInt method for it.
Should I execute the method in wdInit of the view controller/component controller?
I defined a method "executePMPReadBAPI" in component controller.
  public void executePMPReadBAPI( )
    //@@begin executePMPReadBAPI()
   try{
        wdContext.currentPMPDoctorReadElement().modelObject().execute();
        }catch (Exception e){
        logger.errorT("Error in executing PMP Read BAPI");
wdInit of View controller:
          IWDAttributeInfo countryInfo =
               wdContext.getNodeInfo().getAttribute(
                    wdContext.currentContextElement().COUNTRY);
          ISimpleTypeModifiable countryType =
               countryInfo.getModifiableSimpleType();
          IModifiableSimpleValueSet countryValueSet =
               countryType.getSVServices().getModifiableSimpleValueSet();
          for (int i = 0; i < wdContext.nodeCountries().size(); i++) {
               IWDNodeElement CountryNode =
                    wdContext.nodeCountries().getElementAt(i);
               String countryKey = (String) CountryNode.getAttributeValue("Land1");
               String countryText =
                    (String) CountryNode.getAttributeValue("Landx");
               countryValueSet.put(countryKey, countryText);
This coding is working, I am able to populate the dropdowns. The problem is the application is slow.
I am guessing this much coding is not necessary in the view conroller's wdInit method.
Why the binding approach like mentioned below is not working (model>Conroller>View)? How should I execute the RFC in the wdInit of the component controller? Is this possible?
wdInit of Component Controller: Below coding and proper binding is not sufficient to populate dropdowns? Please advice.
     Zhr_Ess_Address_Input ReadInput = new Zhr_Ess_Address_Input();
          wdContext.nodeZhr_Ess_Address_Input().bind(ReadInput);
          try {
               wdContext
                    .currentZhr_Ess_Address_InputElement()
                    .modelObject()
                    .execute();
               wdContext.nodeOutput().invalidate();
          } catch (Exception e) {
               logger.errorT("Error Reading the BAPI");

Similar Messages

  • KM Permissions in Web Dynpro Java

    The error message: "Permission denied: uri=/kmfolder,
    permission=node_create_child, user=XXXXXX"
    Background:
    We are using a KM Windows repository to connect KM to a Windows shared
    folder over the network. Then we are using a Web Dynpro java
    application to write a file to the KM Folder, which is then mapped to
    that KM Windows repository.
    Security on the Windows shared folder is wide open. Everyone=Full
    Control, and Domain Users=Full control.
    Problem:
    When end users try to write the file to KM through the Web Dynpro app,
    they get the error:
    "Permission denied: uri=/kmfolder, permission=node_create_child,
    user=XXXXXX"
    But when we give them the Content Admin role, they are able to write
    the file just fine. For this reason, I do not believe there is a
    Windows permission issue.
    We have tried:
    -Explicitly setting User Mapping through User Admin -> Identity
    Management
    -Using a System Principle role with Full Access (Read, write, delete)
    -Duplicating the Content Admin role, removing the pages & iViews (so
    they can't view the Content Admin interface) and assigning this role to
    our test users.
    We have setup:
    Network path
    - ->jCIFS=True
    - ->Network path=
    <serv.host.com>\<sharename>
    - ->User=<domain>\<ADMIN User>
    KM Windows System Object
    - ->User Mapping=admin,user
    KM Windows System Landscape Definition
    CM Repository Manager
    - ->Prefix=/<sharename>
    - ->Persistance Mode=fsdb
    - ->Root directory=
    <serv.host.com>\<sharename>\root
    - ->Root directory for versions=
    <serv.host.com>\<sharename>\versions
    - ->Repository services=svc_acl
    - ->Security Manager=W2kSecurityManager
    - ->ACL Manager Cache=ca_rsrc_acl
    Edited by: Peter Speers on Apr 9, 2009 11:41 PM

    /thread/1302951 [original link is broken]

  • Reimporting RFC inro web dynpro java project

    Hi,
    I tryed to reimport RFC into my web dynpro java application.
    It warn me with message below
    Message
    Adaptive RFC Reimport could lead to inconsistence of R/3 metadata cashed on the J2EE server
    Thus it is recommanded to invalidate the cache,
    this could be done either by restarting the J2EE server or by using Adaptive RFC Metadate Cache Invalidation Tool within Webdynpro Console
    Question
    How can i use  RFC Metadate Cache Invalidation Tool ?
    Thanks.

    Hi Friend,
    Have A look On This Document Hope It will help.
    [Metadata Cache Invalidation for Adaptive RFC Models|http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/10465350-b4f5-2910-61ba-a58282b3b6df&overridelayout=true]
    And Let Us Know If Still face any issue.
    Regards
    Jeetendra

  • Logical Destinations in Web Dynpro Java

    Hi!
    Is it possible to access logical HTTP destinations maintained in SAP NetWeaver Administrator via Configuration Management -> Security ->Destinations in Web Dynpro Java source-code.
    I would like to use such a destination to configure an URL target for a IWDFrame UI element.
    Thank you very much in advance!
    Regards,
    Thomas

    I found out that there is a [Destination Service API|http://help.sap.com/saphelp_nwce711/helpdata/en/8b/8e7dac1e661d44bf2a676fd3948cc6/content.htm] for this purpose. Unfortunatly I am still not able to provide the required components security.class and tc/sec/destinations/interface to the web dynpro component. Maintaining them via Project Properties -> Web Dynpro is not allowed any more, and I couldn't find them in the DC perspective to add them as DC dependency.
    Has anybody got an idea where these two libraries have gone?
    Regards,
    Thomas
    PS: The 7.0 procedure, which can be found in various posts, doesn't seem to work any more for CE 711.

  • Date Column not getting sorted in a table in web Dynpro Java

    Hi All,
    I am facing an issue while sorting the date column in a table in my web dynpro java application.
    When the date is displayed in the sql format in tha table, I am able to sort the date column successfully but when we convert the date field from sql format to util format in our table and then sort it does not work.
    Kindly let us know the steps to be followed in this case to sort the date column of a table in Simple Date format as we do not want date in the sql format to be displayed.
    Thanks & Regards,
    Anurag

    Hi,
    You might want to check whether both your browser's language settings are identical. The browser language could also determine the date format.
    As a workaround, you could add an extra attribute to your context, and set the calculated property to 'true'.
    In your table, add a new column and bind to this new attribute, and hide your original date column
    If you sort using the date column that's hidden now, you could use the calculated field to fixed-format your date the way you prefer (by using the SimpleDateFormatter class for instance)
    Cheers,
    Robin

  • How to create a user in UME Database using web dynpro java custom application

    Hi,
    Can you please suggest me how to create a user in UME Database using web dynpro java custom application.
    My Requirement is user can register his/her user id in SAP Portal 7.3 UME database.
    Please suggest me.
    Thanks and Regards,
    Amit

    Hi Amit,
    Generated Documentation (Untitled)
    This is what you're looking for, there's no real cook-book -- though Amey mentioned there might be some material on SDN, perhaps some tutorials.
    You should be looking into com.sap.security.api.IUserFactory, methods newUser(String) which gives you and IUserMaint and commitUser(IUserMaint, IUserAccount) -- IUserAccount can be obtained using com.sap.security.api.IUserAccountFactory, method newUserAccount(String)
    Hope it helps,
    D.

  • How to configure SSO for web dynpro ABAP (not web dynpro Java)

    Hi Experts,
        I am testing SSO in IDES for web dynpro ABAP (Not for web dynpro Java / not for portal). When I am entering url of web dynpro application in web browser like internet explorer, then it should ask for user id and password first time, after login whenever user would access that url, it must not ask for user ID and password (url would be access web browser in mobile). For this I select to configure single sign-on for web dynpro ABAP. I have done below works:
    1). I have created a web dynpro application having url: http://susws076.sap.swk:<port>/sap/bc/webdynpro/sap/zadb_hello_world2
    2). I run TCode SICF and access service node to "Zadb_hello_world2". Double click on it, hit change. pressed "logon data" tab, select "Alternative logon
         procedure"
       Then deleted all logon procedure other than "SSO Authentication" and saved.
    3). Go to "STRUST" and create certificate, choosed "Environment==> Logon Ticket" fill the required parameters and execute. It is OK (no red traffic
         signal).
    4). Execute TCode "RZ10" to change profile parameter, insert new parameter (indicated by red arrow)
    After all this settings I opened a browser enter above URL and hit enter but there is an error
    There is no login page. It directly showed this error page. No cookies is saving.
    Can anyone tell me what all the settings/configuration other than this I have to do. And is there any wrong setting done by me?
    How to set the for single sign-on?
    Thanks in Advance
    Regards
    Piyush

    Hi Piyush,
    Pls refer below links,
    Single Sign On with ABAP WebDynpro
    http://help.sap.com/saphelp_nw70ehp2/helpdata/en/5e/6c85c3edf942f39349a1e337434d29/content.htm
    Regards
    K.N

  • How to set a variable in portal session using web dynpro java.

    Hi,
    I have created a web dynpro application, which is running inside portal. I have created a role called "R1". Inside role R1, i have created 3 workset W1, W2 and W3. and inside each workset i have some pages and iviews.
    My requirement is when user logins to the portal , and when he clicks on role R1 for the first time, a login page should come (so that we can do revalidation), and when he enters his password again in that login page , then only workset W1, W2 and W3 should be visible/accessible to him and after successful revalidation, if he clicks again on role R1, in that particular portal session, than that login page should not come.
    for this, i thought i will set a variable in portal session, whenever user successfully revalidated himself, and if after successful revalidation he clicks again on role R1, i will check in doinit method of webdynpro whether variable is set or not (which i already set on successful revalidation), and if it is set then i will do Donavigation else i will present login page to the user.
    Can anyone tells me how to set a variable in portal session using web dynpro java.
    thanks
    Arush

    Hi,
    Try this:
    WDScopeUtil.put(WDScopeType.CLIENTSESSION_SCOPE, key, value)
    WDScopeUtil.get(WDScopeType.CLIENTSESSION_SCOPE, key)
    Ex:
    WDScopeUtil.put(WDScopeType.CLIENTSESSION_SCOPE,"Key1","Value1");
    String value1=WDScopeUtil.get(WDScopeType.CLIENTSESSION_SCOPE,"Key1").toString();
    /people/william.cui/blog/2007/02/12/sharing-session-context-between-parent-and-external-windows-running-on-same-host
    Regards,
    Charan

  • Web Dynpro Java - Light Portal Desktop

    Hi Guys... I have a web dynpro java application that I want to display on a Light Portal Desktop, but when I display the iview... it gets cut. I mean I can see only part of my application and there is also a right scroll bar... It looks like the height size of the iview is set to "FIXED" but it's not. I Actually  modifed all values for size even on the Light Framework Page used...to FULL_SCREEN. I don't know what's wrong. If I display the same iview using a Default Framework Page it looks fine... I'm using SAP EP 7.00 SP 16.
    Is there any restriction for using Web Dynpro iviews for Light Porta Desktops?
    Thank you.
    David

    David,
    Webdynpro content is considered heavy and I dont think we can use it in LPD.
    Update:
    Note 916545 - Central Note for External-Facing Portal (NW 7.0)
    Check under application.
    Regards,
    Sandeep Tudumu
    Edited by: Sandeep Tudumu on Sep 17, 2008 8:56 PM

  • " APPLICATION NOT FOUND"  while deploying Web dynpro java Application

    Hi, I am getting a message that "application not found " While deploying the web dynpro java application .......... please give me a solution for this .

    Hi Ram,
    This error comes generally when your webdynpro project does not have an application. To create an application in your webdynpro project follow the underlying steps:
    <Project>->WebDynpro->Applications ---> right click and create New Application.
    Follow the steps to create the application.
    Now if you create archive and deploy, it will not give you the error again.
    Best Regards,
    Ravi

  • Accessing ABAP Functions in Web Dynpro Java

    Hi,
    I am trynig to do "Accessing ABAP Functions in Web Dynpro Java" this application, (which is the example application which i got from www.sdn.sap.com) but everything is fine no error also while dyploying.
    But it is not dysplaying the first page after i run the application i am getting plain web page ,without any content.
    Can any body help me.
    Regards,
    H.V.Swathi

    k.. now iam getting some error on page.
    I have embeded the two view in to window.
    But now after running the application i am getting connection error
    com.sap.mw.jco.JCO$Exception: (102) RFC_ERROR_COMMUNICATION: Connect to message server host failed Connect_PM TYPE=B MSHOST=jktr3 GROUP=SPACE R3NAME=R32 MSSERV=sapmsR32 PCS=1 ERROR Group SPACE not found TIME Fri Sep 26 15:05:59 2008 RELEASE 700 COMPONENT LG VERSION 5 RC -6 MODULE lgxx.c LINE 4288 DETAIL LgIGroupX COUNTER 1
        at com.sap.mw.jco.MiddlewareJRfc.generateJCoException(MiddlewareJRfc.java:457)
        at com.sap.mw.jco.MiddlewareJRfc$Client.connect(MiddlewareJRfc.java:989)
        at com.sap.mw.jco.JCO$Client.connect(JCO.java:3193)
        at com.sap.dictionary.runtime.mdi.DataProvider.<init>(DataProvider.java:90)
        at com.sap.dictionary.runtime.mdi.DataProvider.<init>(DataProvider.java:122)
        ... 61 more
    Rgards,
    H.V.Swathi

  • Reading contents of uploaded excel file in web dynpro java

    Hi All.
    I am aware how to provide facility to upload files in web dynpro java. But my requirement is that on uploading a particular file (for eg. an excel file having 10 columns), I need to read the contents of that file and store it in a table in R/3.Can anyone suggest a way how I can read the contents of the uploaded file?
    Thanks and Regards,
    Saurabh.

    Hi.
    I am having the following requirement : I have a FileUpload UI element where user clicks Browse button, selects a file from the local system and presses a Upload button. Upon pressing Upload, the name of the selected file and the contents of the file should be shown.
    In the View context, I have two value attributes: FileName of type String and FileResource of type binary.
    This is the code that I have in the Upload button action handler :
      public void onActionUpload(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )
        //@@begin onActionUpload(ServerEvent)
        IWDAttributeInfo attributeInfo = wdContext.getNodeInfo().getAttribute(
                 IPrivateReadExcelView.IContextElement.FILE_RESOURCE);
        IWDModifiableBinaryType binaryType = (IWDModifiableBinaryType)attributeInfo.
                 getModifiableSimpleType();
        IPrivateReadExcelView.IContextElement element = wdContext.createContextElement();
        String fname = binaryType.getFileName();
        wdComponentAPI.getMessageManager().reportSuccess("File selected - "+fname);  //Statement 1
         try {
              wdComponentAPI.getMessageManager().reportSuccess("Successful");    // Statement 2
              InputStream in = new FileInputStream(fname);
              HSSFWorkbook wb = new HSSFWorkbook(in);
              wdComponentAPI.getMessageManager().reportSuccess("Successful");    //Statement 3
              int sheetsNo = wb.getNumberOfSheets();
              for (int i=0;i<sheetsNo;i++) {
                   HSSFSheet sheet = wb.getSheetAt(i);
                   Iterator rowsNo = sheet.rowIterator();
                   while(rowsNo.hasNext()) {
                        HSSFRow rows = (HSSFRow)rowsNo.next();
                        Iterator colsNo = rows.cellIterator();
                        while(colsNo.hasNext()) {
                             HSSFCell cell = (HSSFCell)colsNo.next();
                             wdComponentAPI.getMessageManager().reportSuccess("File uploaded" +
                                  "successfully");
                             if(cell.getCellType()==1) {
                                  wdComponentAPI.getMessageManager().reportSuccess("00000"+
                                       cell.getStringCellValue());
                             else if(cell.getCellType()==0) {
                                  String str=""+cell.getNumericCellValue();
                                  wdComponentAPI.getMessageManager().reportSuccess("11111"+str);
         catch(Exception e) { wdComponentAPI.getMessageManager().raisePendingException();
        //@@end
    On pressing Upload button, name of selected file is being shown(Statement 1). I am also getting Statement 2 in the output. However I am not getting Statement 3 onwards.
    Where am I going wrong? Can anyone shed some light on this?

  • Consuming External Web Services in Web Dynpro Java

    Hi All,
    I an trying to consume external web service in Web dynpro java using Adaptive Web Service Model.
    But getting below mentioned error while executing the web service
    Exception on execution of web service with WSDL URL 'D:\Web Service Project\CurrencyConvertor.asmx.xml' with operation 'ConversionRate' in interface 'CurrencyConvertorSoap'
    Steps i followed are as below:
    1. Created  Adaptive Web Service Model for this i select WSDL source as "Local File System or URL"
    In next step i select No logical destination radio button and click on next
    In next step, browse the WSDL file and successfully import the WSDL file.
    2. After successfully importing the WSDL file i wrote below code in Init method:
    WebModel modelweb = new WebModel();               
    Request_ConversionRate reqConversion = new Request_ConversionRate(modelweb);
    ConversionRate conversion= new ConversionRate(modelweb);
    reqConversion.setConversionRate(conversion);
    wdContext.nodeRequest_ConversionRate().bind(reqConversion);
    3.After that execute the model - code is given below :
        IWDMessageManager manager = wdComponentAPI.getMessageManager();
        try
          wdContext.currentRequest_ConversionRateElement().modelObject().execute();
          wdContext.nodeResponse().invalidate();
          wdContext.nodeConversionRateResponse().invalidate();
        catch(Exception e)
          manager.reportException(e.getMessage(), false);
    Please let me know how to resolve this.
    Thanks
    Sandy

    Hi,
    You need to use destinations for metadata and modeldata.
    Configure those destination in Visula admin.
    you can refer to following link.
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/b2bc0932-0d01-0010-6d8e-cff1b2f22bc7
    Regards,
    Shruti.

  • Creating sales order using web dynpro JAVA

    Hello everyone,
    i am new to web dynpro. Can any one tell me how to creating sales order by web dynpro JAVA using BAPI.
    Thanks.
    Vinita Sharma

    Hi...
    you can use Adaptive RFC methodology in web dynpro java to work with BAPIs..... these are standard bapi's provided
    Here are required Bapis... select which one you want....
    BAPISDORDER_GETDETAILEDLIST Sales Order: List of All Order Data
    BAPI_ORDER_CHANGE_STATUS_GET Change status for order
    BAPI_SALESDOCU_CREATEFROMDATA Creating a Sales Document
    BAPI_SALESORDER_CHANGE Sales Order: Change Sales Order
    BAPI_SALESORDER_CREATEFROMDAT1 Sales Order: Create Sales Order
    BAPI_SALESORDER_CREATEFROMDAT2 Sales Order: Create Sales Order
    BAPI_SALESORDER_CREATEFROMDATA Create sales order, no more maintenance
    BAPI_SALESORDER_GETLIST Sales order: List of all orders for customer
    BAPI_SALESORDER_GETSTATUS Sales order: Display status
    BAPI_SALESORDER_SIMULATE Sales Order: Simulate Sales Order
    check this thread SALES ORDER creation using BAPI
    sample java program which will call SAP bapi function sales order create
    PradeeP

  • Deploying problem of web dynpro java application

    Hi,
    I have a web dynpro java application with no problem about deploying.
    I copied this application with another name.
    I tryed new application to deploy but sdm aborted with error.
    Error
    19.Tem.2011 10:22:25 /userOut/deploy (com.sap.ide.eclipse.sdm.threading.DeployThreadManager) [Thread[Deploy Thread,5,main]] ERROR:
    [001]Deployment aborted
    Settings
    SDM host : vserver0202
    SDM port : 52018
    URL to deploy : file:/C:/Users/CEMIL~1.BOZ/AppData/Local/Temp/temp27456HF_PERS_RAPOR_BUTCE.ear
    Result
    => deployment aborted : file:/C:/Users/CEMIL~1.BOZ/AppData/Local/Temp/temp27456HF_PERS_RAPOR_BUTCE.ear
    Aborted: development component 'HF_PERS_RAPOR_BUTCE'/'local'/'LOKAL'/'0.2011.07.19.10.22.15'/'0':
    Caught exception during application deployment from SAP J2EE Engine's deploy service:
    java.rmi.RemoteException: Cannot deploy application local/HF_PERS_RAPOR_BUTCE.. Reason: Clusterwide exception: Failed to deploy application local/HF_PERS_RAPOR_BUTCE. Check causing exception for details (trace file). Hint: Are all referenced components deployed and available on the engine?; nested exception is:      com.sap.engine.services.deploy.container.DeploymentException: Clusterwide exception: Failed to deploy application local/HF_PERS_RAPOR_BUTCE. Check causing exception for details (trace file). Hint: Are all referenced components deployed and available on the engine?
    (message ID: com.sap.sdm.serverext.servertype.inqmy.extern.EngineApplOnlineDeployerImpl.performAction(DeploymentActionTypes).REMEXC)
    Deployment exception : The deployment of at least one item aborted

    Hi,
    Since the exception says "Are all referenced components deployed and available on the engine?"
    Check wether any DC is used as a used DC in the webdynpro component which you are deploying.
    If any used DC is available try to deploy that DC in the server and then deploy ur webdynpro application.
    If all reference DC's are avialable in server, still if you get this error try to rename the component and reload+rebuild the project and deploy it.
    Hope this helps you...
    Regards,
    Saleem Mohammad.

Maybe you are looking for

  • Getting ActionScript Error while trying to use Preloaders

    Hi, I am new to the Flex.Now we are using Flex 3 in our project.I need to create custom Progress Bar, for this i got some reference examples using preloader, by googling.But i am getting the error while trying this. The stack trace of the error is as

  • Sending a Message to log

    Hi Guys, I have small issue regarding sending the warning message to CRMD_ORDER application log. i have implemented code in BADI CRM_DOC_FLOW. i am pasting the code which i used for this.. DATA: lr_message_service   TYPE REF TO cl_bsp_wd_message_serv

  • [svn:osmf:] 15456: Fix bug FM-707: Nested SerialElements signaling complete too soon.

    Revision: 15456 Revision: 15456 Author:   [email protected] Date:     2010-04-15 14:53:59 -0700 (Thu, 15 Apr 2010) Log Message: Fix bug FM-707: Nested SerialElements signaling complete too soon. Ticket Links:     http://bugs.adobe.com/jira/browse/FM-

  • How to add an icon to the Windows 95 Taskbar

    Hi, Can I get your help? I want to create a form under the Win32 platform which can add an icon in the notification area of the taskbar, but I did not know how to?

  • Jvm error 104

    i am using curve 8250 but from last 2 days it is just showing error jvm error 104. i am not able to reset also. it is not accesible. please help. **Removed**@gmail.com Edit: Email removed. At no time should you provide any personal information to any