Skip to Content
avatar image
Former Member

How to publish Smart form of PDF in r/3 through WD

Hi,

We have a PDF smart form in the r/3.we want to call the PDF from WD View without using PDF interactive form.

Could any one give me soln for this??

Thanks

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Best Answer
    avatar image
    Former Member
    Jul 24, 2008 at 04:40 AM

    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

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Aug 05, 2008 at 06:16 PM

    Hi,

    The webdynpro should call an ABAP function module which will process the smart form -> PDF conversion and return a binary stream as an export parameter. (use function CONVERT_OTF to convert samrt form to PDF stream)

    The following sample webdynpro code is how I use to display the PDF form in a new window.

    IWDCachedWebResource resource;

    String fileName = "pdf_file_name"

    //Get PFC web resource URL, you need the PDF stream return from ABAP RFC

    resource = WDWebResource.getWebResource(wdContext.currentY_PDFElement().getPdfStream(), WDWebResourceType.PDF);

    resource.setResourceName(fileName);

    String PDF_URL = resource.getURL());

    //Open the PDF in new window

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

    window.setWindowPosition(5, 5);

    window.setWindowSize(600, 600);

    window.open();

    Add comment
    10|10000 characters needed characters exceeded