A question by Mr. Jean-Pierre Loquet attracted my attention. He asks about Printing remote PDF. The problem is like this: There is a PDF template (of course the template must have appropriate format or you won´t be able to use it in the following scenario) on an external non-SAP server/ webpage. The programmer wants to use this template the same way he would use a form template saved in the SAP system (transaction SFP, integrated LCD in your SAP GUI etc.).

I feel it could be difficult to figure out what are all the important parts of the puzzle and how to glue it up together, so I blog about it. It could also help people whose scenarios are slightly different but they could use a part of the process I am going to describe.

So, let me describe me idea about how to implement the scenario

The basic idea/ where to start from

  • The idea is based on the demo report provided by SAP, it is called FP_PDF_TEST_19. This report lets the user to read a form template from the hard-drive, read the XML data file from the hard-drive and merge it together using your ADS service (note: you need to have the ADS service installed and configured, so make sure you have it before starting to implement this).
  • Now we can split the problem into three parts: how to get the XML data, how to get the template, how to merge it together. The third part is obviously solved by the source code of the mentioned report, so that is not a problem and I will only discuss the first two parts.

How to get the XML data

There are multiple ways how to do this, I believe. First: you need to understand what data you need to use. For this purpose the ADS trace fits the best. Go to SFP, options, set the trace to very detailed trace and print some form of yours. In the attachments section you get the set of the debugging files, which you can use for various debugging (like to check if the data are coming from the backend, if there are any problems with javascripts within the template etc.). And one of the files is a XML file with data coming through the interface from the SAP system. Use the file to understand how you should shape the XML file you will merge into the template.

For those who are not aware of it, you can generate the testing XML file from the LCD as well. Go to: File - Form properties - Preview - Data file and have the file generated by the LCD. This probably fits the best the process where the template comes from an external SAP source (but still had to be designed in LCD).

Now you know, how you need to shape the XML. (To be precise: you cannot use any SAP tools for this since you don´t have the DDIC structures and an interface for the external form, right? But you could create the structures and use it in an interface, which will not be implemented by any SAP form template. Or you could change the process flow of the forms: create a template in the SAP system (with the interface etc.) and using some job you will export the template so the forms are available on the external "site/server" like it was needed in the original scenario. Then you would be able to simplify things: you could use the ordinary forms printing instead of this complicated one. But that is another story).

Let´s create the XML file now. There are ways how to do it. You can create a simple transformation, write the XML envelope as a static text into a body of the transformation and dynamically fill the variables into the specified place. If you´re interested in the transformations, there are plenty of course where to read about "ABAP simple transformation". Or you can create a DDIC structure corresponding with the structure of the XML file and use transformation ID to do the most of the work for you. I hope you have the file now.

How to get the file

In the report mentioned above you can read how would you read the file if it would be saved on your desktop. You need to change the process so it can be done by the server without the user interventions. There are several ways how to do it and I will let you search for the details. An important question is when the server will download the template from the external source. Every time a form is printed from SAP? Or a synchronization tool should be created for this purpose? It is up to you and the process.

Alternatives and non-ABAP tools

If you don´t like this way, I am sure there are alternatives, but I am not aware of any alternative in ABAP. If you can use Java and can do some Java, you can use iText library to manipulate the PDF file. You would read the template into Java, set the fields one by one, and save the new file filled with data. But you mostly don´t have the option to run external Java (ok, you could do it from the Portal for example, but could be an issue from ABAP).

By the way, sometimes it is very useful if you can use the external tools, for example when you Converting multiple files in a PDF-spool-job into one sinlge PDF (what is not possible with the current version of Ads, I believe, correct me if I am wrong, because it would help hundreds of people, check for yourself how many times this question was asked in the forums).

Hope these lines will spare somebody some time. Please comment, I am ready to improve the text with any ideas you might have. Regards Otto

I am interested in the user productivity and its connection with the GUI which the users use to do their jobs. I feel a big difference between the most used GUI technologies: SAP GUI, EP/WD/web development for SAP and SAP Interactive forms by Adobe. Also the target groups for these GUIs - imho - are different as well (yes, that is not what you see every day - mostly forms are embedded into the portal, designed to be not-that-simple web services client etc.). These all are the reasons I think it is important to drop a line on this topic - how to fill the form.

Imagine you would give some simple and pretty Adobe form to your grandma. I think she will make it to fill it. She´s doing forms for all her life (post office etc.). Now close your eyes again and imagine you would give her your favourite SAP GUI transaction (e.g. PPOME or ME23N for meJ). Would she make it? Do you agree now you should approach the Adobe form application a bit different than you´re used to when working on WD or SAP GUI screens?

