Web Dynpro Display PDF on Submit
Friends,
I have a requirement where I need to fetch PDF stored in table as RAWSTRING and display in Web Dynpro ABAP IFRAME container on the View
Basically user access this application , from the drop down select the value and click submit, now it should read the PDF rawstring from the table and display on the same View as a PDF. Please let me know how to proceed with it , and what is the best way to handle this.
Thanks
Krish
Hi Krish,
You can use interactiveform UI element to achieve your requirement.
Step1. Create UI element called interactiveform in ur VIEW ( may be in ur case below the dropdown and submit button ).
Step2 : On click of submit button read the selected pdf file from DB and supply it to the context node element of type XTRING ( which is mapped with the interactive form UI element of the view )
Refer wiki article in case of doubt :
http://wiki.scn.sap.com/wiki/display/WDABAP/A+Simple+Web+Dynpro+Application+to+display+a+pdf+file+in+the+browser+window
Regards,
~Raj
Similar Messages
-
Hi All,
I have a requirement of converting a web dynpro form to a pdf file. The data in the web dynpro form should be written into PDF.
I have gone thru the Wroking with PDFObject tutorial.The tutorial talks abt using EJBs and converting the xml file to pdf. Is it possible for me to convert the form to XML without using EJB and then convert it to PDF.
Also, for converting the XML file to PDF, are all the pre-requisites required :
1. Adobe LiveCycle Designer
2. Active Component Framework (ACF) of the Interactive Forms
3. Adobe document services are configured on the SAP J2EE
Plz comment.
NikhilHi,
If you have Adobe Doucment Services installed then you can do it by getting
the 'pdfResource' context value which is a byte array that contains the PDF.
If not, try using 'itext': http://www.lowagie.com/iText/
Regards,
Omri -
PDF Rending in Web Dynpro Unknown.pdf
I am getting a pdf document from R/3. I get the byte[] from the context node.
The num bytes returned is >0 however when I render the pdf as follows I get a black pdf document displayed and I notice that unknown.pdf the generated url.
BTW, I don't see any way to set the filename. I don't want unknown.pdf in the url.
byte[] pdfContent = wdContext.currentContextElement().getPdfDokument();
try {
IWDWebResource pdfResource = WDWebResource.getWebResource
(pdfContent, WDWebResourceType.PDF);
wdComponentAPI.getWindowManager().createExternalWindow(
pdfResource.getURL(),"Title",
false).open();
} catch (WDURLException e) {
e.printStackTrace();Hi Bob,
In NW2004s we use the following. getPdf() returns a byte[], the filename is "document-<username>.pdf" and source is the attribute of an IFrame UI element.
private void initPdf() {
IWDResource resource =
WDResourceFactory.createResource(
getPdf(),
"document-"
+ WDClientUser.getLoggedInClientUser().getSAPUser().getUniqueName(),
WDWebResourceType.PDF);
String source =
resource.getUrl(WDFileDownloadBehaviour.OPEN_INPLACE.ordinal());
wdContext.currentContextElement().setSource(source);
On NW2004 we use a FileDownload UI element (with target=_self) and we call initFileBinaryType method in the wdDoInit method. Of course you still need to set the binary PdfData context attribute with the actual content of the PDF file.
private void initFileBinaryType() {
IWDModifiableBinaryType pdf =
initFileBinaryType(IPrivateTestAppView.IContextElement.PDF_DATA);
pdf.setFileName("document-"
+ WDClientUser.getLoggedInClientUser().getSAPUser().getUniqueName());
pdf.setMimeType(WDWebResourceType.PDF);
private IWDModifiableBinaryType initFileBinaryType(String attribute) {
return (IWDModifiableBinaryType) wdContext
.getNodeInfo()
.getAttribute(attribute)
.getModifiableSimpleType();
Kind regards,
Sigiswald -
Submit button from Interactive adobe form in Web Dynpro ABAP
Hi all,
We seem to be having a problem with the 'submit' button on the Interactive Form for the Web Dynpro ABAP. The submit button is from the Web Dynpro active X or web Dynpro Native in the form designer. The submit button doesn't trigger the action in Web Dynpro. we are currently running on support pack 9 for the ABAP stack. We have Internet Explorer browser version 6. Could someone tell me if there are requirements for the IE version that will work in conjunction with a particular ABAP stack version. And, are there specific IE security settings or administrative privilages required with this version of the ABAP stack. Or, any other ideas as to why this does not seem to work.
Thanks in advance,
Michelle HongHi Michelle,
Could you tell me how you resolved the problem - as I'm facing exactly the same issue!
Many Thanks
Christine -
Basic question on a web dynpro application
Hi All,
I am new to NWDS 2004 and I just executed my first web dynpro application that is on https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/webas/a-c/creating your first web dynpro application.pdf
I have couple of questions
1. when i click the back button the text that was entered in the Start view is visible even after I hit the back button in the result view. Can you tell me how to keep the input field empty in the start view after hitting back button?
2. After deploying the Web Dynpro application, where from the Portal, can i assign this web dynpro application to a user .
Thank you
Regards
LukeTry putting adding this code to your onActionBack method.
public void <b>onActionBack</b>(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )
//@@begin onActionBack(ServerEvent)
<b>String headerText = " ";
wdContext.currentContextElement().setHeaderText(headerText);</b>
wdThis.wdFirePlugToStartView();
//@@end
REgards,
RIch Heilman -
Access UME information in Web Dynpro for ABAP application
We have an WDA iView deployed in a NW2004 Enterprise Portal. We have mapped the Enterprise Portal UME to our corporate LDAP. How do we access this UME information within the WDA iView ? Besides the user id there are specific security flags that the WDA application needs.
Any help is appreciated!Hi Venkat ,
Please refer to this link,
https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/webdynpro/using knowledge management functionality in web dynpro applications.pdf
Thanks,
Raj. -
Regarding Design of background color in a Web Dynpro Table
Hi
I have a Web Dynpro UI Element Table having two colums and some rows. I wished to set the background color of the rows to white instead of default blue.
Can anyone help me how to implement this?
Regards
SreekarHI
Shekar,
Go thorugh the follwing Web Dynpro Java
https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/business_packages/a1-8-4/nw04stack09themes.zip
To know how to use it and for the steps to be followed please follow the tutorial here
https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/documents/a1-8-4/how to edit web dynpro themes.pdf
the last url gives you a step by step procedure with wizards..
I hope your problem is solved..
don't forget to reward
RK -
Using CSS for Web dynpro application in EP
Hi,
I have some CSS (Style sheets) which I need to apply to the portal, so that all the web dynpro applications can have the same look and feel.
I read something about Theme Editor in EP. Can I somehow use that to import the CSS contents into the EP theme?
Any pointer to using CSS for Web Dynpro applications will be appreciated.
Thanks.
PuneetHi,
Go thorugh the follwing Web Dynpro Java
https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/business_packages/a1-8-4/nw04stack09themes.zip
To know how to use it and for the steps to be followed please follow the tutorial here
https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/documents/a1-8-4/how to edit web dynpro themes.pdf
the last url gives you a step by step procedure with wizards..
Regards,
RK -
Hi,
we are using SAP Netweaver 7.0 trial server in our office.
some clients are accessing that server using SAP GUI710,
at thae time using Web Dynpro Display layout there are recieving Page Expried page,because the function takes palce from localhost:8000,so it is unable to do that function.
if we chane Localhost into Ipaddress it may be work.
so kindly anybody can tell me where to change LOCALHOST in to IPADDRESS to do the Web Dynpro layout function.
Thanks & Regards,
Sudhakar NAs pointed out Adobe FlashIslands (which is a new UI element in NetWeaver 7.01) is what you want. Perhaps some additional links on the topic.
http://help.sap.com/saphelp_nw70ehp1/helpdata/en/47/b907cd77eb2d66e10000000a42189c/frameset.htm
http://wiki.sdn.sap.com/wiki/display/EmTech/SAPRichIslandsforAdobe+Flash -
How to generate and display the pdf form as a web dynpro abap view
Hi,
I filled the value in the table and displayed in the view,In that view i have one button"TOPDF".
My requirement is,if i click that button,i want to display the table in the PDF output.
For the above requirement,i created another view with interactive form,In that view i created one "pdf" Node and "soure" as a attribute of Type-xstring.Then i binded the soure attribute withe "pdfdatasoure" of my interactive form view.
Now my doubt is how and where can i pass the table values to pdf output.
can any body cleare my doubt with some sample code.
Thanks in Advance.
Regards,
Ravi.Hello Ravi,
Best would be to bind the dataSource of the InteractiveForm ui element to the parent node containing the table's data. Then specify a name of a template to be created in the templateSource and hit <enter>. Some popups later, the system will have created a template from the structure of the context. All you need to do now is to drag&drop the data structure inside the template designer to the template itself. This will result in a table. Save, activate and return the Web Dynpro view. Don't forget to unbind the pdfSource and enjoy.
Best regards,
Thomas -
Hi experts,
I have a requirement to upload the document of any type (jpg,doc,tff,ppt,pps,xls,pdf etc) to a Z table (may be in a binary format) in a web dynpro application.
I think this can be achieved through Fileupload view element.
In another window, I need to display the document based on what is selected in the table row. Which control or method can display any type of document? As far as I know, the office control view element can only display documents of type (.doc and .xls).
Please provide pointers on this or any example will help me.
Thanks,
AmitJainAbhimanyu,
Thanks for the reply. Wonderful it worked like a miracle.
Awarded full points.
Thanks
Code I used in the action: onactionclick
METHOD onactionclick .
DATA: content TYPE xstring.
DATA: lr_context_view_node TYPE REF TO if_wd_context_node.
wd_context->get_attribute(
EXPORTING
name = `PDF`
IMPORTING
value = content ).
CALL METHOD cl_wd_runtime_services=>attach_file_to_response
EXPORTING
i_filename = 'Default_pdf.pdf'
i_content = content
i_mime_type = 'pdf'
i_in_new_window = ABAP_FALSE
i_inplace = ABAP_FALSE
ENDMETHOD.
Edited by: Amit Jain on Apr 2, 2009 5:46 PM -
After SP upgrade, pdf in web dynpro could not display dollar symbol
Dear Experts,
We have updated the following support packages:
SAP_BASIS 14-18
SAP_ABA 14-18
PI_BASIS 14-18
SAP_BW 15-20
SAP_AP 12-15
EA-HR 23-61
SAP-HR 23-61
E-RECRUITMENT 18
After that, Some webdynpro for abap which used PDF report has some errors, which dollar could not be displayed, which indicates some kind of error 'o'.
We check that the pattern is of this column is from old version :num{$zzz,zzz,zz9.99} to num{($z,zzz,zz9.99)} . How could we deal with this ? And where could I find the related influence of the SP upgrade of adobe and web dynpro?
Thanks & Best Regards,
DerekChris,
You may be right. Also it requires some configuration in SAP KPro ( document class etc).
Please see SAP [Help |http://help.sap.com/printdocu/core/print46c/en/data/pdf/BCSRVBDS/BDS_STRUCTURE.pdf]on Business Document Services.
At page 64 of this document under topic 'Display Documents' 'Feature it says. "If it is not possible to display the document in place, an appropriate viewer that is available on the
PC is started and the document is displayed u201Cout placeu201C -
How to display pdf in Web Dynpro Page
Hi Experts,
I need to display the pdf file in web dynpro page. I am using Web dynpro 7.1(CE), in that no ui element like Iframe. With Iframe we can display the pdf file in web Dynpro page in 7.0.
But My problem is how display pdf with out using Iframe.
Please any one tell how to display with any other UI elements.
Regards,
Sunil.Hi sunil..
chk this link..
<u><b>Pdf</b></u>
https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/e0401535-f81c-2a10-0192-ffd41e8e8d59
<u><b>Adobe</b></u>
/people/achim.hauck/blog/2005/02/04/my-struggles-with-the-adobe-document-services-in-was640
<u><b>Configuration</b></u>
http://help.sap.com/saphelp_nw70/helpdata/en/43/8a1a8ece230c8ce10000000a11466f/content.htm
<u><b>Adobe Document services</b></u>
https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/9e4e9afb-0701-0010-f8a8-b8cd093662c2
<u><b>Configuring Guided procedure of Interactive Forms</b></u>
https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/b9ea34c2-0701-0010-e2a2-d8e9cd6d85dc
<u><b>Forum Discussions abt Adobe Document Services</b></u>
Re: Configuring the Destination URL for the Adobe Document Services
Hop will this helpful for u..
Regards,
GS -
How to display smartform as PDF in web dynpro java
Hi,
Where can I find sample program to display smartform as PDF in web dynpro java.
Thanks.
Regards,
Henry1. Create a smart form in the R/3 side
2. Now create a function module with the corresponding export parameter:
3. Make sure that the function module is marked remote enabled.
4. In NWDS create an Adaptive RFC model which points to the FM created in R/3 under the webdynpro application
5. Now create an application and view inside it to display the PDF and Insert a frame inside the view
6. Create a value node and an attribute say url of type string inside that node and bind it to the source
7. In the doInit() method place the following code
> ZTest_Pdf_1_Input input = new ZTest_Pdf_Input();
> wdContext.nodeZTest_Pdf_Input().bind(input);
> try {
> wdContext.currentZTest_Pdf_InputElement().modelObject().execute();
> }
> catch (Exception e) {
> e.printStackTrace();
> }
> wdContext.currentInternalElement().setUrl(convert(wdContext.currentOutputElement().getBin_File()));
Inside that view create a method to convert the string to url so that it can be passed as a string to the setUrl method of the currentContextElement() , say convet(byte[] doc_content) which return a string.
Inside that methos write the following code,
> String url = "";
> WDWebResourceType webResType = WDWebResourceType.PDF;
> IWDWebResource webResource = WDWebResource.getWebResource(doc_content, webResType);
> try {
> url = webResource.getURL();
> }
> catch (Exception e) {
> e.printStackTrace();
> }
> return url;
Hope It will be helpful
Regards,
Sam Charles J. -
Display archive doc as pdf from web dynpro?
Hi All,
We have a situation where we want to display archived pdf's from a web dynpro. I have put an interactive form ui element on my view and bound this to an attribute of type xstring on the context.
When I run it, i get an error message saying that file does not begin with '%PDF-'. I've tried putting this on the front of the string but i didn't work either.
So can anyone tell me the process for displaying archived pdf's from a web dynpro.
Many thanks in advance,
Liz.This is the code necessary to get it to work:
get optical archive id of pdf to display
select single * from toahr into ls_toahr
where sap_object = 'PREL'
and OBJECT_ID = lv_obj_id
and ar_object = ls_zhr_paylsip-zhr_doc_type.
lv_archiv_id = 'H1'.
lv_document_type = ls_toahr-ar_object.
lv_archiv_doc_id = ls_toahr-arc_doc_id.
lv_signature = 'X'.
lv_compid = 'data'.
free lt_binarchivobject.
call function 'ARCHIVOBJECT_GET_TABLE'
exporting
archiv_id = lv_archiv_id
document_type = lv_document_type
archiv_doc_id = lv_archiv_doc_id
ALL_COMPONENTS =
signature = lv_signature
compid = lv_compid
importing
length = lv_length
binlength = lv_binlength
tables
archivobject = lt_archivobject
binarchivobject = lt_binarchivobject
exceptions
error_archiv = 1
error_communicationtable = 2
error_kernel = 3
others = 4.
if lt_archivobject[] is not initial.
describe table lt_archivobject lines lv_rowcount.
lv_rowcount = lv_rowcount * 1024.
call function 'SCMS_BINARY_TO_XSTRING'
exporting
input_length = lv_rowcount
first_line = 1
last_line = lv_rowcount
importing
buffer = lv_xstring
tables
binary_tab = lt_binarchivobject
exceptions
failed = 1.
endif.
Where yo bind lv_xstring to the the pdfSource via the context
Maybe you are looking for
-
SharePoint 2010 Content database growing too fast
Hi, I have a SharePoint 2010 Content database wss_content_DB which is 197 GB BUT when I calculate my site collection I can see they have used only about 70 GB. I know there is Auditdata table which is about 27 GB. Couple of days ago my content DB was
-
Hi all, Is it possible to assign Credit card info at item level, for eg: 1 CC per item in sales order?? my understand was it is not possible since the credit card is at header level. Thanks.
-
JVM's suport for multicore processors and multiple processor systems
Hi all, Do you have any concrete information about Sun Hot JVM 1.5's support for multi-core processors and also its support for multi processor systems. I ask this because i am looking at deploying a multi threaded application written in Java 5 and w
-
Error while starting the process
Hello, I created a process and when running it in Runtime get the following error for every Action : Cannot display the iView. The iView may have been removed, the path may be incorrect, or you may not have permission to access I think so I have all
-
I have been using Aperture, and love it. I just got the new iLife 08 and like some features in iPhoto that I cannot use in Aperture, such as the new web gallery and the new iPhoto books. Is there a way I can easily use both without managing 2 databas