Strange problem of Pdf downloading  with Web Dynpro

Hi, experts, I have to setup a project to realize pdf downloading with web dynpro. But unluckily, I have tried all the methods in this froum ,there's really strange problem .Because when I click the link of Download UI link, there's no reaction at all, I really don't know why.Below is the codes I used , can anyone help me ? thank you very much!
public void wdDoInit()
    //@@begin wdDoInit()
          IWDAttributeInfo attInfo =
               wdContext
                    .currentContextElement()
                    .node()
                    .getNodeInfo()
                    .getAttribute(
                    "Pdfsource");
          ISimpleTypeModifiable type = attInfo.getModifiableSimpleType();
          IWDModifiableBinaryType binaryType = (IWDModifiableBinaryType) type;
          binaryType.setFileName("test.pdf");
          binaryType.setMimeType(WDWebResourceType.PDF);
          try {
               int length =
                    (int) wdContext.currentPdfdownloadElement().getBin_Filesize();
               byte b[] = new byte[length];
               b = wdContext.currentPdfdownloadElement().getBin_File();
               wdContext.currentContextElement().setPdfsource(b);
          } catch (Exception ex) {
"Pdfsource" is the context value attribute of type binary.And Bin_File is the xstring type parameter from my RFC contains pdf content.
I used two views and one customer-controller . I put some value in the first view to set search condition.and the second then appears and have the download UI element. Are there any additional codes I should use? pls help!

Hi Hao,
Try this out
Suppose the file name is test.doc in c drive in server
create a context attribute filedata of binary type
bind it to data property
write the following code
try
   File input = new File("C:
test.doc");
   int length =(int)input.length();
   //Create a byte array b to hold the file
   byte b[] = new byte[length];
   FileInputStream in = new FileInputStream(input);
   //Reading the file to a byte array b
   in.read(b);            
   in.close();
   //Setting the data from the byte array to the context element.
   wdContext.currentContextElement().setfiledata(b);
catch(Exception ex)
  wdComponentAPI.getMessageManager().reportSuccess("Error in File 
  IO"+ex.toString());
// Structure information of the context attribute
IWDAttributeInfo attinfo = wdContext.getNodeInfo().getAttribute("filedata");
IWDModifiableBinaryType binaryType = (IWDModifiableBinaryType) attinfo.getModifiableSimpleType();
// Default File name which appears when opened on client machine
binaryType.setFileName("testing.doc");
//Explicitly setting the file type
binaryType.setMimeType(WDWebResourceType.DOC);

Similar Messages

  • Problems using Visual Composer with Web Dynpro runtime

    I am currently trying to build a Visual Composer iView and we need to use the Web Dynpro runtime rather than Flash because it needs to work with a screen reader for users with sight problems.  Which is a pity because Flash works fine. But when I use Web Dynpro runtime I'm getting the following problems:
    a) When I define fields and pushbuttons in forms where Align Contents is set to Absolute, they do not appear at runtime in the positions in which I've placed them - all form elements are aligned vertically.  The only other options are to align all fields vertically or align all fields horizontally.  This lack of flexibility makes it rather difficult to create a good screen design; the only option seems to be to create a separate form for each set of differently aligned fields, which leads on to the next problem.  . 
    b) When I define more than one form on a page, again at runtime the forms do not always appear in the positions in which I've placed them; the compiler seems to calculate how much space it needs to display the screen elements and then re-sizes and  re-positions the forms accordingly, ignoring what I've told it to do. 
    c) Toolbar pushbuttons do not appear on forms (they do appear on tables).  Irritating, but at least I can still create pushbuttons on the form itself. 
    There are other issues, but the main problems is that it appears that when I use VC with Web Dynpro I cannot trust the editor layout at all and the only way I can build something that looks decent is to fiddle about with  field / form sizes and positions, checking every change on the output, until hopefully I get it looking ok.  Having to do this will dramatically increase the time taken to develop VC applications.  Has anyone else experienced these problems with VC and Web Dynpro?  Has anyone managed to overcome them?

    Thanks, but neither of these describes the problems I've been having.  And they are misleading since they say that you can use VC with Web Dynpro only with Web Services ie not directly with BAPIs / RFCs, but using it with BAPIs / RFCs is one of the few things that works well in our system. 
    The most recent problem I've found is that if you make a form or table read-only it will stay read-only in Flash but the fields are editable in Web Dynpro.  The individual field disable option does work for Web Dynpro, but it turns the fields from black to a vey pale and almost invisible grey (this doesn't happen in Flash).  And you can't seem to change this. 
    It does seem to be a bit pathetic that input fields can't be made read only.  I've tried expression boxes, which are read-only anyway, but they appear in as pale a grey as the disabled input fields.  And although plain text fields can be added to tables, they are pretty useless since they can only hold a single value and so all the lines will contain the same value. 
    I guess I should resign myself to the fact that I am never going to be able to produce a decent screen using VC and Web Dynprp.

  • Problem in CAF- UI with web dynpro

    Hi all.
    I am creating a caf module . It has external service , entity and application service.
    after i have designed all these three i have created the web dynpro model.
    the model class has A , Q, P as suffix of  the classes . Whai is the meaning odofthis A , P amd Q .?
    also when i try to create an object of any of these after mapping it  gives an error -
    The <node> type cannot be instiantiated . What does this mean?
    i need to map a UI screen to an search query function of the application service
    and to call that serice on the click of button.
    please help me in this regard
    Thanks
    points asured for help

    Hi Anish,
    Thanks for your msil
    I have 2  different landscapes to work on .
    on one my caf project is working fine ,
    but it is throwing the linkage error  or also   at times java.lang.IncompatibleClassChangeError
    java.lang.IncompatibleClassChangeError
        at com.sap.recaf.services.recaf.userservice.UserServiceProxy.serviceModule(UserServiceProxy.java:20)
        at com.sap.recaf.services.recaf.userservice.UserServiceProxy.createCallbapiQuery(UserServiceProxy.java:43)
        at com.sap.test.user.User.wdDoInit(User.java:101)
        at com.sap.test.user.wdp.InternalUser.wdDoInit(InternalUser.java:224)
        at com.sap.tc.webdynpro.progmodel.generation.DelegatingComponent.doInit(DelegatingComponent.java:108)
        ... 28 more
    it gives the hint ---
    If the exception message indicates, that the modified class is part of the Web Dynpro Runtime (package com.sap.tc.webdynpro.*) then the running Web Dynpro Runtime is of a version that is not compatible with the Web Dynpro Designtime (Developer Studio or Component Build Server) which has been used to build + compile the application.
    I think the problem is of the config settings ,
    can u give any further suggestion?
    bye

  • 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

  • HELP !!! Problem in R/3 trying to get a PDF on to Web Dynpro

    Hi,
    I read a note about <b>How to get PDF on to Web Dynpro iView </b>, it was very helpfull, but the problem is in R/3 because I need that the Print Window do not open and send data direct to Web Dynpro.
    the code is:
      control_parameters-no_dialog  = 'X'.
      control_parameters-preview    = ' '.
      control_parameters-langu      = 'S'.
      control_parameters-getotf     = 'X'.
      output_options-xsfcmode   = 'X'.
      output_options-xsf        = space.
      output_options-xdfcmode   = 'X'.
      output_options-xdf        = space.
      output_options-tdnoprev   = 'X'.
    *  OUTPUT_OPTIONS-TDNOPRINT  = 'X'.
      output_options-xsfoutdev = output_options-tddest = 'ZWIN'.
      output_options-tdimmed    = 'X'.
      output_options-tddelete   = 'X'.
    call function 'SSF_FUNCTION_MODULE_NAME'
        exporting
          formname              = 'Z_REP_TRANS_PRES'
    *   VARIANT                 = ' '
    *   DIRECT_CALL             = ' '
       importing
         fm_name                  = formato
    * EXCEPTIONS
    *   NO_FORM                 = 1
    *   NO_FUNCTION_MODULE      = 2
    *   OTHERS                  = 3
    call function '/1BCDWB/SF00000022'
    exporting
    *   ARCHIVE_INDEX              =
    *   ARCHIVE_INDEX_TAB          =
    *   ARCHIVE_PARAMETERS         =
       control_parameters         = control_parameters
    *   MAIL_APPL_OBJ              =
    *   MAIL_RECIPIENT             =
    *   MAIL_SENDER                =
       output_options             = output_options
    *   USER_SETTINGS              = 'X'
    *   USUARIO                    =
    *   FECHA_INI                  =
    *   FECHA_FIN                  =
       tipo_rep                   = tipo_rep
    *   TIPO                       =
    *   LOGO                       = 'ZHR_CANTV_LOGO'
    importing
    *   DOCUMENT_OUTPUT_INFO       =
       job_output_info            = output_job
    *   JOB_OUTPUT_OPTIONS         =
      tables
        transf_pres                = transf_pres
    * EXCEPTIONS
    *   FORMATTING_ERROR           = 1
    *   INTERNAL_ERROR             = 2
    *   SEND_ERROR                 = 3
    *   USER_CANCELED              = 4
    *   OTHERS                     = 5
      call function 'CONVERT_OTF'
        exporting
          format                = 'PDF'
    */      MAX_LINEWIDTH         = 132
        importing
          bin_filesize          = numbytes
          bin_file              = bin_file
        tables
          otf                   = zoftdata
          lines                 = zpdf
        exceptions
          err_max_linewidth     = 1
          err_format            = 2
          err_conv_not_possible = 3
          err_bad_otf           = 4
          others                = 0.
    Thanks in advance!!!
    tgfch

    Hi Claus,
    Try use this web dynpro code to open the XSTRING that coming from abap side:
    IWDCachedWebResource resource = WDWebResource.getWebResource(
    wdContext.currentZReport_OutputElement().getPdf(), WDWebResourceType.getWebResourceTypeForFileExtensio("pdf"));
    resource.setResourceName(this.getDescriptionReport());
    // Create a External Window with the URL destination
    IWDWindow window = wdComponentAPI.getWindowManager().createExternalWindow(resource.getURL(), this.getDescriptionReport(), true);
    // Eliminate some features of the window
    window.removeWindowFeature(WDWindowFeature.ADDRESS_BAR);
    window.removeWindowFeature(WDWindowFeature.MENU_BAR);
    window.removeWindowFeature(WDWindowFeature.STATUS_BAR);
    window.removeWindowFeature(WDWindowFeature.TOOL_BAR);
    window.setWindowSize(780,430);
    window.setWindowPosition(20,140);
    window.open();
    This code will open its PDF report!!!
    Regards,
    Luciano Leite

  • Problem in submit button on adobe form integrated with web dynpro

    Hello,
    I'm facing prob in triggering web dynpro event onSubmit for Interactive form.
    I've created a submit button from web dynpro activex pallete on adobe form (integrated with web dynpro) to send the form as email.
    Then in the web dynpro view where this form is embedded i have created an action against onSubmit event and called a method within this.
    However, on clicking Submit button this event is not getting triggered.
    Please let me know what is lacking in this process?
    Thanks.

    Hi,
    I am also facing the same problem. i have developed a simple scenario under which user have to input his/her details and on submit button it will be updated to database.
    I have tried the above solution but after adopting this solution all the editable fields become non-editable.
    so the above solution is not working for me could you help me out.
    I think ... try this....
    When you create the Adobe Form from WebDynpro, you need to follow one step in SFP Transaction or inSE80 transaction. Open the Adobe Form in any one the transaction and now in SAP menu bar "Utilities" in that you will find the "INSERT THE WEBDYNPRO SCRIPT" just click on that one. Then you will see a new Script Object is being created with the name "ContainerFoundation_JS" under the "Variables" in the Heirarchy of the Object Pallete of the Adobe Form.
    This step is mandatory to use the SUBMIT Button of the "WebDynpro Native", to trigger the OnSubmit event of the WebDynpro.
    Thanks
    Edited by: shailendra2sap on Mar 6, 2009 12:24 PM

  • Search Help on Adobe Interactive Form with Web Dynpro ABAP

    Hi All,
    I have created Adobe Interactive Form with ZCI type and XML based interface type using Webdynpro ABAP.
    I placed a text field USER_NAME on the form ( data element is linked to search help USER_COMP ).
    Added Native WD UI element 'Value Help' to form to search for users and changed script
    *var fieldName = "INSERT_NAME_HERE*"; to var fieldName = "USER_NAME";
    The problem is that when I click on the value help button, nothing happens.
    Is any more additional steps required ?
    Thanks
    Karu

    Hello
    Check this
    F4 Value Help on Adobe Interactive Form with Web Dynpro ABAP
    Thanks
    Anirudh

  • Upload a file in KM repository with Web dynpro for abap

    Hi gurus, i´m trying to create a KM repository and then upload a file into this repository with Web dynpro for abap , but i can´t find any info. Can anyone help me with this problem, i have to solve it ASAP...
    Thanks for all....
    Regards,
    Diego.

    Please referr to the ideas on this thread.
    Install Problems withe the NW04s ABAP Trial verssion
    You have installed the loopback adapter and made the propriate entries in the hosts file, right?
    Regards,
    Rich Heilman

  • Tutorials to implement Flash Islands with Web Dynpro Java

    Hi,
    We have downloaded the CE 7.1 EhP1 trial version.
    Any pointers to tutorials to implement Flash Islands with Web Dynpro Java would be helpful.
    Thanks,
    Chitrali

    Hi,
      I read a document which says Adobe Flex Builder is not been included part of shipment of NW. So not lots of documents available. Yet with WDA, some tutorials and blogs are available. Similar application can be developed using WDJ. Please check these.
    WDJ:
    The specified item was not found.
    WDA:
    http://www.adobe.com/devnet/sap/
    https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/10989ef6-968c-2b10-50a9-eb34a5267163
    https://www.sdn.sap.com/irj/scn/wiki?path=/display/emtech/sapRichIslandsforAdobe+Flash
    Regards,
    Harini S

  • Sliver light integration with web dynpro abap

    Hi All,
    I was trying to integrate silverlight with web dynpro. Does any one has any document to start with..??
    Where can i design silverlight application to upload in web dynpro..??
    Thanks and Regards,
    Vishesh,

    Hi,
    We faced a similar problem with BSPs and had to change the definition of the area link type entry.
    I am assuming you have set the area link type to WebDynpro for ABAP and the resource is calling an Iview/page that has the WD ABAP application configured.
    To get around the error, change the Area Link type to Calls a Portal page and make sure the resource calls an Iview/Page that has the WD ABAP application configured.

  • MDM with Web Dynpros

    Hello,
    I am new to MDM, Can anybody please let me know how could I use MDM with Web Dynpro's? I have read the article "MDM connectivity to java application" that could be the way to use if the sda are available!
    Regards,
    Dharmi

    Dharmi,
    This is excellent, in fact we are also working on a similar scenario. We already have developed some web dynpros which call the API's exposed by MDM and display the data. (Very soon we will write a blog on the same). However the problem is these web dynpro's become very specific with the respository you are dealing with. If that is all you want they that should be fine.
    However, if you want to come iViews just like SAP then we mihgt have to think out of the box.
    Have you seen the example of Applied.com? the back for these sites is SAP MDM. However these are the J2EE applications which are accessing the API's of MDM and also with other applications for placing the order.
    The ideal solution that I can think of is to publish a catalog using MDM API's, give additional functionality of shooping cart, once everything is done, place the order which will create a sales order (SAP R/3 or any other ERP) via SAP XI (SAP EP communicating with SAP R/3 via XI.
    Regards,
    Ravi

  • Problem opening PDF files with adobe

    I cannot get adobe to open my pdf files. Not from internet nor from desktop.
    I downloads fine,. I have installed and reinstalled several times.
    If I try to open it looks like it opens but closes immediately. I tried to open adobe, but nothing. A grey screen and that's it. I cannot access the help button

    Yes, I finally got it working using number 2:-) Thank you very much
    2013/8/1 Pat Willener <[email protected]>
       Re: Problem opening PDF files with adobe  created by Pat Willener<http://forums.adobe.com/people/pwillener>in
    Adobe Reader - View the full discussion<http://forums.adobe.com/message/5557146#5557146

  • Incident-management with web dynpro ags_incident_trans_key

    Hello!
    I try to implement the solution manager incident-management with web dynpro. Especially i have a problem with the web dynpro ags_incident_trans_key.
    In SAP-help http://help.sap.com/saphelp_smehp1/helpdata/en/40/8ac473d40943ddb23def12bdb33437/frameset.htm you can read under topic "Replying to Solution Proposals or Questions", that when you do the action "answer" the user status of the support message is reset to In Process. But this doesn't happened. Where can this be customized? In transaction sppfcadm it's not possible, because the button "answer" is no PPF-action (or I can't find it).
    Is there any solution, that the support employee is automatical informed with an mail, that the user status of the support message is reset to In Process?
    Thanks in advance
    Ralph

    Hello Christoph,
    Thankx for your answer!
    I had to modify the status profile in crmbs02. After that the status changes perfect.
    Now I am able to change in transaction crm_dno_monitor the status in two ways:
    a) button "action" --> choose action --> everything is fine. A mail is created with PPF-Action and the status changes. But this button is not availbale in the web-dynpro (and that's good!).
    b) button "status" --> choose status --> status of incident-dokument changes, but there is no mail-action. The button "status" has the same result as pushing the "answer"-button in the web-dynpro.
    The user should use only the web-dynpro-button "answer". So, how musst this mail-action be configured? Maybe in sppfcadm?
    Regards,
    Ralph
    Edited by: Ralph Dollinger on Oct 18, 2010 12:02 PM

  • How to call PDF file in Web Dynpro Appl?

    How to call PDF file in Web Dynpro Appl?

    Hi Gobinath,
    1. Create a value attribute of type byte called pdfSource.
    2. Insert an UI element called Interactive Form in your layout
    3. Set the source property of this Interactive From UI element to the context pdfSource.
    4. Insert a button which would open your pdf file.
    public void onActionsubmit(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )
        //@@begin onActionsubmit(ServerEvent)
       IPrivate<viewname>.IContextElement contextElement = wdContext.currentContextElement();
             byte[] bytes = contextElement.getPdfSource();
             try
                   File file = new File("C:
    temp
    example.pdf");
                   FileOutputStream os = new FileOutputStream(file);
                   os.write(bytes);
                   os.close();
                catch (IOException e)
                   // do something
                   e.printStackTrace();
        //@@end
    Warm Regards,
    Murtuza

  • Exception occured when deploying in Visual Composer with web dynpro mode

    Hi,All
    when I deploy application in visual composer with web dynpro mode, exception occured as following, please help me.
    Thanks.
    best regards
    Jiande Ding
    The initial exception that caused the request to fail, was:
       com.sap.engine.services.deploy.container.DeploymentException: Clusterwide exception: Failed to prepare application sap.com/tcwd4vcengineconfigstd for startup. Reason= Clusterwide exception: Failed to start application sap.com/tcwd4vcengineconfigstd: The referenced application sap.com/tcwd4vccorestdinfoactors cannot be started. Check the causing exception for details. Hint: Is the referenced application deployed correctly on the server?
        at com.sap.engine.services.webdynpro.WebDynproContainer.prepareStart(WebDynproContainer.java:1494)
        at com.sap.engine.services.deploy.server.application.StartTransaction.prepareCommon(StartTransaction.java:223)
        at com.sap.engine.services.deploy.server.application.StartTransaction.prepareLocal(StartTransaction.java:176)
        at com.sap.engine.services.deploy.server.application.ApplicationTransaction.makeAllPhasesLocal(ApplicationTransaction.java:365)
        at com.sap.engine.services.deploy.server.application.ParallelAdapter.runInTheSameThread(ParallelAdapter.java:132)
        ... 8 more
    Edited by: Jiande Ding on Nov 4, 2008 1:08 PM

    Hi
    Check out this link
    http://help.sap.com/erp2005_ehp_03/helpdata/EN/7c/9ce742bdab5604e10000000a155106/frameset.htm
    Thanks

Maybe you are looking for

  • IHow do I know what the bit details are on an image and how to change it?

    I wanted to send some wildlife images to a magazine who required us to send  quality size 10 saved at 300dpi and then to send a copy of the same images at 72dpi and 8bit NOT 16bit. I have no idea what they are requesting so please:- 1) How do I disco

  • Fundamental ACL & Service Policy related questions

    Hi All, apologies in advance for seemingly stupid questions but I was forced to ask them as I have ALWAYS had great difficulty in using debug on Cisco platforms. Nothing ever shows up when I set up debug despite configuring "logging console" and sett

  • CSS with single SSL module.. balance option needed?

    Hi all, Quick question. If you have a CSS 11503 with one SSL offload module installed.. is there any point in using the "application ssl" and "advanced-balance ssl" options in the content rule? I can't find any info that tells me for sure but I'm gue

  • Re-installing my license on a different machine

    Hi, I'd like your assistance with the following: My workplace has 3 licenses for Contribute 3 and one of the PC's hard dirve crashed and Contribute hasn't been re-installed as the person is not using it. I downloaded it on my machine and when I tried

  • Formatted Search Forms

    Hi Guys, Thanks very much to John for the answer concerning the formatted Search Form. But I still have the problem that although the formatted Search has already been defined, the system is always asking if I would to define a new formatted Search,