Maybe you will find the topic a little bit odd, but for me Adobe forms are the best interface for the occasionally working user with no or very little computer skill. Most of the topics covered so far very pretty technical.

On my project for the Public sector I was asked to think about the possible ways to work with the "help texts"/ filling instructions and other "attached texts". The number of the users will be pretty high and the impact on the help line or (if the forms were designed not bullet-proof enough) impact on the number of errors. That would be unacceptable. Also the level of the computer skills among the users will be very different. Because of all these reasons all possible helps texts have to be included. But have to be included the way they won´t distract the experienced users.

So I come up with some options how to work with help texts:

  • 1) (Basic) In standard of the forms there are tooltips (tab Accessibility - Tooltip text)
  • 2) (Basic) You can always include some simple static texts about what the user is supposed to fill in here. (My favorite bonus is to create some nice headline which looks like a hyperlink (colored and underlined) or a button which unwrap the longer help text. This is very fast and simple, you only manipulate the help text presence)
  • 3) (Quick win) Do you know it is possible to use floating fields in your static texts? It works the same way when you embed the variables in the standard texts (transaction SO10). You place a floating field into the static text, maintain the binding for the floating field and voila!... there is a nice dynamic text. For example: Dear {username}, please blah blah...
  • 4) (Idea) Our users expect there is something like (F1) help in Adobe forms like in SAP GUI. F1 calls the Adobe Reader standard help, so you cannot use this to call your custom help "window", but you can implement for example little buttons with "?" caption to call these custom F1 helps. Now it is time for a trick - use positioned subforms (although I don´t like themJ) and place them at each other (like 2 layers), resize the help subform to make it smaller (for example A5 format on A4 page), color it and add the help headline. Call this subform (of course with different texts) from you "?" buttons (do not forget to place a button doing "hide me" on the help subform. Looks impressive (help partially overlaps the form layout). For scripting details you´d better read the guide (the solution is not described there, but all the details needed to build it yourself are): LiveCycle Designer Scripting Basics.
  • 5) (Standard text) The customer supervisors want to write down some fill-in instructions to help the users finish their task in the form. And these texts can change. So revise your standard texts knowledge and use them in your forms. Choose the proper text type from 3 options available and add text elements right into your form context. To get the idea with pictures, check the wiki about Using standard texts (SO10) in the Adobe forms.
  • 6) (Attachment) If there is a man (for example in another department) whose job is to write the manuals (simplification, of course) and he has written a manual/ instructions about how to fill in the form, you can add his PDF/ Word DOC or any other file as the attachment of the form. If you don´t know how to work the attachments: Check how to work with the attachments using JavaScript (or WD Java - removing attachment from interactive form), and ESPECIALLY (because you will probably not use any scripting when only attaching the instructions, that was mentioned only because people ask about this very often in the forums...) check the ERP standard reports (using the naming convention FP_*) which work with the attachments: FP_PDF_ATTACHMENT_TEST.

If there is an option I didn´t cover (probably there are some...), please share it with the other readers through a comment. Your feelings and experience is welcome as well, because the Usability of the forms is a great "feature" a great benefit about Adobe forms.

Have a nice day everybody, regards Otto

This blog should help the beginners or the people who need to quickly do some minor enhancements in the SAP standard Adobe forms. The whole enhancement process is covered and important questions/ decision are described and answered.

 

First of all I would like to warn you that quite many SAP standard forms are a little crazy. No guidelines and best practices for the Adobe forms development were followed and thus it is a little troublesome to use or even change some of the forms (of course only few are not that good in my opinion and of course I didn´t have the "pleasure" to check all the available forms). Because of that it is important to decide if you can accomplish your task with the standard form (with some LITTLE enhancements) or if it would be better to start from scratch.

Which part of the form printing scenario to reuse

If the standard form suits your needs and you only need to realign the layout a little, translate the texts, add a logo, add a note for the user or add a field or two, definitely use the SAP-standard form. I would recommend using the standard form for the complex and difficult finance or logistics problems as well.

Even if the form is not too complex, you must always keep in my there is a printing program associated with the form which extracts and transforms the data needed for the form.

If you would use only a small part of the delivered functionality, consider starting from scratch. Well, you don´t have to recreate everything. You could reuse the printing program and create only a new form for example. In that case you will have to decide, if you will create your own form AND the new interface or create only a form (the layout) and reuse the standard interface.

