How to do Printing in Java Web Dynpro?

Hi,
I have displayed a window in Java Web Dynro of some user data.
And I want to add a Print button so that the user can print the information.
I do not want to use Adobe PDF for such printing.
Can I achieve what I want through coding in Java in Web Dynpro?
Thanks.

Hi myke,
      firstly you want to create some method in view,
      create one value attribute like HtmlFile --dat type should be binary
       HtmlFile=bynary..
public java.lang.String displayPrint( )
    //@@begin displayPrint()
    StringBuffer htmlcontent=new StringBuffer();
     htmlcontent.append("<html><body>");
     htmlcontent.append("<input type=\"text\" name=\"su\" >");
     htmlcontent.append("<input type=\"text\" name=\"se\" >");
     htmlcontent.append("<input type=\"submit\" name=\"sre\" >");
     htmlcontent.append("</html></body>");
          return htmlcontent.toString();
    //@@end
create one button like..Print.
action name is-
public void onActionprint(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )
     byte[] content = new byte[4028];
          try {
          content = this.displayPrint().getBytes("UTF-8");
          //HtmlFile==binary
          wdContext.currentContextElement().setHtmlFile(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();
          } catch (Exception e) {
          wdComponentAPI.getMessageManager().reportException ("Unable to open        window"+e,false);
thanks
jati

Similar Messages

  • How to open print dialog from web dynpro abap application

    Hi experts,
            I have a web dynpro application with several views and onone of the view there is a button that should open print dialog with printers list and all other options (standard print dialog we see in windows). I did reserach on SDN and came to now that this is a limitation of web dynpro abap. I did find some code also but unfortunately our current version of ABAP(7.0) do not support the code I found. I am not able to find any proper solution for this. Could someone please let me know how I can open a print dialog by clicking on a button in web dynpro abap? Any sample code or any information would be greatky appreciated.
    Thanks.
    Mithun

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

  • R/3 search helps in java web dynpro

    Hello,
    A customer of ours has some Z transactions in its R/3 system, which basically present a very simplyfied version of MIGO. This Z transaction makes extencive use of Search Helps, which in some cases have been extended.
    A ABAP developer with some  Web Dynpro experience showed me that it was easy to integrate these search helps into his web dynpro application.
    I cannot find how to do this in java web dynpro with the developer studio. Is this possible and if yes, how?
    Greetings, Walter.

    Hi Walter,
                  You can use search helps in Web Dynpro for Java also. The feilds with check table in R/3 automatically give search helps. To provide explicit search help you need use EVS or OVS.
    These are the tutorials
    OVS https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/webdynpro/wd%20java/wd%20tutorials/web%20dynpro%20valuehelp%20using%20object%20value%20selector.pdf
    Value help
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/webdynpro/wd%20java/wd%20tutorials/value%20help%20in%20web%20dynpro%20applications.pdf
    EVS
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/f0e57440-ec1c-2a10-36b1-fe92341f98c4
    regards,
    Siva

  • How to use EVS with different data in each row, in a Java Web Dynpro table?

    Hi all,
    I am using EVS in a column of java web dynpro table.
    Let's say the name, and context attribute, of this column is column1.
    It's filled dynamically using an RFC, that uses as input parameter the value of another column, and related context attribute, from the same table (Let's call it column2).  Obviously, from the same row. So, in other words: the values of the EVS in column1 of row1, are dependent of the value of column2 of row1. And the values of the EVS in column1 of row2, are dependent of the value of column2 of row2. And so on... Hope i could explain myself ok.
    The code I'm using works great for filling the EVS dynamically:
    IWDAttributeInfo attrInfo = wdContext.nodeDetail().getNodeInfo().getAttribute(nodeElement.COLUMN1);
    ISimpleTypeModifiable siType = attrInfo.getModifiableSimpleType();
    IModifiableSimpleValueSet<String> value = siType.getSVServices().getModifiableSimpleValueSet();
    value.clear();
    if(this.initRFC_Input(nodeElement.getColumn2())){
         for (int i = 0; i < wdContext.nodeRFCresult().size(); i++){
              value.put(wdContext.nodeRFCresult().getRFCresultElementAt(i).getLgort()
                 , wdContext.nodeRFCresult().getRFCresultElementAt(i).getLgobe());
    In this code, nodeElement is the context row of the table that is passed dynamically to the method when the value of colum2 is changed.
    HOWEVER, the problem I'm having is that after executing this code, EACH NEW ROW that is added to the table has by default the same values as the first row, in the column1 EVS. And, for example, if I refresh the values of the column1 EVS in row 2, all EVS values in the other rows are also refreshed with the same values as the ones of EVS in row 2.
    How can I make sure each row EVS has its own set of independent values, so they don't mess with each other?
    Hope you guys can help me. And please, let me know if I didn't explain myself correctly!
    Thanks!

    I just did as you said (I think), but it's still having the same behaviour as before (same data for all EVS in the table).
    Here´s what I did:
    I
    In node "Detail" (cardinality 0...n, singleton set to true), which is binded to the table, I created a child node named "Column1Values" wth cardinality 1...1 and singleton set to false.
    "Column1Values" node has an attribute called "column1", of type String.
    I did the binding between attribute "column1" and the column1 inputfield celleditor in the table.
    I created an event called Column2Changed and binded it to the column2 celleditor of the table. I added a parameter called nodeElement of type IPrivateCompView.IDetailElement to this event, and mapped it to the column2 editor in the table so that I can dynamically get the nodeElement that is being affected.
    I added the following code to the onActionColumn2Changed(wdEvent, nodeElement) method that gets created in the view:
    IWDAttributeInfo attrInfo = nodeElement.nodeColumn1Values().getNodeInfo().getAttribute("column1");
    ISimpleTypeModifiable siType = attrInfo.getModifiableSimpleType();
    IModifiableSimpleValueSet<String> value = siType.getSVServices().getModifiableSimpleValueSet();
    if(this.initRFC_Input(nodeElement.getColumn2())){
         for(int i =0; i < wdContext.nodeRFCresults().size(); i++){
              value.put(wdContext.nodeRFCresults().getRFCresultsElementAt(i).getId(),
                                  wdContext.nodeRFCresults().getRFCresultsElementAt(i).getDesc());
    And with this, I still get the original problem... When the EVS of one row is updated, ALL other EVS of the table get also updated with the same values.
    What am I missing? Sorry Govardan, I bet I'm not seeing something really obvious... hopefully you can point me in the right direction.
    Thanks!

  • How to create table in interactive form via Java Web Dynpro

    Hi,
    How to create table in interactive form via Java Web Dynpro ?
    Any online tutorial / example ?
    Thank you.
    Regards,
    Eric

    Hi Eric,
    Just choose the UI element Table from Form Library and drag and drop it on the form. now choose the no. of rows and columns and other settings you want about table from the wizard initiated through this process. This all is what you have to do to create the table. Now to bind it to the fields of the data source bind the individual colums to individual attributes of the node in the datasource.
    Hope it will solve your query.
    Regards,
    Vaibhav Tiwari.

  • How to consume the Abap web service in Java web-dynpro

    Hi Everyone,
    I want to consume ABAP web service in java web dynpro.
    so when i tried to create model in java web-dynpro, it gave me an error message saying "Invalid WSDL or WSDL not found".
    i think this error message is because, to access the WSDL of abap web-service, we need username and password, but the dialog box in java web-dynpro is not programmed to take username and password from us and send it to the server to get the WSDL.
    i came to this conclusion because i was able to successfully test my abap web-service in java portal. the java portal asked me the username and password to open the WSDL.
    So, please help me to consume the abap web service in java web-dynpro.
    Thanks in advance
    Regards
    Vikas

    Hi Vikas ,
       while creating a model in web-dynpro try to use the "import web service model" option and if you are using local server choose the local server option so that you can get the available web services which are in server, select one among them and continue you process.I think this is the some what easy way .
    If you want use the URL for wsdl better to once test the available service in server and copy that WSDL URL and paste over  WSDL textbox.
    I think this is pretty help ful to you
    Best Regards
    Srikatnh

  • Append Data from Java Web Dynpro to an Internal Table in ECC

    Hi,
    Currently I am using AdaptiveRFCModels to creating/updating records from Java Web Dynbpro to FM in R/3. Users can add few records before they save the changes. The current design is Java Web Dynpro call RFC FM when user add/edit one record. The record will store in an global internal table in the Function Group. For example, I have added 3 records before I save the changes. It means that global internal table should have 3 records that I added before I save it. But in fact, the global internal table only store one record while I adding the third record. The global internal table not able to keep the previous records. The code below is how I code to execute the FM from Java Webdynpro. Is the code can work as I expected? Anything missing in the codes? Please advice. Thanks.
    wdContext.nodeZhr_abc_Input().bind((Zhr_abc_Input) model.createModelObject(Zhr_abc_Input.class));
    Zhr_abc_Input objReq = new Zhr_abc_Input();
    Zhr_Pad31 insUpdVer = new Zhr_Pad31();
    insUpdVer.setQ_Id(wdContext.currentContextElement().getQ_Id());
    insUpdVer.setZ_ce(wdContext.currentZhr_Detail_OutputElement().getZ_ce());
    objReq.addLt_Pad88(insUpdVer);
    wdContext.nodeZhr_abc_Input().bind(objReq);
    wdContext.currentZhr_abc_InputElement().modelObject().execute();

    According to your code you are setting only one record.
    You have to create 3 elements for each record and add all the three to the nodeZhr_abc_Input node.
    If I understand correctly, node currentZhr_Detail_Output is the one which is containing all the three records. Loop through this node, pick each record and set to the input node.
    wdContext.nodeZhr_abc_Input().bind((Zhr_abc_Input) model.createModelObject(Zhr_abc_Input.class));
    for(int i=0;i<wdContext.nodeZhr_Detail_Output().size();i++)
    Zhr_abc_Input objReq = new Zhr_abc_Input();
    Zhr_Pad31 insUpdVer = new Zhr_Pad31();
    insUpdVer.setQ_Id(wdContext.currentContextElement().getQ_Id());
    insUpdVer.setZ_ce(wdContext.nodeZhr_Detail_Output().getElementAt(i).getZ_ce());
    objReq.addLt_Pad88(insUpdVer);
    wdContext.nodeZhr_abc_Input().addElement(objReq); // Changed from bind to addElement
    }//for end
    wdContext.currentZhr_abc_InputElement().modelObject().execute();
    Note: I just typed the code. Syntax might be wrong here and there. Please correct it while coding.
    Regards,
    Jaya.

  • How to put water mark in web dynpro abap Adobe forms

    Hi
    Can any body tell me how to put water mark in web dynpro Abap adobe forms ,
    actually I need to print water mark as back ground in gray color.
    Points will be rewarded of Helpful answer..!
    Regards,
    Sidram

    Hi,
    for more information about layout options in forms, go to your form in transaction SFP, layout view and choose Help -> Adobe LifeCycle Designer Help. There you find information on page layout, e.g. " Objects can be placed anywhere on a master page, inside or outside the content area. As a general rule, do not place objects inside the content area unless your intention is to have other objects laid down on top of the master page objects when the form is rendered. If you are setting up a watermark, place it inside the content area. "
    Besides, there's an Adobe forum where you might get more information for such Adobe questions.
    Regards, Heidi

  • Deploy Java Web Dynpro to the portal

    Hi Gurus,
    I've done a simple java web dynpro in my local PC. How do I deploy it to the portal? Thanks!
    Best regards,
    Anthony

    Hi,
    Please go through this article to know how to deploy webdynpro applications in the portal
    https://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/40d983b4-bfc2-2b10-858f-b717e194f2c1
    Regards,
    Gayathri

  • Call smartforms via java web dynpro

    Hi,
    We was created payslip in R3 smartforms in PDF format. How can I call the PDF file from java web dynpro?
    Regards,
    Eric

    Hi,
       Check [this|http://****************/Tutorials/Smartforms/SFinEPasPDF/Page1.htm] link.
    Regards,
    Satyajit.

  • How to kick off workflow from Web Dynpro?

    Hi,
    I have abap experience but haven't used workflow before. I have to kick off a workflow from a java web dynpro.
    I think that I need to set up a business object and an event within this object, as step one. I then go to Status Management in the Business Workflow as I need to establish a relationship between the web dynpro and my event, step two.
    The question is, what Status Object type do I use in this Status Management? For example if I was releasing a production order I could set this to ORH.
    Any advice greatly appreciated.
    Regards,
    Warren.

    Hello Warrenabap,
    Do you know how to send (or modify) the container values from a workflow ??

  • Settings SLD and JCO connection for Java Web Dynpro

    Hi BI Gurus,
    I'm a Business Intelligence newbye and I'm a bit confused about Web Dynpro configurations.
    I try to execute, through Netweaver Developer Studio 7, a simple java Web Dynpro who call the standard Flight List BAPI.
    My configuration is: NW 2004s installed on BI server (with java instance and j2EE Server) and Flight List BAPI stored on R/3 ECC. 5 System in another server.
    Now, my doubt are:
    1) in SLD Data Supplier (J2EE Visual Admin on BI Server) CIM configuration, what are the connections parameter necessary?The BI host or R/3 host?
    2)if I set BW system parameters in SLD and in NWDS when I try to run my simple web dynpro an error occour This is the output:
    The initial exception that caused the request to fail, was:
       com.sap.tc.webdynpro.services.exceptions.WDRuntimeException: Failed to resolve JCO destination name 'WD_FLIGHTLIST_RFC_METADATA_DEST' in the SLD. No such JCO destination is defined in the SLD.
    Correction Hints
    Accessing the System Landsape Directory (SLD) failed. Depending on the concrete reason (see root cause) check the following:
    is the SLD Supplier in the J2EE engine configured correctly? See the SLD documentation for more details about the SLD and about how to configure it.
    are all JCO destinations maintained correctly? Use the preinstalled Web Dynpro Content Admin application to check/edit the destination. Use the Ping and Test functions of the Content Admin to verify that each destination is properly configured.
    Additional information about the System Landscape Directory and the Web Dynpro Content Admin can be found in the SAP Developer Network (SDN) and in the Online Help for the SAP Web Application Server (installed with SAP NetWeaver Developer Studio and available online).
    Note: the above hints are only a guess. They are automatically derived from the exception that occurred and therefore can't be guaranteed to address the original problem in all cases.
    3)where can I create new JCO connections?What are the requirements settings?
    I am always available for answers about the post!!
    Help me please!!
    Thanks thousand and sorry for my incorrect english!!

    Andrea,
    You can Create the JCo destination from Content Administrator. You must login as Administrator.
    use the link as
    http://<server>:<port>/webdynpro/welcome/Welcome.jsp, select Content Administator->Create JCo Destinations/Maintain JCo Destinations.
    Please have a look on the following links regarding creating/maintaining JCo destinations. The are usally asked questions regarding JCo destinations.
    Create JCo destinations:
    /message/4947478#4947478 [original link is broken]
    Creating JCO Destinations
    /message/5369333#5369333 [original link is broken]
    Rgs,
        Dni

  • Java Web dynpro with ABAP Clients?

    Morning,
    We have a situation where we would like to use a Java Web dynpro with multiple ABAP backend data sources. This is for autorization as well as data. We are not using Enterprise Portal.
    We've created a pair of system Jcos and mapped them to the Web dynpro via the URL. This works and the correct data from the correct Client is retrieved depending on which pair of Jcos we define in the URL.
    The problem we are having is that we are only able to logon using the ABAP Client defined in the ume....master.client parameter.
    Is there a way to achieve this (again without EP) either in the system configuration or programatically in the web dynpro?
    tia
    Cheers,
    Mitch

    Hello,
    Thanks for the updates. Actually my query is we have a SCM 5.0 system which has a java stack in it. But now we are going to upgrade it  to SCM  7.0. -  Is SCM 7.0 has a java stack ?
    If it doesn't have , can we upgrade SCM 5.0 to  SCM 7.0 without Java Stack ? Is it posssible to upgrade without Java Stack or not ?
    Is it possible that  we can convert Java Stuff into ABAP web dyn pro ? If yes , how shall we can achieve it ? If not, how shall we proceed in an alternate way ?
    Thanks for your help  in advance.
    Madhu

  • Java Web DynPro and Universal Worklist Interaction

    HI ESS/MSS Gurus,
    Good day!
    I am a workflow consultant who is working on an ESS/MSS project. I have already completed and tested (successfully) all of the workflows needed in the backend using the PTARQ and PTCOR applications. We are also successful in showing the work items in the universal worklist.
    Now the question is, whenever we click on the work item, we encounter an error in the portal. Now, I need to determine the following:
    1. How are we going to integrate the ESS/MSS portal with the execution of the work item in the universal worklist?
    2. Do we need to develop custom Java web dynpro applications for the approval process of the leaves, or is there a standard offering from the ESS/MSS packages?
    Your inputs are very much welcome.
    Regards,

    Hi Gurus,
    Here is what we have done so far:
    1. Implemented the details as indicated in note 779075 and changed the parameters defined in SWFVISU
    2. Upon re-registering and clearing the cache from the UWL, we tested if the task will call the standard application for leave request approval. It returns the error Internal error. :
    Item is null for action acknowledge, and for item type uwl
    It seems that the xmls files are not being generated or read successfully. although when we check uwl.webflow.SAP_ECC_HumanResources, there is an updated xml file for the task
    Questions are:
    1. What checks do we need to execute between the back end, UWL and portal?
    2. Whenever changes in SWFVISU are made, what items do we need to check to ensure that the changes are reflected in the UWL? I have read that SWFVISU helps the user do away with the tedious xml creation. How can we verify that the changes are implemented/updated in the xmls generated?
    3. Any other items we need to look into?
    Regards,

  • How do I connect my netweaver web dynpro

    How do I connect my netweaver web dynpro to the portal? how do i arrange the iviews? how do i add the iviews?

    hi,
    You can create webdynpro iviews in portal in two ways. 
    1) from iview template &
    2) from webdynpro java applications.
    If you create from the 1st one, you have to provide two parameters of the  webdynpro application.
    i) namespace
    ii) application name
    you can find these namespace & application name from content admin --> webdynpro --> open your webdynpro project > open the application. you will find two columns.
    left side name is the namespace (eg: local/firstproject) & right side you will find application name.
    If you create iview from 2nd menthod, the following is the link contains creation of webdynpro iview.
    [https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/0c7b2f25-0c01-0010-f2a2-f8a65a9dcad9]
    hope this helps you
    regards,
    vv.

