cancel
Showing results for 
Search instead for 
Did you mean: 

Hiding fields in an SAP Adobe Form using ABAP code

Former Member
0 Kudos

I have an SAP Adobe Form that is being executed from an ABAP program. I am passing a group a data fields to this form from the program. In order to display the data from these input data fields, I have created a corresponding field on the form for each input field and bound it to each input data field. My problem is this: if the input data field value is empty (spaces or zeros), I do not want to display the corresponding form field. Once the field is hidden, I would like to be able to compress the lines below it upward on the form to fill in the space left by the data field that we chose not to display.

I am only using ABAP and the Adobe LiveCycle Designer to create and fill this form (no Java or Java Script). Does anybody know a way that I can achive what I am trying to do, or is this not possible using ABAP?

Thank you in advance for any sugesstions I receive.

Accepted Solutions (0)

Answers (4)

Answers (4)

OttoGold
Active Contributor
0 Kudos

Hello, I wonder how did you solve your problem/ developed your form? Probably there is some experience you can share with other people here to spare their time in future (because they will find your answer when doing the search). Would be great to hear how did you finish the task, (and close the thread), regards Otto

OttoGold
Active Contributor
0 Kudos

For some JavaScript to work the form must be dynamic. Well... it is not because of the JavaScript needs the form to be dynamic but the form needs to be dynamic so it has an internal structure (a print form, without DYNAMIC or FILLABLE has no internal structure, you can test it: generate such a form, save it on desktop, open it in standalone LCD, you´ll be prompted to import the form - soo it cannot be jost opened since that is not a form).

This internal structure is needed to make some changes in the form. I am not sure and don´t want to tell you some nonsense, but for example to add elements, remove elements and this "structural changes" of the form work only if the form is DYNAMIC. You don´t have to worry about this at the moment, ubt the day will come when you´ll understand that it has a meaning. You will script something which won´t work because there will be no "internal form structure" in place.

Otto

OttoGold
Active Contributor
0 Kudos

Hello

Sometimes you can spare the coding. But you will have to find the details for yourself or use BC450 to help you find these.

In the context you can create the alternatives (or something like that). You create a condition a if the conditions is not passed, the whole node of the context is not send to the form. Then the part of the form is not visible and you don t need any coding. But it is a little tricky. I would root for the scripting. It is very VERY often used in Adobe forms.

Regards Otto

Former Member
0 Kudos

Hi Otto,

you have to help me with one thing regarding this JAVA stuff.

You told me that a form needs to be dynamic/interactive to be able to process Java. There was a discussion between you and somebody else whether "dynamic" is sufficient or not As interactive forms have a special lizense agreemend and our company will not spend money for interactive form lizenses I changed the complete interface to hide/show objects via subforms, alternatives etc. A hell of a job!

Now two weeks later I am more familiar with Java and just gave it a try. My form is called via functional modul, has the dynamic/interactive parameters NOT set, has a DDIC interface - and Java works perfectly.

Under these circumstances I would have immediately started to learn Java for Adobe and implemented the hide/show issues with Java.

I just would like to understand what you meaned by "Java needs the form to be dynamic/interactive" and maybe I just did not understand you. Does Java needs the form to be dynamic (by a checkmark in the functional modul) in order to run (obviously not...) or is a form using Java automatically a dynamic form that needs extra lizenses?

I somehow dont understand and have the feeling that there are a lot of wrong opinions in this forum.

Former Member
0 Kudos

Are you confusing the java script inside the Adobe form with Java Web Dynpro?

Java script inside the form doesn't need more licenses. i believe if you want to make it interactive & SUBMIT data back to SAP, you will need the extra license.

SAP doesn't know/care what you do inside your form with java script or formcalc.

Former Member
0 Kudos

I do not believe it's possible to control the behavior of the fields based on values without using FormCalc/Javascript. Once you call the form, Adobe has full control.

Can I ask why you do not want to use FormCalc/Javascript? It's really simple to hide a field if the value = 0.

Lastly, yes, if you wrap your fields in a flowed subform, they can be compressed if fields are hidden in the form.

regards,

Robert.

Former Member
0 Kudos

Thank you for your response, Robert.

The main reason for not using FormCalc Javascript is lack of knowledge in it. Can you point me in the right direction on how and where I would even make such Javascript changes? Do I need to use ABAP of JAVA Web Dynpro, for example, instead of just calling an Adobe form directly from an ABAP program?

Any info you can provide would be greatly appreciated.

Former Member
0 Kudos

Tim, a change like this is really simple.

Formcalc and javascript are pretty similar - when I started developing AIF a year ago, I knew nothing about either of them... not that I know a whole lot now...

The Help in Livecycle designer is actually quite helpful when it comes to scripting. Also, there's a google group you can join where you can email questions for help.

You would just call the form like you normall do. The code is placed INSIDE your form "under" your field. There is a script editor built in to Adobe - Click Pallettes -> Script Editor to see it.

there are many events on which to place code - you will need to find an event that triggers early - such as Form:Ready etc...

Here's an example I have with 2 radiobuttons and a text box. If my 'yes' radiobutton is chosen, I make my input box visible


if ( yes.rawValue eq "1" ) then
data.Page2.grp2.func.rb.ifyes.presence  = "visible"
endif

Same concept if my 'No' button is chosen


if ( no.rawValue eq "2" ) then
data.Page2.grp2.func.rb.ifyes.presence  = "hidden"
endif

Both of these scripts are in the "click" event of the radiobutton.

Lastly, here's a link to a great resource on Scripting

http://www.adobe.com/devnet/livecycle/articles/lc_designer_scripting_basics/lc_designer_scripting_ba...

Scripting, on a moderate to small scale, will make your life a bit easier. Don't try to do too much, otherwise you'll find AIF may be the wrong tool for what you're trying to do.

Former Member
0 Kudos

Hi Robert.

Thank you for the very helpful information. I will spent some time looking at the Scripting Basics document that you linked to - hopefully this will be exactly what I need to hide and compress the forms fields.

It is very much appreciated.

Tim