You will probably reuse the interface if you will use most of the data prepared in the standard interface by the standard printing program. You will probably not use the standard interface if it is messy (some are a little messy, in my opinion), if you would use only a few fields of the big set of data (remember you can achieve a better performance if you de-activate the nodes not needed in the form layout) and especially if you can get the data you want, but not all and/ or not in the right format (for example there are the lines of some type, but half of the fields you need to use in the form is missing).

If you will reuse the interface, you need to find the very end of the printing program, where the name of the form can be changed easily (or find the customizing where you can do it the right way!), and repair the program.

If you want to change as little as possible

I will describe what steps you need to perform when you want to keep all the standard parts of the form printing scenario. You have two basic options:

  • You will not change the printing program, you will change the form interface and the form layout. ABAP coding to get some new data or change the standard pre-fetched will be done in the initialization part of the form interface.
  • Or you can move the changes out of the form and change the printing program as well - add a function module call into the printing program (just before the printing itself, you know all that FP_JOB_OPEN and stuff) to compute/ extract the new fields for you and change the call of the form, where the new items in the interface must be added explicitly.

Pick an option, the choice is up to you. Let´s describe the other details:

  • Open your interface first: add all the new fields you cannot find in the standard interface and you need to have them in the form layout here. Now the rest of the work is split into two parts - to be done backend (change of the printing program, ABAP coding in the interface or in the printing program to get the data) and to be done in the form layout (add the fields on the form).
  • Do the ABAP coding. Choose if you will place it into the initialization part of the interface (then no printing program changes are to be made) or you will repair the printing program
  • Change the form layout. Add the new field from the Data View (mostly the tab can be found on the left side of the LCD). If you don´t know how to operate the designer, you can just drag&drop the field (from the data view to the form layout).

Testing the solution

Just run the enhanced form and wait for the result. If something is not going as expected, check these (in my opinion the most often made mistakes):

  • Check the binding of the new fields (binding is the mechanism how to assign the fields of the layout to the variables in the backend/ form context/ form interface - well, the data you send from your ABAP program).
  • Check the values coming from the backend. Sometimes unexpected values appear and the form stops working (my favorite behavior is when the problem occurs for a single business document out of the thousand, where some crazy testing value like ABC can be found in the place where the number was supposed to be).
  • If there is any scripting in the form, check it. When a syntax error is reached, the script is ended, which may produce some interesting behavior. Here can help you to upgrade to the newest version of LCD (what is 8.1 at the time I write this blog, check SAP note 1176858), where the scripting support is better.

Hope that will help some people not to struggle with the standard forms and remember: use the versioning, both for the coding and for the form objects! You may think that is for loosers, but you will understand at the moment your whole-last-week-work will stop working and you will not be able to find the moment when everything went wrong, what causes the problem or how to find the solution (and implement it on time).

Regards Otto (you´re welcomed to SAP Interactive Forms by Adobe)

p.s.: Just in case you don´t know if there is a form you can use to satisfy the needs of a customer, you can check the list of the standard forms like this: Go to http://service.sap.com/erp  (SAP ERP) -> Media Library - SAP ERP Overview -> Detailed information cross ERP -> Adobe Forms for SAP ERP

Otto Gold

How to write a messy form

Posted by Otto Gold Feb 5, 2010
I have taught beginners in my company how to create Adobe forms (and some of them are very lazy at the beginning... and at the end as well). I have helped some people in the SDN forums (which are new to Adobe forms as well, or were asked to repair "a little bug or two" and they don´t do Adobe for their living). And I have continued the development of the forms originally created by other people. I have found what dirty stuff people do in a hurry or just because of the mentioned laziness. This blog article is not a brand new idea but continues the idea presented by Bernhard Escherich  in his blog post "Damaging your SAP Interactive Forms by Adobe project effectively": Damaging your SAP Interactive Forms by Adobe project effectively. The only reason is that his blog post was non-technical and mine is about the planning and development.

I am known for my extreme opinions so maybe you will read about things you do "every day" in your Adobe forms or you don´t consider them to be bad. In that case we can expect a nice discussion :))

 

