Additional Blog Posts by SAP
cancel
Showing results for 
Search instead for 
Did you mean: 
vani_krishnamoorthy
Product and Topic Expert
Product and Topic Expert
12,037
Last two weeks I have been working on creating an Offline fillable Adobe form. What I found was that most of the documentation when it comes to Adobe forms talk about Web Dynpro. My task was to try and create a fillable Adobe form completely with the ABAP workbench. This blog is my experience with creating such a form Before doing anything it is a good idea to make sure that the ADS is configured and ready for use and has a valid license. This is required if the form is to be saved after filling. The first step for an offline scenario would be to design a form.The steps for form design are: •Start transaction SFP •Create an interface •Create a form object •In the context link the required parameters from the interface •Finally create the layout of the form and activate the form. I will not go to the details as this has been covered in by other weblogs The interesting thing is that once we designthe form assign an interface and generate we have the use of the Generated Function Module which we cna be used in an ABAP program to create the fillable form. The application program would consist of •Data retrieval and processing : A select statement for the pre populates information •Obtain the name of the Generated Function Module of the form •Start the form processing •Call the Generated Function Module •End form processing •Send the form to the vendor using Business communication services (BCS) Data retrieval and processing This is a simple select statement to select the vendor number, name and company code from the vendor table LFA1 based on the vendor from the selection screen * Get vendor data select single lifnr name1 bukrs from lfa1 into wa_vndbnk where lifnr = p_lifnr. Get the generated function module The next step is to get the generated function module. Call function module FP_FUNCTION_MODULE_NAME and pass the form name to it. The parameter e_funcname will contain the name of the generated function module name. * First get name of the generated function module call function 'FP_FUNCTION_MODULE_NAME' exporting i_name = 'ZVK_TESTHD' importing e_funcname = fm_name. Start the form processing I use the function FP_JOB_OPEN to open the form for printing. What is of interest here is the parameter ie_outputparams. This determines printer settings. This parameter is also what I used to inform the the generated function module to return a PDF file back. Since this is an offline scenario and there is no printing involved I suppressed the printer dialog popup as well. If you want your form to be to use a specific ADS you can explicitly give the RFC connection to connect to your ADS using the parameter 'CONNECTION'. * Set output parameters and open spool job fp_outputparams-nodialog = 'X'. " suppress printer dialog popup fp_outputparams-GETPDF = 'X'. " launch print preview call function 'FP_JOB_OPEN' changing ie_outputparams = fp_outputparams exceptions cancel = 1 usage_error = 2 system_error = 3 internal_error = 4 others = 5. Call the generated function module I am finally ready to call the generated function module This is where I specify thay my form needs to be fillable. There is a standard parameter /1bcdwb/docparams which is used to set the forms locale. This also has a field where I tell the form that it is fillable. Once this parameter is set if the license is available in the ADS a fillable savable form will be returned when the function module is executed. * Set form language and country (->form locale) fp_docparams-langu = 'E'. fp_docparams-country = 'US'. fp_docparams-FILLABLE = 'X'. * Now call the generated function module call function fm_name exporting /1bcdwb/docparams = fp_docparams Z_VNDBNK = wa_vndbnk importing /1BCDWB/FORMOUTPUT = fp_formoutput exceptions usage_error = 1 system_error = 2 internal_error = 3 others = 4. Dont forget to close the print job * Close spool job call function 'FP_JOB_CLOSE' exceptions usage_error = 1 system_error = 2 internal_error = 3 others = 4. The fields fp_formoutput-PDF contains our fillable form. Now that the system has generated a fillable PDF form I can email this to anyone using BCS. The user can than open the form and fill it or save it somewhere and fill it as and when he pleases.
17 Comments