on 10-07-2008 3:21 PM
Hi ,
Iam accessing a BAPI that gives me a SAP Scipt PDF form as a result.can someone give a step by step process of how to display it in portal on clicking a button using webdynpro java.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Swathi,
Refer to this link which might be helpful to you.
http://saptechnical.com/Tutorials/Smartforms/SFinEPasPDF/Page1.htm
Thanks & Regards,
Jhansi Miryala
Hi ,
Insert IFrame UI Element and bind the Resource property to the value attribute PdfUrl of type String .
Define a Output parameter of type Binary in RFC .
Insert the following code to dispaly the smart form
byte[] pdfContent = wdContext.currentOutput<node>().get<Binary>();
IWDCachedWebResource pdfResource = WDWebResource.getWebResource(pdfContent,WDWebResourceType.PDF);
try
{
wdContext.currentContextElement().setPdfUrl(pdfResource.getURL());
}
catch(Exception e)
{
wdComponentAPI.getMessageManager().reportException(e.getMessage(),true);
}
Regards,
Sunitha Hari
Swathi,
This is the code from the thread I referred above. Please see if it helps you.
String s=null
for(i=0;wdContext.nodeTLINE();i++)
wdContext.nodeTINE().moveFirst();
{
strTline = wdContext.nodeTLINE().nodeTLine().currentTlineElement();
//check the element in TLINE should of lenght of 2 if not then fill with space "". loop it like that.
strTdline = wdContext.nodeTLINE().nodeTdLine().currentTdLineElement();
//check the element in TDLINE shud be of 138 characters if not loop it to and fill it with spaces.
s= s+strTline+strTdline;
wdContext.nodeTINE().moveNext();
}
//From this string that is been obtained convert it into bytearray using following:
byte[] byteString = s.getBytes[];
Vishwas.
I had the same problem - "File doesnt start with %PDF-" and this was solved with ByteBuffer API. I'm using JDK 1.4.2_18 and ByteBuffer API is available to me without any specific imports in these 2 locations.
com.sun.corba.se.internal.ior.ByteBuffer
java.nio.ByteBuffer
See if this works for you.
Hi vishwas ,
Thanks for you help.I could finally resolve the problem with a different apporach even without using bytebuffer.I used filedownload api
Here is my code
wdThis.wdGetBenCustController().Execute_PrintEnrollmentForm();
byte[] byteString = wdContext.currentPrintformElement().getPdf_Xstring();
//byte[] byteString = pdfString.getBytes();
String url = null;
// From this string that is been obtained convert it into bytearray using following:
try{
IWDResource wr = WDResourceFactory.createCachedResource(byteString, "PDF-Report", WDWebResourceType.PDF);
IWDWindow w = wdComponentAPI.getWindowManager().createNonModalExternalWindow(wr.getUrl(0), "PDF-Report");
url = wr.getUrl(WDFileDownloadBehaviour.OPEN_INPLACE.ordinal());
w.show();
}
catch (Exception e)
{
wdComponentAPI.getMessageManager().reportException(e.getLocalizedMessage(), false);
}
User | Count |
---|---|
85 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.