What people do and should be doing in Adobe forms: (bad or causing errors).

  1. Start the development immediately! - I have posted a blog called "Adobe forms: Use your imagination (first!)" (can be found here: Adobe forms: Use your imagination (first!)). A developer can avoid most of the problems using the proper/ suitable design (like when you use table of tables instead of a plain table to use sub-headers etc.) . It helps with the formatting of the form, form behavior through scripting etc. Mostly people are in a hurry or are used to design forms in one way and do not think about the consequences before they actually start the development.
  2. Change SAP standard forms although you need like 5% of the standard features - this is my favorite advice and based on m personal experience. If you would like to share the feeling, please find the MEDRUCK form in your ERP and check the form layout and the interface/context. You will find quite a complicated layout with a lot of scripting (especially what is seen based on which variable tec.) and of course a lot of data. I was asked to create a MM form for PO and the given problem was quite far from what the standard MEDRUCK does, but a colleague of mine recommended me (very much beginner at that time) to use the standard form and adapt it. I spent days trying to change it the way I needed. At the end I created a brand new form in a day and satisfy my customer.
  3. Use a lot of in-form coding, it´s fun: SAP recommends and I recommend not to script a thing in your Adobe form if that is not necessary. That is a sentence I repeat at least once a day in the Adobe forms SDN forum. Scripting is not fun, it is sometimes very irritating (at least for me) to read/ write / change / debug scripts for some special cases etc. Scripting is what I use only in Adobe forms only, so this skill has very little value for me - to be the expert Adobe JavaScript coder. If that is possible, move all your data changes to the backend - everybody can write some little ABAP (sorry, Java bros) and this skill (ABAP development) has the value itself. I use only JS script coding and 99% only for changing presence of objects (visible ßà hidden). BTW: if you would like to have some more fun, use both languages in one form, or better... in one object.
  4. Try to implement the scenario these forms are not made for: My favorite questions in the forum are about things that cannot be done or you grow old first. Forms are a super-cool GUI technology but they are expected to be simple/ straightforward/ easily maintainable etc. Use Adobe forms as "forms", not as a brand-new-portal technology, much-better-than-bugzilla technology or super-secure-hidden-secrets-whatever. For example do not try to do actions which you don´t want the user to confirm. I call these "silent actions" and they´re a (1) security risk (2) not possible at all or need weird workarounds. Yes, printing without confirmation can be useful. But to send/ receive something without the user's knowledge is not a good idea (just an example). Do not try to make your form send himself somewhere. If you have recognized some of your ideas, go write sci-fi, not Adobe forms.
  5. Always start from scratch: do not share any parts between your forms. Do not write reusable scripts. Especially do not create custom library components!! (for everybody who is interested, I have written a blog about it: Adobe forms: About the custom components). Be careful and always make sure your forms headers are all different (very good with business and HCM forms, your customers and employees find that very amusing...). Secret: Do not use variables and scripting objects! Never!
  6. All form variants should share a single SFP/ form object: Sometimes you need to create the variants of the basic form. For example for various departments. Or for the process roles. Try to keep all the variants within one form. Do not write a word about these variants nowhere in the backend coding or in the form. Use a lot of coding to change the form appearance and behavior based on these variants (do not use variant codes, use only form fields values combination for your long if clauses). Tell everybody that you´re a hero and you´ve spared a license or two because you´ve created a super-combo-multi-purpose form.
  7. Use obscure options how to do things:

 

  • Use interface coding whenever it is possible. It is always fun to continue the form development where there are some ghost friends (data extraction/ transformation coding can be found on various places, combination with in-form scripting helps a lot).
  • Use hardcoded values in your scripts, it is always fun to guess what they mean.
  • Use tables (I mean the element table, like the MS Word table, not a table created from subforms and fields), they have so many features you cannot get any other way.
  • Use positioned subforms. It is so good to slide the elements there and back every time you need to change the caption to re-fit the form. And they look so good. I would say... precise!!

          Yes! It can be done! But that does not mean you should do that.

 

In the following days and weeks I am sure I will find some more pieces of advice about how write the messy forms. So this is probably not the last post on this topic. Remember Einstein and his legen-wait for it-dary quote: "Only two things are infinite, the universe and human stupidity, and I'm not sure about the former."

P.s.: I hope this post won´t get misunderstood.:)))

I try to help people with their problems/ questions in the IFbA forum like every day and what I have found behind most of the questions (not the basis ones like "my ADS is not working, help me, its urgent!!") is that people don´t know how to solve problems in more than a single way (or even not a single one) and has no imagination to come up with a new/ better/ faster (etc.) approach.

Behind many questions there are people who can do some basic things in Adobe forms (because that is not their job, how many of us has worked on the projects, where there were so many forms that the project could pay a guy for the Adobe forms only...) and are frustrated these basics don´t fit to the clients' needs. Sometimes you need to/ must completely change your approach because the way you´ve chosen is very awkward to do or use, not scalable, not maintainable or doesn´t solve the whole problem ("nobody wants to say "I have succeeded with the half your task, don´t expect the second half" to his client). Sometimes it is enough to use these basics in a little different way and you don´t need any "advanced" techniques.

That leads me back to adapted proverb: "think first, think in variants, develop later". You can spare some time or your good temper:))

