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,056
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
marilyn_pratt
Active Contributor
0 Likes
Thanks Vani,
You did a good job of filling in a white space on the subject of Adobe forms for ABAP (as contrasted with Web Dynpro.  Thomas did such a complete job of creating tutorials for Web Dynpro. It would be excellent to see further expansions on such tutorials for ABAP...maybe some .wmv files with voice or .avi files.

Marilyn
vani_krishnamoorthy
Product and Topic Expert
Product and Topic Expert
0 Likes
Thanks Marilyn. I intend to follow this one with another weblog on How to read the filled form using ABAP. I will also see if I can create a tutor or so for the form using ABAP.

Vani
Former Member
0 Likes
Hi Vani,

Can you tell me when this next weblog will be available?

Thanks in advance

Wouter
vani_krishnamoorthy
Product and Topic Expert
Product and Topic Expert
0 Likes
The article
https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/c2567f2b-0b01-0010-b7b5-977...
has both sides of fillable form using ABAP. It covers creating as well as reading the data from the form.
Former Member
0 Likes
Vani,

Thanks for putting the time and effort into this article.  This is exactly what our group is looking for, an offline solution for interactive forms. 
Former Member
0 Likes
Hi

I tried this example and we are on ERP2004. However was not able to produce interactive forms.

When I passed fillable = 'X' no pdf is generated and fp_formoutput-PDF is blank.

When I passed fillable = '' pdf is generated and can be output.

Does this work on ERP2004? Could you please try?

Regards
Girish
venkata_ramisetti
Active Contributor
0 Likes
This is an excellent blog. Looking more such blogs from you.

I tried to develop Offline Interactive Forms Using ABAP using your technicle article. I struck at one point, where PDF_DATA definition is not given in the article and how to get data into this. Could you please let us know the missing code?

I am very sorry for raising this issue here. I couldn't find your contact in SDN.

Madhu2004
Active Contributor
0 Likes
Hi Vani,

i read one of the articles written by you which deals with working of offline interactive forms. In that article you explained about how to send a mail with from as attachment and process the form data after receving the mail.In that You used single fields and updated the bank details.
Can u help me how to extract the data if it is in the form of Table(suppose material , quantity are the fields and have a tabular data) ?


Regards,
Madhu

Former Member
0 Likes
Hello Vani.
The article was very helpfull. thank you.
I want to send the pdf file by mail in the backround, or save the pdf file in the backround - that means, without seeing the file first.
Can you help me?
thanks, Barak.
barak.sahar@ness.com
0 Likes
Thanks for Good Blog,

Please can you post it how to do submit offline intractive form on abap stack, because Client won't like to upload method.

please give me suggetion and rerences.

Thanks & Regards
Vignesh
0 Likes
Sorry , if you not possible to post immaidetly , atlease please send some references to this id vvrao.sap@gmail.com.

I realy failed to search on this topic.

Thanks & Regards
Rao
Former Member
0 Likes
Hi Vani!
Your PDF was very helpful in creating a PDF form using ABAP.But faced problems while extracting data from my PDF.
I created a PDF which has got Sales order information with header and item data.I saved the PDF to desktop. Then I tried to extract the data from that PDF back into my program(It was done for learning purposes), I was struck at the upload method. I wasn't sure about the structure of the file to be passed to method GUI_UPLOAD.As a trial I passed an internal table with structure 'X255'.Then I converted the binary data to XSTRING using FM 'SCMS_BINARY_TO_XSTRING'.Then followed the rest of the process as mentioned in your article.Program goes for a short dump at the call of CALL TRANSFORMATION.The reason I suspect is, the XML obtained is truncated.When copy the XML code from runtime and create a XML file out of it, it gives an error.
Can you please help in getting back on to track.

Thanks,
Sudhir M
Former Member
0 Likes
How you could get drop-down list to work with this scenario???
Thanks
reko
Former Member
0 Likes
Have you solved your Problem? I have the same problem and can't find an solution.
Former Member
0 Likes
Hi Vani,

Your blog is really usefull. But can you expalin your data declaration part please. Really i was unable to understand what are the fields or strutures used such as ZHD_VENDOR & ZVK_VNDBNK. What are the fields you have taken in this data declaration??



DATA: wa_VENDOR type ZHD_VENDOR value is initial,
      lv_subrc TYPE sysubrc VALUE IS INITIAL,
      lt_messtab TYPE STANDARD TABLE OF bdcmsgcoll,
      l_key type SWR_STRUCT-OBJECT_KEY,
      wa_VNDBNK type ZVK_VNDBNK VALUE IS INITIAL,
      l_pack type zhd_vendor-lifnr.

Regards
Pavan
Former Member
0 Likes
Hi Vani,

Your blog is really usefull. But can you expalin your data declaration part please. Really i was unable to understand what are the fields or strutures used such as ZHD_VENDOR & ZVK_VNDBNK. What are the fields you have taken in this data declaration??



DATA: wa_VENDOR type ZHD_VENDOR value is initial,
      lv_subrc TYPE sysubrc VALUE IS INITIAL,
      lt_messtab TYPE STANDARD TABLE OF bdcmsgcoll,
      l_key type SWR_STRUCT-OBJECT_KEY,
      wa_VNDBNK type ZVK_VNDBNK VALUE IS INITIAL,
      l_pack type zhd_vendor-lifnr.

Regards
Pavan
OttoGold
Active Contributor
0 Likes
Hello, I am not sure if anybody will receive the comment after all that time, but if so, could you please ask a moderator to add this post into the Adobe forms category as well? People keep asking why there are no beginner blogs in the category, probably it was created after this blog was published. Thank you, Otto