Is this possible in Web Dynpro Java?

Hi,
Please check if this can be done in Web Dynpro Java...
public class TestFunction {
     boolean bool =false;
     boolean Test1()
          bool= true;
          return bool;
     void takeBool(boolean b){
          b=this.bool;
          System.out.println("The value of bool "+bool);
     public static void main(String[] args) {
          TestFunction tf = new TestFunction();
          boolean c=tf.Test1();
          tf.takeBool(c);
Regards
Kaushik Banerjee
Edited by: Kaushik Banerjee on Sep 1, 2010 8:00 PM

Further to what Faraz has said, Web Dynpro can be seen as an implementation of the Framework pattern.
Essentially you write normal Java code with access to various Java objects exposed/generated by the Web Dynpro Framework inside "hook" functions.
The Web Dynpro framework then calls your functions at various stages when the page renders and when actions are triggered.
For a high level understanding of this, not specific to Web Dynpro, research the concept of OO Frameworks pattersn.
for example [Article explaining frameworks|http://www.cs.wustl.edu/~schmidt/CACM-frameworks.html]
Here is an excerpt from the above article which highlights the major points
The primary benefits of OO application frameworks stem from the modularity, reusability, extensibility, and inversion of control they provide to developers, as described below:
Modularity -- Frameworks enhance modularity by encapsulating volatile implementation details behind stable interfaces. Framework modularity helps improve software quality by localizing the impact of design and implementation changes. This localization reduces the effort required to understand and maintain existing software.
Reusability -- The stable interfaces provided by frameworks enhance reusability by defining generic components that can be reapplied to create new applications. Framework reusability leverages the domain knowledge and prior effort of experienced developers in order to avoid re-creating and re-validating common solutions to recurring application requirements and software design challenges. Reuse of framework components can yield substantial improvements in programmer productivity, as well as enhance the quality, performance, reliability and interoperability of software.
Extensibility -- A framework enhances extensibility by providing explicit hook methods that allow applications to extend its stable interfaces. Hook methods systematically decouple the stable interfaces and behaviors of an application domain from the variations required by instantiations of an application in a particular context. Framework extensibility is essential to ensure timely customization of new application services and features.

Similar Messages

  • Capabilities of Web Dynpro JAVA

    Hi
    I had a requirement to capture Keyboard Events. After searching lot I found out that, it is not possible in Web Dynpro JAVA.
    Is there any document which specifies
    What are the things possible with Web Dynpro?
    What are the things missing/not possible with Web Dynpro?
    Thanks in Advance,
    Apurva

    Hi
    Refer the following but I dont to what extent it will help you
    1 .  http://help.sap.com/erp2005_ehp_02/helpdata/en/b1/968ddbded811d3b561006094b9440a/frameset.htm
    2 .  http://help.sap.com/erp2005_ehp_02/helpdata/en/b1/968dd8ded811d3b561006094b9440a/frameset.htm
    also go through the following
    Using the FunctionKey
    Use
    The FunctionKey allows you to trigger a Web Dynpro action using a specific key on the mobile device. In the following example, this UI element is used to navigate to another view via a specific key.
    Prerequisites
    ●     The SAP NetWeaver Developer Studio is installed on your computer, and you can use it to create your mobile Web Dynpro application
    ●     You have access to a SAP NetWeaver Application Server, where you are running the Web Dynpro application
    ●     You are using a Pocket PC with special scanning equipment manufactured by Intermec Technologies or Symbol Technologies
    ●     You have created two views in a Web Dynpro project and called them StartingView and TargetView.
    Procedure
           1.      Navigate to the StartingView and double-click the view or choose Edit from the context menu.
           2.      Insert the mobile UI element FunctionKey.
           3.      Switch to the Plugs tab, create an outbound plug with the name fromFunctionKey and define the navigation link to the TargetView.
           4.      Switch to the Actions tab page and define an action called NavigateToAnotherView.
           5.      Assign the value IBrowse_OnKey49 to the keyCode property of the FunctionKey.
           6.      Assign the NavigateToAnotherView action to the onAction event of UI element NavigateToAnotherView.
           7.      Switch to the Implementation tab and add the following source code to the implementation of the view controller. The read data is passed to the context and the relevant context attribute is set.
    public void onActionNavigateToAnotherView(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )
       //@@begin onActionNavigateToAnotherView(ServerEvent)
       wdThis.wdFirePlugFromFunctionKey();
       //@@end
    Result
    By pressing press key 1 on the mobile device, you navigate to the TargetView.
    Regards
    Abhijith YS

  • Is it possible to integrate web dynpro java  with xPD screens?

    We have a requirement to integrate the xPD screens with Adobe using web dynpro java. The UI has to be completely Adobe and the xPD transactions would be triggered through Adobe.
    Is it possible?? Please let me know how if anyone worked on this.
    We are using SAP NW SP12 and NWDS 7.0.1
    Thank you,
    Vasu

    Vasu,
    I'm in the same boat as you because I have no idea where to start either.  Right now we are just evaluating some possible solutions for our UI needs that our Business is asking for.  Originally I only heard about the Adobe Forms.  Then I heard about this Web Page Composer which could also provide us a way to display our iViews and other links in a more user friendly page.
    So learning how to display xPD in either area is new to me and I am just starting to learn SAP all together.  If I hear anything or read anything, I will share with you.  Maybe we can help each other out. 
    Jennifer

  • BSP / Web-Dynpro (Java / Abap)  what to use in this case ?

    Hi all,
    i have some questions about all this BSP/Web-Dynpro stuff. We have an application (for health care written in Visual Studio) out there at our customers. Some of these customers are using SAP as their backend system. So we've writte some backend functionality (a cash processing, additional reports, a special invoice system etc.etc.) in Abap and Abap-Objects. Actually we are planing a new release for this backend stuff which is using the normal SAP Gui.
    Maybe we plan for the next release to convert our app to a Web based app and we discuss what SAP technology we should use for that.
    Here are my questions :
    - When and why should we use Web-Dynpro (Java) ?
    - Can't we use BSP ?
    - Is there any future for BSP ?
    - When will Web-Dynpro for ABAP be released (actually we are not a Java Shop so Abap is prefered)?
    Hope someone can answer my question.
    Greetings
    Henning

    If you don't mind, I am going to terminate discussion of Web Dynpro ABAP here. It is not that I want to, but we are in a difficult position with this development, and can not really discuss it too much.
    But, let me first make a few (last) comments:
    (*) BSP is available since WebAS 610 (which is now nearly at the end of its lifetime). WebAS 620 is the main platform out there, with NW04 (WebAS 640) now shipping, and the next product is inevitably coming. If you keep in mind that SAP supports each release at least 7 years, and we will be shipping BSP in an upcoming release, you can see that with BSP you are not going to left stranded for many years to come.
    (*) Web Dynpro Java is out and shipping. A very nice development environment. You can build nice things with it.
    (*) Web Dynpro ABAP: it will become a very nice product as well. We should know :). But, it will definitely not ship on NW04 platform. Which unfortunately means the next great NW shipment (both naming and date is not available).
    From our experience, most people seem to make their decisions based on the available Java versus ABAP skills in the shop. However, the other factor to look at is also "pixel perfect" rendering. Only with BSP can you influence the rendering. Web Dynpro is more a development platform for business applications, and as such they must conform to the designated model/concepts, etc.
    brian

  • Is it possible to cal web dynpro java application using portal application?

    Hi,
    is it possible to cal web dynpro java application using j2ee portal application?
    If possible, how can it be done the parameter mapping over context area?
    Regards.

    you can just append parameter to the url as usual.
    you will write some code in the controller to get the parameters and set them to the context.

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

  • Ajax in Web dynpro java

    Hi experts,
    Please clarify about the usage of AJAX in webdynpro java ce7.2.
    The doubt is how to use ajax in ce 7.2 certain document says that ajax is embeded in 7.2 .
    All what I found is navigation API's and implementation of TLN, DLN etc using AJAX and AFP as the default framework page.
    Is it possible to use Ajax in webdynpro java?
    Is there are jar files for using navigation API?
    Please
    Thanks and Regards,
    Vibha

    Hi Vibha,
    This blog hopfully will answer your question regarding using Ajax in webdynpro java.
    /people/oliver.mayer/blog/2008/11/17/web-dynpro-java-and-ajax-in-sap-netweaver-ce-71-enhancement-package-1
    This how to guide shows how to use navigation API for Ajax Framework Page.
    http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/d02ee44d-3f3a-2d10-3394-f3895cc3573e
    Regards,
    Min

  • 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");

  • Synchronization in Web Dynpro JAVA

    Hi All,
    I have a Web Dynpro JAVA application, for which an iView has been created and is assigned to a role. Now I have the below requirement,
    If two users tries to access this application at the same time then the second user has to get a message stating that "A user is already accessing this application please try later". Basically the thread concept. Is it possible to achieve this in Web Dynpro JAVA. If yes please provide me some pointers on how to achieve this.
    Thanks & Regards,
    Vishweshwara

    Hi Vishweshwara,
    Create the Custum table with UserID fields.
    Create the RFC with UserID fields as input parameters and result  field as export parameter.
    Write the logic in RFC if Custum table contains any value in UserID Field then return error message like " This application is already using by  <UserID>"
    else
    stor the values UserID and LoginStatus(which you are sending from Webdynpr java app) in custom table and  return success message.
    Create webdynpro java component and create two iview called main and info view
    import the RFC in webdynpro java app and do the binding from model to component controller and component controller to view controller of main.
    Write the following code in wdDoInit() method of main view to get the login userid and sending that to RFC.
    String userID = null;
    IWDClientUser clientUser = WDClientUser.getCurrentUser();
    IUser User = clientUser.getSAPUser();
    if (User != null)
    try
    IUserAccount[] acct = User.getUserAccounts();
    if(acct[0] != null)
    userID = acct[0].getLogonUid();
    wdContext.current<RFCNodeName>Element().setUserID(userID);
    catch(UMException e)
    //Raise some error msg according to your scenario.
    //code for calling the RFC
    wdThis.wdGet<ComponentControllerName>().execute();
    String msg = wdContext.current<OutputNodeName>Element().getResult();
    if(msg != null && msg.lenght() !=0)
        if(msg.equalsIgnoreCase("This application is already using by  <UserID>")
              wdThis.wdFirPlug<PlugName>();// code for naivigate from main view to info view
    the navigation between main view to info view needs to defined in navigation moduler area.
    if you foolow the above specified way u can achive your requerment.
    Revert back if you any quaries.
    Thanks & Regards,
    bhargava.

  • Enhancements / Modifications in Web Dynpro Java

    Hi, all!
    I' ve a more general question: Are there any enhancement concepts for Web Dynpro Java available or at least planned that would give developers the same comfort and possibilities ABAP programmers have?
    I mean, will there ever be an Enhancement Framework like in ABAP - modification free enhancements via BADIs or customer exits?
    Think of one of SAPs WDJ flagship - the ESS/MSS. If you want to change anything within, you have no other possibility but to modify the sources. Considering this - together with the weak possibilities of backend access via JCo - I give the WDJ not a chance to stand the challenge of WD4A.
    Regards,
    Thomas

    Hi!
    I' m just going through the hep-pages, but what I can definitly say by now is that there' s no enhancement-concept in sight. This matter is getting kind of really embarrassing and leaves the question open: What the heck should an SAP customer persuade to focus on Java Development? No enhancements, no direct data access, no easy debugging possibilities like in ABAP.
    I' ve started with WDJ, but digging deeper into WD4A I' m getting more and more convinced that the whole Java thing was just something like a playground field for the development of the programming model and is now getting more and more obsolete with the rising of WD4A.
    Correct me, if I' m wrong, and forgive me, if I' m flaming, but when I started with Java development in SAP enviroment I was quite enthusiastic and didn' t understand resentiments of the ABAP developers against our programming language, but now I' m more and more joining their opinion.
    Regards,
    Thomas
    PS: I' ve - by the way - done the SAP Java Certification and am already regretting it.

  • ALV table in Web dynpro java

    Hello Experts,
    I have a task to migrate the usage of UI element IWDtable to ALV Table in my application for some features like Sorting and filtering supported in ALV table.
    I searched in Google and SDN about the ALV table, could not find any document about ALV table in Java (Found docs only with ABAP).
    Is ALV table supported in Web dynpro java ? If yes, please pass me the URL for the basics of ALV table.
    Thanks in Advance,
    Regards,
    Harish

    Hello,
    I understand from previous posts in this thread, that the ALV is not yet available for use within WebDynpro. Although it is already documented in the NWDS documentation under:
    SAP NetWeaver CE Developer Studio Documentation > Developer's Guide > Developing and Composing Applications > Developing User Interfaces with Web Dynpro for Java > Reference > UI Element Guide > Tables and Lists > Displaying Lists with SAP List Viewer > Integrating SAP List Viewer into Applications
    Since it is listed under "Developing User Interfaces with Web Dynpro for Java" I would assume that is should be possible. We are on NW CE 7.1 SP5.
    I tried to get a test application running based on the documentation, but the documentation is too thin and I run into an Null-Pointer exception in a SAP class called:
    at com.sap.ip.bi.alv.rendering.ALVGraphicsRenderer.init(ALVGraphicsRenderer.java:117)
    If it is not yet released for use then I wonder why it is already part of the documentation ?
    Take care
       Ingo

  • Display sapscript form in Web Dynpro Java

    Hi,
    Is it possible to print an existing sapscript form i.e. PO from ECC to my Web Dynpro application? I have successfully created a Web Dynpro Java application to create POs but now have a requirement to display or print the PO?
    Can someone provide me with a sample code? I'm hoping to be able to do this without using Adobe.
    Again, thanks for all your help.
    Best regards,
    Jaypee

    Hi mark,
    Without Adobe also u can display PO order.
    Below is the code to open a HTML window from WDJava, with data from WDJava...
    Inside DoInit()
    IWDAttributeInfo attr1 =
    wdContext.getNodeInfo().getAttribute("htmlfile");
    ISimpleTypeModifiable mtype1 = attr1.getModifiableSimpleType();
    IWDModifiableBinaryType btype1 = (IWDModifiableBinaryType) mtype1;
    btype.setFileName(attr.getName() + ".html");
    btype.setMimeType(WDWebResourceType.HTML);
    _contentType = mtype;
    Where htmlfile is a context attribute of type binary... and do a global declaration like this
    ISimpleTypeModifiable _contentType = null; (This declaration can be done at the end of your view's coding between Begin Others and End Others)
    Now,
    inside on action print
    public void onActionPrintData(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent, java.lang.String videoName )
    //@@begin onActiondisplayVideo(ServerEvent)
    byte[] content = new byte4028;
    try {
    content = this.displayPrint().getBytes("UTF-8");
    wdContext.currentContextElement().setHtmlfile(content);
    wdContext.currentPrintElement().setAttrUrl(
    _contentType.format(content));
    //Where content is loaded with data from displayPrint() method, which is holding the HTML *page to be displayed to the user *
    IWDWindow win =
    wdThis
    .wdGetAPI()
    .getComponent()
    .getWindowManager()
    .createNonModalExternalWindow(WDWebResource
    .getWebResource(content, WDWebResourceType.HTML)
    .getURL(),"ShowVideo");
    win.setWindowSize(445,460);
    win.removeWindowFeature(WDWindowFeature.ADDRESS_BAR);
    win.removeWindowFeature(WDWindowFeature.TOOL_BAR);
    win.removeWindowFeature(WDWindowFeature.MENU_BAR);
    //win.open();
    win.show();
    // wdComponentAPI.getMessageManager().reportSuccess("444444444444");
    } catch (Exception e) {
    wdComponentAPI.getMessageManager().reportException ("Unable to open window"+e,false);
    //@@end
    Now finally, design your HTML Page inside the method displayPrint() like this
    public java.lang.String displayPrint( java.lang.String strVideoName )
    //@@begin displayPrint()
    String htmlcontent=null;
    htmlcontent="content what you want to show in print window";
    use script inside the html content to do a print... like window.print();
    return htmlcontent;
    //@@end
    Regards,
    Sunaina Reddy T

  • Problems with Adobe PDF forms in Web Dynpro Java

    As of now , I have two major issues in developing Adobe PDF forms in Web Dynpro Java .
    1.Text getting wrapped and repeated from the first line :
    Any text field that flows to the next page gets wrapped at the end of the page and is again printed on the next page beginning from the first line .
    For eg:
    If I have 4 lines in a text field that is at the end of the page
    1111111111111111111111
    2222222222222222222222
    3333333333333333333333
    4444444444444444444444
    and the page holds space for only two lines it prints the lines
    1111111111111111111111
    2222222222222222222222
    in the first page and then proceeds to the next page and prints
    1111111111111111111111
    2222222222222222222222
    rather than printing
    3333333333333333333333
    4444444444444444444444
    2.No way to hide a page at runtime:
    It is not possible to hide a page in a PDF form at runtime . If scripting is used , the page turns into a blank page but not hidden .
    Any pointers on this????????
    Helpful answers will be suitably rewarded with points!!!!

    Yes,I am using the versions that you mentioned.
    I have a node called <b>MasterData</b> which is the root node for my PDF Form.I have a node called <b>GenData</b> inside this node whose <b>ctx_Appraisal_Type_Num</b> attribute is bound to a hidden TextField in my form.In the <b>docReady</b> event of this TextField, I am writing the following FormCalc script to hide my SubForm whose Id is <b>MngrCmptnc</b>
    if(MasterData.GenData.ctx_Appraisal_Type_Num == "2")
    then
    MasterData.MngrCmptnc.presence = "visible"
    MasterData.MngrCmptnc.MngrCmptnc.presence = "visible"
    MasterData.StrImp.presence = "visible"
    else
    MasterData.MngrCmptnc.presence = "hidden"
    MasterData.MngrCmptnc.MngrCmptnc.presence = "hidden"
    MasterData.StrImp.presence = "hidden"
    endif

  • Reading and displaying Ms.Word document with web dynpro java

    Hi,
    I'm using NetWever developer studio 7..0.21.
    I'm developing web dynpro java application.I'm in difficulty to read and display word document with its original format in web dynpro view. Is it possible?
    If possible , is there a blog etc.?
    Thanks.

    Hello,
    You have to use the Office Integration Library. Please, follow the documentation below:
    http://help.sap.com/saphelp_nw04/helpdata/en/c3/32853febec3c17e10000000a114084/frameset.htm
    I hope this helps you.
    Regards,
    Blanca

  • Migrating from web dynpro java app  nwds 7.0 to nwds 7.3

    Hi,
    is it possible to migrate web dynpro java app developed in nwds 7.0 to nwds 7.3 environment.
    I tried but lots of problem.
    Is there a blog?
    Regards.

    Cemil
    its very much possible to migrate the component to 7,3 platform. SAP NWDS 7,3 provides a migration wizard to help with the migration, after that you need to do some manual adjustments, like changing the deprecated APIs, fixing JAR dependency etc etc..
    Here is a guide on how to do it step by step
    http://help.sap.com/saphelp_nw73/helpdata/en/e9/546e60777641509a5e0dc5cd05675b/frameset.htm
    Hope this helps...

Maybe you are looking for

  • Error message from a BAD PDF

    I am using Adobe Reader to render PDF documents as a part of a process and then convert it into TIFF. Some of the documents that come in are corrupt PDF documents and cannot render itself in the reader and hence cannot be converted. This is the error

  • Issue with PO Response in SRM 7.0

    Hi Experts, We have upgraded our system from SRM 4.0 to 7.0. Post upgrade we are facing an issue with PO Response document. Scenario:          When the PO is ordred, Vendor sends a the PO response through XML. Our middleware call the an FM which uses

  • Work around for 60 column limitation

    All, Does anyone know of a work around for the 60 column table limitation? Will this be changed in a future release? Thank you.

  • IMovie to iPod - what is the highest resolution setting possible?

    I'm creating an iMovie and i want to save it to my 30gb video ipod, and then play it back on a lcd projector to a 12 foot screen (for a presentation in a room full of people). If i use the standard 320x240 resolution, i'm pretty sure it will look ver

  • Accessing a file and more.

    Hi, I have an encrypted text file. I need to do the following things within my program to make it useful. 1. Read the rather large 3.2MB file. 2. Decrypt the file, it is a simple translation of A = F, B = O etc. 3. Put each word into an ArrayList<Str