Technology Blogs by Members
Explore a vibrant mix of technical expertise, industry insights, and tech buzz in member blogs covering SAP products, technology, and events. Get in the mix!
cancel
Showing results for 
Search instead for 
Did you mean: 
"Share your knowledge. It's a way to achieve immortality" - Dalai Lama

Based on above fact, I would like to share my experience here hoping that it could help some experts someday.

Requirement:

It was a fine morning until i receive this call saying "hey, We need to make our Adobe form to generate 4 copies each time when the output is triggered". Copies should be in order as below,

  1. Original Copy

  2. Customer Copy

  3. Vendor Copy

  4. Management Copy


I just learnt about Adobe forms and i started to search for solutions online. I couldn't manage to find clear examples. I decided to try by self which led me to write this blog to make life easier.

First, let me give an overview on my form layout.



We need to add an extra text field on top to the right of logo at the center of page which should display name of the copy.

An easy way would go like this,

  • Start spool Job via "FP_JOB_OPEN".

  • Loop N times.

  • Call Adobe FM within this loop with text name as a separate parameter.

  • Endloop.

  • Stop spool job via "FP_JOB_CLOSE"


But doing so will bring document navigator at top which means it will create as separate document which my functional is not happy with.

Solutions form my thoughts:

  1. My form has single page. I can copy the same page into 4 pages with copy names at top. But, I can't find any copy option. So this approach means i should develop same layout again and again for 3 more times.

  2. To use the current form page as a template.


To me the second approach felt easy and i went with that approach.

Steps I did for second solution.

Overall Idea: Each Adobe form will have a body page on hierarchy tab. My idea is to make this body page as table and encapsulate each subform within the body page in a subform which acts like row for my table(body page). My current layout is as below,



Procedure:

Interface Changes: First, We have different internal table as import parameters as below,



I have defined a custom deep structure which includes all these above internal table within itself. In Code initialization part,i have appended all values as required. example as below,



Now we have our internal table IT_INVOICE with all data. Lets concentrate on form layout changes.

Form Layout Changes: First change would be include the copy name text (IT_INVOICE-TEXT) at top of layout. To do this, Insert->Standard->Text Field and bind it to IT_INVOICE-TEXT as below.



From above Layout image, My page area name is "Main_area". select all layout elements in body page of form and wrap them inside a subform named "Body_row". (Select all->Right Click->Wrap in subform). Change below settings,

In Page subform(in my case "Main_area"): Palettes->object->Binding-> (Bind IT_INVOICE to this subfom and check "Repeat subform for each item" checkbox and give maximum as 1.

Also change: Palettes->object->Accessibility->Role as "Table".



In body_row subform: palettes->object->Binding->(Bind data[*] of internal table IT_INVOICE in this subform. Do check "Repeat subform for each item" checkbox and set Min Count as 1.

Also change Palettes->object->Accessibility->Role as "Body row".



We are almost done. Try to test at this point, Form will generate 4 copies sequentially without page break at each new copy( if 1st copy ends at middle of page 3, second copy will follow immediately instead of breaking to next page).

To achieve page break for each new copy, We can add conditional page break as below,



By this, we come to the end of development. Enjoy !!

Important Note: Each element in layout within body_row subform should be binded to respective element from within IT_INVOICE->DATA->[respective internal table]. If this is not done, values with only appear in first copy of Adobe form rest will follow empty.

Issue: one main drawback of above approach is page numbering which we need to resolve by javascript code. Presume my form has 2 pages of line items, Hence entire output will have 8 pages (4 copies) and page number will be like 1 of 8 .... to ..... 8 of 8. But most of our functional would require page number to reset to 1 for each copy. This i will cover in my next blog as i have handled this entirely in Javascript.

PS: I welcome comments of all kinds. I'm new to adobe forms. I'm not aware of any easier approach to achieve the same. If there is any easy approach to achieve the same, do let me know in comments. I do apologize for my bad language.
7 Comments
Labels in this area