Maybe you are looking for

  • Windows XP PC can't see shared files on Mac

    Our Mac Pro running OS X 10.5.8 can access all the shared folders on our Windows XP PC. In addition, all our other Macs can access the shared folders on our Mac Pro. However - the XP PC cannot access any shared folders on the Mac Pro! Any ideas how t

  • HTTP Code:503

    Hi, My scenario is file->XI->Mail. yesterday it was running perfectly. Now it is giving following System error: <SAP:Category>XIServer</SAP:Category>   <SAP:Code area="INTERNAL">HTTP_RESP_STATUS_CODE_NOT_OK</SAP:Code>   <SAP:P1>503</SAP:P1>   <SAP:P2

  • Thai characters not supported in SQL window

    Hi, The version of my PL/SQL Developer is 7.0.1.1066. We have created a database with UTF-8 format to support multi languages. When we used Chinese language we are able to query.. TABLE 1 Name RollNo Class chinese name 12 10 When we put the query tab

  • Deleted video files still take up disk space

    Hey guys! I'm using a 13-inch rMBP, late 2013, running OS X 10.10.1. Yesterday I deleted more than 40GB of video files from my "Movies" folder, and emptied the trash can. However, the 40GB of disk space didn't appear as available. I looked online and

  • Mac doesn't open

    Hello guys i have a problem.i was working on my mac(mavericks) and it was''stucked''after while and then i tried to turn it off but i couldnt.so i turned it off using power button.when i tried to open it again,it makes the sturt up button,shows the g