Generating a PDF in Web Dynpro without using InteractiveForms
Hello All,
I have been following this tutorial <a href="http://sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/webdynpro/tutorial%20on%20working%20with%20the%20pdf%20document%20object%20-%2032.htm">http://sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/webdynpro/tutorial%20on%20working%20with%20the%20pdf%20document%20object%20-%2032.htm</a> from SDN and is currently stuck.
<u><b>What I'll like to achieve</b></u>
1) User logs on to the system and a table displaying a list of items for approval appears.
2) the user is then able to select a row item from the table and click on 'approve'. In doing so, my application should generate a pdf form in the background and attach it as an email attachment and sent that email to an appointed vendor.
<b><u>Problem</u></b>
As there is no InteractiveForm involved, I do believe I will need to provide the template (.xdp) so that the PDF can be generated. In the tutorial, it suggests doing this (I modified it a little to reflect my own path name):
InputStream templateSourceInputStream = getClass().getClassLoader().getResourceAsStream("d:
usr
sap
pdf
PDF
XBCRPDFPreviewView_InteractiveForm1.xdp");
However, I am given a NullPointerException when I attempt to do that. Does anyone has any idea what may have caused the error ? Thank you.
from
Kwok Wei
Hi Kwok Wei ,
According to the convention the any file can be placed in the src/mimes/Components/<component package + component name>/folder of your webdynpro project along with other generated files of your application.
After this you just need to pass the filename to the getResourcestream() method,it automatically picks up the file from the folder.
Regards
Aarthi Mathivanan
Message was edited by: aarthi mathivanan
Similar Messages
-
Dynamically generate PDF with web dynpro
Is it possible to generate a PDF in web dynpro abap without using the interactive form UI element ? In other words just take the data in my context and convert that into a xstring pdf using a predefined template and interface?
Hi
Do tell your solution for others to benefit
Regards
Yuval -
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. -
11i load balancing web nodes without use of Hardware http load balancer
I am looking at note 217368.1 (Advanced Configurations and Topologies for Enterprise Deployments of E-Business Suite 11i) and some other notes on load balancing but some aspects are not clear.
Aim is to implement load balancing traffic to web nodes without using Hardware ( BigIP, cisco etc) for HTTP layer load balancing.
Which is more preferable between dns or Apache Jserv load balancer ?
Need details like failover capabilities, death detection of node, functionality testing and ways to monitor Apache Jserv load balancer.
Any help in this regard is welcome .
thx
arunOracle recommends using loadbalancing hardware rather than using DNS. If you want the features you mention above, you will need a hardware loadbalancer.
http://blogs.oracle.com/stevenChan/2006/06/indepth_loadbalancing_ebusines.html
http://blogs.oracle.com/stevenChan/2009/01/using_cisco_ace_series_hardware_load-balancers_ebs12.html
HTH
Srini -
Steps to expose a web service without using SR
Hello,
How can I expose a web service without using the service registry? Is there some documentation for this process?
Thanks,
MattThanks for the response. Although, I do not have an * in the Sender Agreement.
Here is the situation:
When I attempt to reach the URL for my Web Service but using NWA instead of the Service Call I get into NWA.
https://xxxxx.steelcasedev.com/nwa
Result: Success
When I use SOAPSonar to run this URL I get the CPA error:
https://xxxxx.steelcasedev.com//XISOAPAdapter/MessageServlet?senderParty=&senderService=WSProcurement_Async_Sender&receiverParty=&receiverService=Steelcase_Dev&interface=WSProcure_Out&interfaceNamespace=urn:steelcasedev.com:wsprocure:xsuppliers
Result: Error
<context>XIAdapter</context>
<code>ADAPTER.JAVA_EXCEPTION</code>
<text><![CDATA[
com.sap.aii.af.service.cpa.CPAException: com.sap.aii.af.service.cpa.impl.exception.CPALookupException: Couldn't retrieve inbound binding for the given P/S/A values: FP=;TP=;FS=WSProcurement_Async_Sender;TS=Steelcase_SAPR3_D01;AN=WSProcurement_Out;ANS=urn:steelcase.com:wsprocurement:xml2suppliers;
at com.sap.aii.af.service.cpa.impl.lookup.CommonLookup.checkForError(CommonLookup.java:53)
at com.sap.aii.af.service.cpa.InboundRuntimeLookup.getBinding(InboundRuntimeLookup.java:411)
at com.sap.aii.af.service.cpa.impl.lookup.AbstractLookupManager.getBinding(AbstractLookupManager.java:714)
at com.sap.aii.adapter.soap.web.MessageServlet.doPost(MessageServlet.java:430)
The sender adapter is active in ID but in RTWB it is "Started but Inactive". I have found that this status could be related to the fact that I have not had a successful transaction for that channel yet.
My NW Admin says he found this error:
Marked transaction for rollback for message 0015605e-09d7-1ddf-94f7-d5031c019713(INBOUND). Reason: Channel has been configured as inactive and cannot accept messages
I am quite confused.
Thanks,
Matt -
Get URL parameters of Web Dynpro Application using Floor plan manager
Hi Experts,
I have a web dynpro component using FPM. The default window of the application is FPM_WINDOW which is an interface view of component of FPM framework. so I cannot get the URL parameters in handledefault of a normal web dynpro app which is not using FPM. How do I get URL parameters in this case through FPM? Thanks!Hi,
I guess you might have created the application under FPM_OIF_COMPONENT/FPM_GAF_COMPONENT. For that add the pramaters to the PARAMTERS tab of teh application.
Now, you can use
data lo fpm type ref to if_fpm.
lo_fpm = cl_fpm=> get_instance( ).
CALL METHOD lo_fpm->mo_app_parameter->get_value
EXPORTING
iv_key = 'PERNR' "Application param name
IMPORTING
ev_value = lv_pernr.
Regards,
Lekha. -
Prerequisites to generate PDF in web dynpro
hi Web dynpro Gurus,
I am trying to create a web dynpro application, which uses two BAPIs, The first BAPI output results in some data which I am displaying in a table format.
Now among the data retrieved from the first BAPI is INVOICE number.
Now on clicking the invoice number, the second BAPI should be called and that would result in the PDF file.
So please help me in this issue.
Thanks and regards
krisHi,
For WD4A the information about PDF is here:
http://help.sap.com/saphelp_nw2004s/helpdata/en/2c/241a427ff6db2ce10000000a1550b0/frameset.htm
And for WD4J here's the information with all the relevant links inside:
http://help.sap.com/saphelp_nw2004s/helpdata/en/60/6fc10c6748479392101e09c9e8d33a/frameset.htm
Regards, Heidi -
Hello,
I have a problem with generating a PDF file with ABAP WebDynpro. I have an ALV and there I read a line. From this line I want to build a smartform which should be converted into PDF. I think my coding works. I have no syntax errors and when I debug the coding, everything looks good. I also get my popup that I want to have. But then I got an error: "File does not begin with '%PDF-'."
I look for this error here in SDN but I could not find a solution. I have also tried to do what is mentioned in note 1042424.
Can anybody helps me?
Regards, MarkusSebastian, thanks for your help, but I have used the funtions you have written.
I summarize my coding:
call function 'SSF_FUNCTION_MODULE_NAME'
exporting
formname = 'ZRPM_STECKBRIEF'
importing
fm_name = fm_name
exceptions
no_form = 1
no_function_module = 2
others = 3.
CALL FUNCTION fm_name
EXPORTING
control_parameters = ls_control_parameters
is_attributes = ls_attributes
lt_cap = lt_cap_data
iv_dateinr = lv_dateinr
iv_gate1 = lv_datgate1
iv_chancen = lv_chancen
* IV_RISIKEN =
* IV_BEWERTUNG =
iv_ziel = lv_short_texts
it_fin = lt_fin_data
report_reason = doc_type
IMPORTING
job_output_info = ls_formdata
TABLES
it_nutzen = lt_test3
EXCEPTIONS
formatting_error = 1
internal_error = 2
send_error = 3
user_canceled = 4
OTHERS = 5.
lt_otf[] = ls_formdata-otfdata[].
call function 'SSFCOMP_PDF_PREVIEW'
exporting
i_otf = lt_otf
exceptions
convert_otf_to_pdf_error = 1
cntl_error = 2
others = 3.
CALL FUNCTION 'CONVERT_OTF'
EXPORTING
format = 'PDF'
* max_linewidth = 132
IMPORTING
bin_filesize = pdf_size
bin_file = pdf_data
TABLES
otf = lt_otf
lines = lt_pdf
EXCEPTIONS
err_max_linewidth = 1
err_format = 2
err_conv_not_possible = 3
err_bad_otf = 4
OTHERS = 5.
data:
node_pdf type ref to if_wd_context_node,
elem_pdf type ref to if_wd_context_element,
stru_pdf type if_componentcontroller=>element_pdf ,
item_source like stru_pdf-source.
* navigate from <CONTEXT> to <PDF> via lead selection
node_pdf = wd_context->get_child_node( name = if_componentcontroller=>wdctx_changing ).
* get element via lead selection
elem_pdf = node_pdf->get_element( ).
* set single attribute
elem_pdf->set_attribute(
exporting
* name = `SOURCE`
name = `PDF`
value = pdf_data ). -
Mass upload & Download of PDFs in Web Dynpro ABAP
Hi All,
Is it possible to download multiple PDF's at one go ? for example if you have a Table UI control where each row has one clickable link that generates a PDF using WebDynpro ABAP Application, we want to enable multiselect property of Table UI and provide Mass Download Button control on click of which all selected rows should generate PDF and then get dowloaded to a specific location on machine (c:/). or if there is any other alternative possible ?similarly for Mass Upload we wish to multi select PDFs and upload them to R/3 at one go ?
please let me know if such thing is possible ? if yes is it a good option to have ? as we have users who have to upload these PDF one by one and they wish if they could simply select all PDFs at one go and click Mass upload..Note that there are some validation that we perform once we upload PDF before posting PDF data to backend.
your help & comments would be Highly Appreciated !!
Thanks
Asif>
Maged Ishak wrote:
> Hi Thomas,
>
> could you give me an example how can i download multiple objects without multiple prompts with the class CL_ABAP_ZIP. I use a Web Dynpro for ABAP and I have for Example many word file and i want to download all file in one ZIP-File.
> thanks in advance
> mishak
You simply use the CL_ABAP_ZIP class to combine the multiple binary strings of the word files together.
data izip type ref to cl_abap_zip.
data zip_xstring type xstring.
create object izip.
loop at ifiles assigning <Wa_file>.
izip->add( name = <wa_file>-filename
content = <wa_file>-filecontent ).
endloop.
zip_xstring = izip->save( ). -
Hi all gurus.
I developed a Web Dynpro application to let the users create their own sales orders.
Now I need to let them print the orders when they need to. Searching on the documentation I have, I've never found anything about crating a pdf print from the WD Application.
There must be a way, because I managed to do that even with the very old ITS (the one in which you had to write HTML code...) but i cannot find how.
Can anyone help me please? Even a tutorial would be very appreciated.
Thank you in advance...>
horatiusx wrote:
> Hi all gurus.
>
> I developed a Web Dynpro application to let the users create their own sales orders.
>
> Now I need to let them print the orders when they need to. Searching on the documentation I have, I've never found anything about crating a pdf print from the WD Application.
>
> There must be a way, because I managed to do that even with the very old ITS (the one in which you had to write HTML code...) but i cannot find how.
>
> Can anyone help me please? Even a tutorial would be very appreciated.
>
> Thank you in advance...
You need a Smartform, SAPScript, or AdobeForm to be defined for your output. Define an action/method for print, then pass the data to your Form. SmartForms are not bad, as SmartForms generate a Function Module, and are easy to call.
Call the SmartForm Function with PDF output = 'X' (parameter within Output Control I think). Then pass the PDF_DATA[] table (type = TAB_SOLIX) to a new window output .
Don't have the code in front of me, but have done it several times.
Adobe Forms is another good option, but you need Adobe Server, and generally I have found ADOBE to be SLOOOOOWWWWW. I think Steve Jobs might have been on to something with ADOBE -- just my opinion.
And of course, it can be done with SAPSCript, but I would need a whole blog on how to do that..... -
Web dynpro application using workflow
Hi all,
I have developed a web dynpro application and attached that to the portal, so the user will login into the portal and will access the application. We have a new requirement now, when a user enters the data and hit save button on the web dynpro application, the workflow should trigger and should send the filled out (everything filled in) web dynpro application to his superior, the supervisor should be able to click on a link (which he should get through workflow) and should get the web dynpro application filled in. I am not sure how can I do this, so can you please guide me through.
Thanks,
RajHi Raj,
could I suggest perhaps that you have a good search of SCN - there have been multiple posts about this sort of thing in the past.
for example : the wiki article
[Integrating WebDynpro ABAP applications with UWL for workflow in Portal|http://wiki.sdn.sap.com/wiki/display/WDABAP/IntegratingWebDynproABAPapplicationswithUWLforworkflowin+Portal]
is it perhaps that you do not use the UWL at your site? Or do you want to to send an email to the manager with a link directly to the approval application? The last case is one that I've come across many times before - it just means that you'll need to generate an approval task that is ended by a wf event and send an email to the manager with a URL parameter in the launch of the WDA application so that the app can pick up the details required to display and raise the WF event to complete the approval wf task.
There are all sorts of ways of persisting the information in the form so that the manager can see it in the approval. You can use the workflow container, you can use a db table, you could even use a shared memory area (not that I'd recommend this for this usage). But this is more a case of how to persist information in a workflow and probably a better question (search first, it's probably been answered already) for the WF forum and not the WDA forum.
Good luck in designing and building your application. Perhaps when you are done you could write a blog about your experience and further share how to do this with others.
Cheers,
Chris -
Smartform as PDF in Web Dynpro for ABAP
Hello Experts,
I have developed one Web Dynpro application in which i am trying to show PDF converting from smart from on button click.
I am seeing blank screen when i try to display PDF? But when i check i debugging data passed successfully to context element.
PDF source property mapped to review context element.
I used below code to show PDF in view method:
call function 'SSF_FUNCTION_MODULE_NAME'
call function lv_fm_name
call function 'SSFCOMP_PDF_PREVIEW'
call function 'CONVERT_OTF'
elem_pdf->set_attribute(
exporting
name = `SOURCE`
value = data ).
Thanks
Rajesh YadlaLooks quite alright, but since you only have provided a few function modules, there is 'no' way of telling what is going wrong. I can however give you a link and compare your coding with the one from the tutorial:
[How to display a smartform as PDF in WD4A|https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/f0de1eb8-0b98-2910-7996-8a3c2fcf6785] -
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 -
Print Version PDF in Web Dynpro ABAP Developements
Hi!
But when we push the print button, it works but doesn't generate the pdf document correctly.
alvexport.pdf 1 bytes_ the size of the document isn't correct because there is not content inside.
Best Regards.>
Gabriel Rodriguez Jimenez wrote:
> I put this direction to verify de ADS
>
> http://maep7java.miquel.es/AdobeDocumentServices/Config?style=rpc
>
> making a rpc test "works"
>
>
> The test conection in sm59 ADS works
>
>
> Also check to see if any of the sample AdobeForms WDA applications are working. <-- where I can check this?
>
>
> Thanks
The connection test in SM59 only does a basic PING to the web service endpoint. Often it will show OK, when in fact the ADS is not setup correctly. That is why there are some test applications that do more.
For proper testing of your setup see OSS Note 944221. But basically run the ABAP programs FP_PDF_TEST_00 and FP_CHECK_DESTINATION_SERVICE. You can also try running the web dynpro components WDR_TEST_ADOBE and WDR_TEST_ADOBE_PDF_ONLY
Maybe you are looking for
-
Cannot view a PDF in IE on Windows XP - "Invalid Color Space"
I am trying to provide a link to a PDF for online viewing: http://glencoe.com/sites/common_assets/mathematics/007891647x/LP/FL5MINC3_7_2c_892770_se.p df Some users can see the PDF with no issue, other users with Acrobat reader 9 on Windows XP receive
-
My iphone 3g is getting really slow. I done full restore ,deleted most apps . Not many photos in my album. i have no videos on my iphone. When taking photo with my iphone it takes ages for camera to open up. Very slow to take photo. Any suggestions?
-
My home button is not working.. HELP!
The home button on my iPhone 4 quit working today. I tried syncing it, tried shutting it down, tried blowing air into the dock area and nothing is working. I even reset it... Does anyone know how I can fix it without having to go to the genius bar?
-
What anti-virus server software is available?
I've got OS X Server 10.4.8 running, with clamav doing its thing, and quite well. However, I was wondering what third party AV software is available to be the primary scanner? The reason is that while blocking infected mail has been good, I'd like a
-
Yosemite keeps recreating my deleted iPhoto Library
Hi Guys. I am running Yosemite 10.10.3. Since the new Photos app became included, it has created a new Photos Library, which is fine. However the system has also left the old iPhoto Library, which is now redundant. I keep deleting this old iPhoto Lib