cancel
Showing results for 
Search instead for 
Did you mean: 

Convert SAP Script into Adobe form

Former Member
0 Kudos

Hi All,

In our project we have a requirement, where we have to convert the SAP Script into Adobe form. And this form will be displayed in Portal.

Has anybody implemented it?

Thanks in Advance,

Amit

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

Do like this

1) copy script to smart form

smartform---->utilities-->migrate sapscript form--->provide name(script form to be copy)>save--->activate.

2)

(i). Print the smartform to the spool.

(ii). Note the spool number.

(iii). Download a PDF file (Acrobat Reader) version of the spool by running Program RSTXPDFT4 and entering the noted spool number.

(iv). Import it to Adobe.

Former Member
0 Kudos

Hi Amit,

One option i can see is ->

1. get the data of the PDF form. Refer the retrieving data portion of this

<a href="https://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/c0c139d3-3eae-2910-01a1-d253f2587b0e?prtmode=navigate">webinar</a> .

and call this RFC/ BAPI from your application.

2. Create a template in the NWDS and pass the data at the context level.

I beleive there are other options (more simple available), will upadte this thread, once i get any new ideas or will call you up some time.. The party was good!! [:D].

- Regards,

Anto.

Former Member
0 Kudos

Thanks for your replies.

Problem has been solved.

We first converted the Script into OTF using CONVERT_OTF. Then Converted OTF into PDF using CONVERT_OTF_2_PDF. This will return a binarystring.

Noew, in NWDS, in the Context of the view define a variable "pdfSource" of Binary Type. Execute the BAPI.

In the "INIT" method, write this code:

myPdfDoc = wdContext.getNodeInfo().getAttribute("pdfSource")

.getModifiableSimpleType();

((IWDModifiableBinaryType)myPdfDoc).setMimeType(WDWebResourceType.PDF);

((IWDModifiableBinaryType)myPdfDoc).setFileName("Sample PDF");

Create an action : <b>OpenXstringSave</b>

wdThis.wdGetConvert_OTF_2_PDFController().ExecuteConvertBAPI();

try

{

byte[] pdfContent = LoadByteArrayFromBinFile();

IWDCachedWebResource pdfResource = WDWebResource.getWebResource(pdfContent,WDWebResourceType.PDF);

wdComponentAPI.getWindowManager().

createExternalWindow(pdfResource.getURL(),"Sample PDF",false).open();

}catch ( Exception ex){

}

Create a Method : <b>LoadByteArrayFromBinFile</b>

public byte[] LoadByteArrayFromBinFile( )

{

//@@begin LoadByteArrayFromBinFile()

byte[] byteXstring = null ;

try{

byteXstring = wdContext.nodeZ_Ps_Bapi_Convert_Otf_2_Pdf_Input()

.nodeOutput().currentOutputElement()

.getI_Binfile();

return byteXstring;

}catch ( Exception ex)

{

wdComponentAPI.getMessageManager().reportSuccess(ex.toString());

return null;

}

//@@end

}

Thanks Once Again

Amit.