HTML view in Web Dynpro

Hello everybody,
   I'm developing an application and i need to display a html page inside a view.
   I'm developing in SAP NetWeaver Developer Studio, Version: 7.1.0 and UI element like iFrame, or IView does not exists.
   Do you have a suggestion, idea or advice?
Thank you,
Constantin

Hi Constantin,
For writing Html in iFrame u can use com.lowagie.text package and u can use these inbuild classes.
com.lowagie.text.BadElementException;
com.lowagie.text.Cell;
com.lowagie.text.Chunk;
com.lowagie.text.Document;
com.lowagie.text.DocumentException;
com.lowagie.text.Element;
com.lowagie.text.Image;
com.lowagie.text.Paragraph;
com.lowagie.text.Table;
com.lowagie.text.html.HtmlWriter;
com.lowagie.text.rtf.style.RtfFont;
first u have to create a method
like this
private void <method name>() {
          try {
               String filename = this.<name/id> + ".html";
               IPrivateView.IContextElement elem =
                    wdContext.createContextElement();
               elem.setRTFOutPut(getBytesFromFile(new File(filename)));
               final IWDCachedWebResource resource =
                    WDWebResource.getWebResource(
                         elem.getRTFOutPut(),
                         WDWebResourceType.HTML);
               //resource.setResourceName("HTML_inline.html"); original
               resource.setResourceName("HTML_inline"this.<name/id>".html"); 
               resource.setAttachement(false);
               resource.setReadOnce(false);
               wdContext.currentContextElement().setUrl(resource.getAbsoluteURL());
          } catch (WDURLException e) {
               logger.errorT(e.getMessage());
               wdThis.wdGetPortfolioMessagesInterface().reportError(
                    "<custom message",
                    <Parameters>,
                    true);
               //wdComponentAPI.getMessageManager().reportException(new WDNonFatalException(e), false);
               //e.printStackTrace();
than for writing in iframe create a method like this.
private void generateIframe() {
          String newLine = "";
          Document doc = new Document();
          String filename = this.<name/id> + ".html";
          HtmlWriter html = null;
          try {
               RtfFont rtffontN = new RtfFont(FONT, FONT_SIZE, RtfFont.NORMAL);
               RtfFont rtffont = new RtfFont(FONT, FONT_SIZE, RtfFont.BOLD);
               RtfFont headfont = new RtfFont(FONT, 12, RtfFont.BOLD);
               DataOutputStream ds =
                    new DataOutputStream(new ByteArrayOutputStream());
               ds = new DataOutputStream(new FileOutputStream(filename));
               html = HtmlWriter.getInstance(doc, ds);
               //html = HtmlWriter.getInstance(doc,new FileOutputStream(filename));
               doc.open();
//now here u can use the classes like Cell ,table,Document for writing the html code in the iFRAME .for more information on this u can refer this site all the api documentation is given here.
http://itext.ugent.be/library/api/
after writing the html code using com.lowagie.text package.
at the end call the method which u declared earlier to this method.and create a context element URL map it to the source of Iframe in properties view.
Please Reward points for an helpfull answer.
Regards,
Siddharth jain.

Similar Messages

  • Font size of text view in Web Dynpro ABAP

    Hi Experts,
    How to increase the font size of a text view in Web Dynpro layout. I have tried the 'Design' property of the text view and made it 'Group Title', But i want even bigger font size.
    Pls suggest.
    Thanks,

    >
    Naresh Kumar Malik wrote:
    > Hi
    >
    >
    >
    >
    > You can use <h1> HTML tag. Here
    > concatenate   '<h1>'  item_eform_reqno '</h1>' into head.
    >   wd_context->set_attribute( exporting name = 'EFORM_HEAD' value = head ).
    >
    >
    > Here attribute EFORM_HEAD is bounded to the text view element.
    >
    > Regards
    > Naresh
    This should NOT work!  The UI elements should safe encode all input values - thereby eliminating the value of any HTML tags. If you system isn't doing this already then it is a bug and if you rely on such a thing it will stop working at some point in the future.
    You are basically restricted to different values available via the design parameter.  The overall font sizes come from the underlying themes and the client applications (browser or NetWeaver Business Client) that host the Web Dynpro Application.  Therefore no direct specification of the font size is possible in order to stay within the controls of theme.  If you don't like any of the designs available, you might consider altering the Portal Theme you are using - but that is a rather drastic approach.

  • Add html code in web dynpro application

    Hi
    Is there a method to add HTML Code in web dynpro application so that it works same as HTML works in browser
    I have to add a clock in my application How can i do that
    Best regards
    Suresh

    If you're on NetWeaver CE or otherwise use Wb Dynpro for Java 7.2 or higher, you could use the WebWidget control, see http://help.sap.com/saphelp_nw73/helpdata/en/49/bfa3b2e55657bae10000000a42189d/frameset.htm
    Otherwise, I'm afraid your only option is to use an IWDIframe component in your WDJ project, embedding the HTML.. Be carefulo though, the IWDIframe component is deprecated (since each server roundtrip forced a reload of the IFrame it was pretty useless)
    Hope this helps!
    Best regards,
    Robin van het Hof

  • Problem in changing CAPTION (header) of a View in Web dynpro component

    Hi All,
    I want to change the Caption (header) text of a View in Web dynpro component. But when i transport it the changes are not reflecting in other systems.
    Also when i activate the Web dynpro component in development system, it issues a message "The text belongs to package $TMP". But the Web dynpro component is assigned to a custom package.
    Any pointers to resolve this is appreciated.
    Thanks in advance.
    Regards,
    Navin.

    Hi
    Please check the 'text' property of the caption.
    e.g : If you are using OTR to bind the text then it might be possible that the OTR text belongs to $TMP package.
    Please explain how have you binded the caption ?
    Regards,
    Puneet

  • Display HTML stream in Web Dynpro application

    Hello,
    Sorry, I am new to the Web Dynpro environment, so this might seem like a stupid question.
    How can I display streaming HTML content in a Web Dynpro application.  The IFrame element only seems to allow you to point to a URL.  In this case, I am receiving an HTML stream back from an R/3 system via a BAPI call.
    Thanks very much.

    Hi
    As per your question, I understand that HTML output is getting generated through a R3- Bapi call. Fine, create a model with the data binding to the context to some text view. Simply create view with the relevant UI element through which you want to exhibit the data and call the R3 call through your model. instead of a HTML output, you will get your data in the view.
    you may not get the exact format / style of the html output.
    Otherwise, directly HTML content cannot be shown in webdynpro. You need to have some UI control to take its content.
    Or else, you can go in for j2ee stack and end up with a java based appl, use a simple jsp and get the output!
    if you have any specific queries do let us know
    hope this helps you
    thanks

  • Best place to begin design of old HTML pages with Web Dynpro

    I am new to web dynpro (and the Netweaver environment).  I just took the EP150 course so I have an idea of how to create pages with both Visual Composer (although I doubt I'll use that much) and in java projects in NWDS. 
    My first application is to be an online purchase requisition application to replace one written in Lotus Domino (this will NOT be integrated with R/3- we will have a seperate DB for these documents outside of R/3).  I have taken the HTML main page from that application and coded it as a JSP but I am getting the impression that the overall design/coding may be simpler if I do the project as a web dynpro.  I want to find some sort of a primer that describes the various controls that go on the web dynpro view in order to figure out how I can take my HTML design and bring it into a web dynpro project.  Can anyone point me to a resource that does this?  I've checked the help and SDN and not found anything that is too helpful yet.
    Can anyone tell me if it would be worthwhile for me to attend the JA310 Web Dynpro course?  I have done a couple of the tutorials posted on SDN for web dynpro but haven't done much else with it as of yet.
    Thanks.
    Dana

    I don't know such a migration guide, but here are some general remarks:
    The Web Dynpro programming model does not use tag-libs, markup, scripting etc. as you might have used in JSP or BSP applications.
    Instead, you create your view layout using the NWDS view designer (or the runtime API) and place UI elements like tables, input fields etc. inside containers.
    Containers have layouts (e.g. MatrixLayout, RowLayout, FlowLayout) and UI elements placed inside a container have layout data for setting individual layout constraints. This is similar to programming in non-Web frameworks like Java Foundation Classes (Swing).
    The UI elements get their data from the view controller context by data binding. There is a hierarchy of controllers (view, custom, component) and the corresponding controllers may be mapped, giving an automatic data flow through the controller hierarchy.
    The complete details of markup (e.g. HTML), client-side scripting, CSS etc. is provided by the client-specific framework part and the application is completely shielded from these technical details.
    This has the additional benefit that a Web Dynpro application can be run on completely different clients without change.
    Example: If tomorrow it will be hip to run your business application inside some other UI technology, e.g. Adobe Flex, SAP will provide a new Web Dynpro client and all Web Dynpro applications will run without change inside this  environment. (Replace Adobe Flex by any other relevant framework).
    Compare this to a programming model, that directly uses HTML, Javascript etc. Good luck rewriting several thousand user interfaces!
    So in your concrete use case, look at your UIs from such a perspective and identify the Web Dynpro concepts. This should help in the migration process.
    Armin

  • How to use data from standard view in Web dynpro for ABAP

    Hello:
    I have to create an Abap Web Dynpro, and I must use data from a standard view in the new one. Does anybody know what do I have to do?
    Thank you and have a happy new year.

    Hi Rodrigo,
    Firstly, list the Standard component under Component Usage of the Component which you are creating in your View.
    Second, In the Custom Component, view, goto context, and try to add the node from the Standard component in to your view.
    NOTE: The second step requires a Node in component controller of the Standard Component.
    Finally, Now in your view, get the data from that and map the data.
    NOTE: To do this, I think you need to call your Standard WDA first and then only your node contains data and it will be passed.
    I hope it is helpful.
    Regards,
    Shashikanth. D

  • Pop up view in Web Dynpro for ABAP

    Hi,
    I am new in web dynpro for ABAP. Now I am facing a problem of how to make a view pop up.
    Since I had already create some table in this view. I just want to make it pop up after I click a button. But I had no idea to do it, could anyone tell me how to do it?
    Thanks!
    Edmond

    Hi Ho,
    For POp up view please follow the below steps.
    1. Create one view [Ex:popup_view] and design it as per your requirement.
    2. Create one window [Ex:popup_win] and embed the popview_view into pop up window.
    3. Then write the below code when ever you need a pop up window.
    data: l_cmp_api           type ref to if_wd_component,
            l_window_manager    type ref to if_wd_window_manager.
    l_cmp_api           = wd_comp_controller->wd_get_api( ).
      l_window_manager    = l_cmp_api->get_window_manager( ).
      if wd_this->m_popup1_1 is initial.
        wd_this->m_popup1_1 = l_window_manager->create_window(
                 window_name  = 'POPUP_WINDOW'
                 button_kind  = if_wd_window=>co_buttons_ok
                 message_type = if_wd_window=>CO_MSG_TYPE_STOPP ).
      endif.
      wd_this->m_popup1_1->open( ).
    Thanks.

  • Reading HTML Content using Web Dynpro ABAP

    Hello,
    I was wondering if it is possible to read the content (HTML) behind a given URL using Web Dynpro ABAP.  If so, are there any functions available to parse the HTML ?   I have been asked to develop an application that requires going to a URL, reading the content, and formatting a table from that content for presentaion within Web Dynpro ABAP.  The HTML of the URL is nothing more than a "Table of Contents" to existing documentation ( Word Documents )
    Thank you for any help / advice you can provide
    Larry

    You can get the HTML returned in a table using fm RSFO_HTML_REQUEST2.
    Once you have that, you can convert it to a string using any number of methods. CL_RSR_WWW_RENDERER=>TABLE_TO_STRING should work fine.
    One option for parsing it would be to get it converted into an iXML object, but you might have to do quite a bit of manipulation first depending on what the html looks like. You can see more info here on iXML classes: [http://help.sap.com/saphelp_nw04/helpdata/de/86/8280ba12d511d5991b00508b6b8b11/frameset.htm|http://help.sap.com/saphelp_nw04/helpdata/de/86/8280ba12d511d5991b00508b6b8b11/frameset.htm]
    Otherwise I would just make use of find statements with regex patterns to sort through the html.

  • HTML Template for Web Dynpro (ABAP)

    Hi Guys,
    I am developing a webpage in webdynpro abap.
    my requirement is to use a existing HTML(same as existing applications) template for this.
    how do i do that ?
    regards
    Siddharth

    You don't.  That isn't how Web Dynpro works.  The architecture is such that it abstracts the HTML/JavaScript rendering of the output.  You place a UI element on the screen and only a metadata reprsentation of the screen is created at design time.  At runtime different rendering engines can be applied to produce the final output.  This allows SAP to add new rendering engines and to improve the rendering engines over time without having to adjust the applicaitons itself. This makes Web Dynpro sutiable for producing Business Transactions, but not general web pages.  It also gives us the flexibility to render Web Dynpro in HTML/JavaScript, a desktop client (.Net 3.0 and WPF), and a RIA client (Adobe Flex).
    You can alter the theme of the WDA application when running in HTML rendering.  The theme gets automatically inherited from the NetWeaver Portal - or you can apply a stanalone theme when running without the portal.  Theming allows for some basic changes of color scheme and branding elements - but is not the same as applying a complete HTML template.

  • Access field of view in web dynpro

    Hi all,
    I'm developing a web dynpro.
    In a view I need to fill automatically a field when I press a button. I'm new in web dynpro and I don't know good the use of standard attriutes and methods of wd (like wdThis, wdContext, etc.)
    regards
    enzo

    Hi,
    please take a look at the <a href="https://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/sdn/developerareas/webdynpro?rid=/library/uuid/49f2ea90-0201-0010-ce8e-de18b94aee2d">tutorial section</a> here at SDN. This is a good starting point to learn WebDynpro.
    Regards
    Sebastian

  • How to add many lines in the Text View in Web Dynpro

    Hi friends,
    I have one Text Edit in Web Dynpro. I need to show the result of FM READ_TEXT in Text Edit View element, without lose the text format.
    Cardinality of my node is 0:n and attribute datatype is string_table. after assigning the values using bind_table method, I am getting only the first row of the read_text returns...
    By
    deva

    Hi Deva,
    Text View is not meant to be bound to string_table. Create a string instead and convert that string table into that string with
    <br>
    between each row of string table. TextView component will make <br> into new lines. Code will be similar to following.
    DATA: ROWS TYPE string_table,
          top type string,
          result type string.
          loop at rows into top.
            concatenate result top into result separated by '<br>'.
          endloop.
    Now bind this result string to the text view component. It ll work. Hope it will be helpful for you.
    Regards,
    Fareez

  • Unable to deploy composite view to Web Dynpro for VC 7.1 SP3

    I have a sandbox set up to explore VC 7.1 - currently using VC 7.0 extensively.  I am using a very simple composite view example with a bapi, input and output form.  The R/3 box is defined and the bapi test works fine. When XGL is selected as runtime, the example compiles with no errors.  When Web Dynpro is selected as runtime, the following error occurs: 
    An exception at the server while running the build process:  Extension with id com.spa.vc.runtimeproviders.null not found.  For more details please refer to this log file. 
    I have reviewed the log file and have not found any help.  I have tried several different examples and the same error occurs.

    Please ignore my issue.....I had selected incorrect option in EM console...
    thank you.

  • ESS/XSS Web Dynpro SCA import in CMS to view/modify Web Dynpro Source Code

    I am having problems importing ESS/XSS Web Dynpro related SCA's into CMS.
    Following steps were followed
    1. Download following files from SAP service marketplace.
    BPERP4ESS0_0-10003146.sca
    ESS09_0-10002965.zip ( This file shows as SCA in the download page but download as with .zip)
    PCUIGP009_0-20000568.zip ( This file shows as SCA in the download page but download as with .zip)
    Question: Is this correct, did I get all I need? Do I need to download any more files?
    2. Deployed above files using SDM.
    3. Created a product in SLD and defined software component dependencies(SAP_BUILDT, SAP_JTECHS, SAP-JEE) I could define any of the above files(BPERP4ESS0_0-10003146, ESS09_0-10002965,PCUIGP009_0-20000568) as software dependencies as I could find in the software catlog.
    Question: Should this files show up in the software catlog? If yes what should I do?
    4. Created a track in CMS.
    5. Added software components for development defined in the SLD. Above files doesn't show up under sap.com to be added as development component. I already copied BPERP4ESS0_0-10003146.sca, ESS09_0-10002965.zip,PCUIGP009_0-20000568.zip to D:\usr\sap\JTrans\CMS\inbox.
    Question: How do I add this files to development components??
    5. All other required Software Components(SAP_BUILDT, SAP_JTECHS) were automatically added when I added the development component.
    What should I do so ESS09_0-10002965.zip,PCUIGP009_0-20000568 would show up under sap.com vendor component list??
    Any help on this is greatly appericated.
    Thanks!!

    Hi,
    Did you receive a response to this question? We are having the same problems whilst following some instructions we received from SAP's OSS titled the JDI cookbook for ESS.
    When defining a track in the CMS the software components SAP_ESS and SAP_MSS are not in the list for vendor sap.com. Yet we use the standard ESS and MSS portal content delivered by SAP.
    How do we get these components in the list so that we can select them?
    Thanks in advance.

  • Including Html Pages in Web Dynpro java

    hello Experts,
    _i want to include html page in webDynpro java view so i need to know_
    1)where we need to include the html file
    2)should i creat it externally and then include
    3)or is there any specific place in project to include the HTML code.
    4)also can u tell how to include a vidio in html page i got some tutorial but with that its not working fine saying check specified path....
    <div style ="height:1500;width:1500 align=right">
    <video width="320" height="240" controls="controls">
    <source src="movie1.avi" type="video/avi" />
    <object data="movie1.avi">
    <embed src ="movie1.avi">
    </embed>
    </object>
    </video>
    Please HELP

    hi Prajakta Khobaragade,
       I was trying to include the html file in WDJ application which is developed in NWDS 7.1.but its show error,Kindly see the screen shot.

Maybe you are looking for

  • Trouble with Toshiba built-in webcam: "unable to enumerate USB device"

    I am running archlinux on a Toshiba Satellite L70-B-12H laptop, and having troubles with the Webcam. *Once in a while*, everything goes well and I get # lsusb Bus 004 Device 002: ID 8087:8000 Intel Corp. Bus 004 Device 001: ID 1d6b:0002 Linux Foundat

  • How to delete a perticular node from xml file using java code

    Hii All, Now i am trying to delete a perticular node from xml file.Like... XML file: <Licence> <SERVER> <was id="1">1</was> <was id="2">2</was> </SERVER> </LICENCE> I am working in messaging service using JABBER framework with whiteboard facility. He

  • Difference in the Receivables field in FD33 and FBl5n

    Hi friends, My ''receivables'' in FD33 is not matching with that of Fbl5n for one customer.  I have an amount of 240(over payment by the customer referencing the invoice doc) with DZ doc type sitting in FBL5n which is not showing up in fd33 for one c

  • Emails never arrive!

    Sometimes emails I send don't arrive. Is there some sort of filtering? I've sent the same content - nothing objectionable at all - 3 times in 3 different emails this morning, and my husband and daughter have never received. This has appened before, u

  • I can't print any of the forum pages as Adobe PDF

    I was in conflict over asking this question in Acrobat or in the Forum Comments forum, ultimately I decided to ask in Acrobat. Tried searching about this, but no luck. I'm trying to just print any one forum post as Adobe PDF - not via the View as PDF