For example, there are questions like: " I would like to use Adobe forms in my workflow." (Why? I ask. How?) "Because my clients want me to do" (Mostly means that the client is using Adobe and wants to use it everywhere:))).

My typical answer:

Do you want the form to be a transport medium? (If you write the data into a form only to spare the backend coding for every WF step - you don´t need to save the data from every WF step, mostly the last one is enough. It also answers the question if the form is WD/ online - because you would have to maintain all the steps in the backend, WD is only a screen and doesn´t hold data itself, but the offline/ saved filled form can hold data).

Do you want the form to be send as a change notification? Or do you want to archive the WF steps result (like in GOS etc.) (You can use the WF data to print a print form and send it through email to notice somebody that a change has been made and he needs to archive the file, send to the partner/ client etc.)

Through what GUI can the user access the WF? If he can use the portal, then the WD form is an option. You can also use the "off-SAP workflow" with the offline form, which is only uploaded back to SAP through portal (or SAP GUI user which has mostly the better license type).

Do you want to use some Adobe+WF framework (like HCM P&F, ISR)? (obvils mason). Etc., etc.

Is it always better to be able to choose the approach or to let your customer choose it. You won´t get caught in the corner with something you can´t do.

Like my first morning post today:

Question: We have a requirement where we need to display the address which is fetched in to a internal table in a block in adobe interactive form.

My answer: There are options how to send the address into a form:
1) There is "business address service" (BAS: http://www.****************/Tutorials/AdobeForms/Address/WithBAS.htm).
2) There is a way how to directly send the standard texts into the form - through context text elements.
3) To format the address you can use multiple text fields arranged in the positioned subform. You can use the "standard custom" Library component Address block (tab Custom in your LCD). If you would like to use this option and doesn´t like the "standard custom" address, create your own Library component with this blog
4) You can also use the static text with floating values within (right mouse, floating field)
5) you can use the table, sure, create a subform table, subform line/ row, create a single text field to display the string line from your backend source table, do the binding
Comment: maybe the data are not extracted from DB/ prepared for the form the right way, so you can´t use some of the options. Maybe you can use the other way, which will make coding faster/ easier, helps the user maintain his data with some more comfort etc.

Hope this helps you/ inspires you to think about "thinking in variants". Have a nice day, Otto

I write this blog because I am working on a "not-small" project where it is very helpful to share the parts of the forms and this way speed up the development. I would like to tell the SDN word few things about the custom components/ LiveCycle designer elements, which can help you build reusable form parts and get your Adobe forms development to the next level. Hope I didn´t miss a blog post by some other expert on the same topicJ

You have to know what the "standard" components are; you use them every day when developing the forms. They are the text fields, drop downs, buttons etc. Note you can build your own custom components = reusable blocks of your forms, like the form header, form footer etc. which you would like to share among all the company forms (you place a logo there, user information who generates the form, you need to have all the header texts using exactly same styles etc.). You can use it anytime by just dragging and dropping the component the same way you do with the text field. Miracle is here. This can speed up/ help you maintain the form styles considerably.

How to create your custom components:

In the Hierarchy tab mark the subform you would like to reuse/ you would like to save as a reusable part. In the form layout tab click right mouse on the subform (this is sometimes very difficult, the editor does not help you, it took me some time to create that few components I use). Here choose "Add to Library...", write in the name, the description you will find useful and pick a Library group/ tab to save the new custom component to. Now somewhere on your hard drive (on your local PC!!) XFO file was created. You can find the location of the file (of the files in the group/tab) using "Group properties..." in the "right-arrow-menu-in-library-tab". But I was not able to find this location on my hard drive. Maybe I did something wrong. That´s why I have to find a workaround to get the files, use the "how to export" part below.

How to share/ export your custom library components:

At the right side of the library tab in you LCD there is a small but important arrow. If you use it to open the menu, there is a menu item "Shared Library location...". This you can use to build one central shared library for the components from different developers on the same project or to have your custom components available on every machine you may work on your forms.

How to export/ import your custom library components:

Using the same arrow, there is a menu item saying "Group properties". As mentioned above I was unable to locate the file path on my hard drive. I managed to export the xfo files this way:

  • 1) I created a new folder on my desktop
  • 2) I created a new tab/ group in my LCD library and in the group properties I set the path to the folder I created on my desktop in step 1
  • 3) I went to the tab/ group where my custom component was saved, right mouse click, choose "Move Object to" and choose the tab/ group from step 2
  • 4) Check your (desktop) folder, you should find a xfo file you can send/ share etc.

Filter Blog

By author: By date:
By tag: