cancel
Showing results for 
Search instead for 
Did you mean: 

Generating PDF in Web-Dynpro - empty window popup

Former Member
0 Kudos

Hi Expertise,

I notice that in FM Y_GLXX_WD_JAVA_PDF has calls CONVERT_OTF. It returns different value bin_file in 4.6 & ecc6. In Ecc6 there wasnt return PDF header %PDF 1.3 - ......... but 4.6 had returns. It cause the portal site will prompt out empty windows instead of prompt out PDF screen.

Any ideas, which FM should i use to replace CONVERT_OTF or other solutions??

Regards,

azel

Edited by: azel aziz on Sep 4, 2008 4:33 AM

Accepted Solutions (1)

Accepted Solutions (1)

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

Although not technically released for customer usage, CONVERT_OTF should still work. You might also consider CONVERT_OTF_2_PDF. I have seen solutions using these function modules on NetWeaver 7.0 releases to covert OTF to PDF.

Former Member
0 Kudos

hi,

Thanks for prompt reply. I get these value in ECC6 for BIN_FILE : ═䑆ⴱ⸳ഊ◢팍ਲu2030扪ഊ㰼ഊ⽆楬瑥爠㌠〠刍ਯ䱥湧瑨‴u2030⁒ഊ㸾ഊ獴牥慭ഊ碜ෆ२卷#骻榴䷛ꑍ鏦沓麛鬊㩊䞧ఏ#ⴎ䕦꜕ᐕ씝ꕬ裈摬荭鑉⥨궝溵渥

As, I noticed to display PDF file in portal it should have PDF header infront in BIN_FILE like this :

%PDF-1.3##%âãÏÓ##2 0 obj##<<##/Filter /ASCII85Decode##/Length 3 0 R##>>##stream##iZBE)+=,qi,N9^hiZBH)(ae2Z-/o

Do you have idea?

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

Is this how you are seeing the content in the debugger directly out of the function module call? Are you using the BIN_FILE exporting parameter to get the PDF content output? This is a binary string so it will not look the same as character string. How are you processing this binary string after exporting it?

Former Member
0 Kudos

Both are in binary file. The junk value came from Ecc6 & the correct value from 4.6. In customised FM has called FM: CONVERT_OTF. The CONVERT_OTF has called standard program RSTXCPDF. In these standard program has check for CP value which is get from FM: SYSTEM_CODEPAGE. If the screen is ECC6, CP value returns 4 and in 4.6 it returns value 1.

I've tried to change the value in ECC6 while debugging to 1, it was displayed PDF file successfully in portal. FYI, the customised FM doesnt exporting anything, its just to get the smartform function module then convert the OTF format. pls help. Thanks again

Former Member
0 Kudos

by the way, it is correct if i says we need PDF header %PDF-1.3##%âãÏÓ##2 0 obj##<<##/Filter /ASCII85Decode.. to make the portal site prompt out the PDF file? As what i checked in 4.6 all the exporting paramter should start with this header. How about ECC6 ? it that the same header should use? If there is no PDF header, empty window will popup with junk value inside. Appreciate if you could guide me. Thanks

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

It sounds like you system is Unicode now - hence the difference in SYSTEM_CODEPAGE and why the PDF Header looks different now. However the Unicode binary string should still work. What exactly are you doing with the binary string after it is retrieved from the function module? How does this relate to Web Dynpro ABAP (since this is the WDA Forum)? Are you pushing the content out via the interactiveForm UI element?

Former Member
0 Kudos

For your information, i am currrently developing in Webdynpro Java. But, i don't think that is the case because the Java code will convert the Binary String to Bytes. The problem is why the BAPI returning different BIN_FILE values from two different system (ECC6.0 & 4.6C)?

After the execution, the BAPI will return the PDF value as String

[http://inakimi.multiply.com/photos/album/48/webdynpro#1]

And this is the code in WD Java converting the String to Bytes:

IWDCachedWebResource resource;

wdThis.setData();

String line = wdContext.currentOutputElement().getBin_File(); byte[] pdfContent = line.getBytes();

try{

resource = WDWebResource.getWebResource(pdfContent, WDWebResourceType.PDF);

IWDWindow window = wdComponentAPI.getWindowManager().createNonModalExternalWindow(resource.getURL(), "PDF File");

window.setWindowPosition(5, 5);

window.setWindowSize(600, 600);

window.show();

}catch(Exception e){

}

Edited by: azel aziz on Sep 5, 2008 3:25 AM

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

First of all, this is forum is for questions related to Web Dynpro ABAP only. Your question actually turns out to be Web Dynpro Java. You must post your questions in the correct forum!

Answers (0)