cancel
Showing results for 
Search instead for 
Did you mean: 

Adobe form code initialization with HCM Processes and Forms?

Former Member
0 Kudos

Hi,

We're trying to dynamically determine some language-dependent text label values in the form interface code initialization routine before displaying an interactive PDF form. All works fine when using the transaction SFP test tool, label values are dynamically determined using the code on the PDF printout.

However in our case, the interactive form is embedded in a HCM P&F scenario and when launching the process form WDA application from the UWL, it looks like the same code initialization code is executed (when debugging it) but the values are not updated on the PDF when displaying.

Any ideas how to go forward? Should we instead be using an ISR BAdI or such to do the same thing? We do not want to store all the label fields in the HCM P&F form scenario, because they are not supposed to be stored in HCM, we just need to dynamically display some text labels on the PDF form.

We're on SAP ERP 6.0 EhP4, NW 7.01.

Best regards,

Mikko

Accepted Solutions (1)

Accepted Solutions (1)

ChrisSolomon
Active Contributor
0 Kudos

WHAT?!?!

Not following you here. You said "language dependent". So why not have your label and simply have your form translations handle the display of that label in the needed language.

If it's more than that, please explain a bit more. From the sounds of it though, you are making it much more complicated than needed.

Former Member
0 Kudos

Hi Chris,

thanks for your answer. Just to give you some background on the requirement, we are dealing with the public sector and they are let's say quite strict about form appearances

To elaborate more, we have a need to build a single work contract printout PDF form for all the company codes (embedded into a second form scenario in our HCM P&F hiring process), because 90% of the layout and of all the labels in the work contract are common to all ccodes. Unfortunately for us, there are however some static texts / text labels with their translations whose customer requirements vary between the company codes. In addition, the customer is not ready to harmonize these texts mostly because of legal reasons. An example of this is as follows:

- ccode 1 label: work contract (+ translations to several languages)

- ccode 2 label: work contract approved by local union (+ translations to several languages)

- ccode 3 label: work contract signed and approved by local union and company (+ translations to several languages)

As silly as the requirement may seem, they are not ready to harmonize these labels into a single label because of these reasons (we have tried this many times without much success and told them about the technical difficulties to come). So we need to come up with a working solution

What we have gone forward with so far is a Z-table containing all the dynamic texts and their translations. We are now just looking for a way how to dynamically populate PDF form label values upon runtime. In normal PDF print form cases (= without HCM P&F involved), the code initialization routine works just fine. We bind the label values to the form interface elements and then upon runtime we populate the interface elements in the routine based on the incoming company code value.

But this is where we are stuck now. It seems HCM P&F somehow prevents or overwrites the changes done in the PDF forms code initialization routine when launching the PDF form from UWL and the HCM P&F process form WDA app and I'm looking for ways to make it happen.

Any ideas?

Kind regards,

Mikko

akimol
Explorer
0 Kudos

Q: Are you determining the dynamic texts and populating those in the interface/form scenario fields thorugh a backend service?

If not then please do try.

~Amit.

Former Member
0 Kudos

Hi Amit,

thanks for your help.

We wouldn't like to use the backend generic services in this cause because architecturally we would like to isolate the layout specific functionality to the form object as much as possible for reusability reasons. In addition, this would clutter the HCM P&F form scenario with fields not required by the form scenario itself.

For a similar reason, we wouldn't like to use the alternative of putting in label specific FormCalc/Javascript scripts and label elements on the form as suggested by Chris. This is because we have about 10 different company codes most of which have their own labels+translations and we don't want to put ~20 lines of code and 10 overlapping label elements per label to the form.

The code initialization at least seems to be a more clean approach, but I believe we would have to resort to the architecturally next best alternative (= PDF scripting and overlapping elements to be determined in the scripts) if we can't make it work.

Best regards,

Mikko

Answers (1)

Answers (1)

ChrisSolomon
Active Contributor
0 Kudos

Ok...still fuzzy on this but what about this....

Use a CASE statement in Javascript in your form ....for example in a subform where in you will have independent subforms for each company code. Then your script can determine based on which comp code which subform to show/hide. The content within those subforms can be handled by you as needed (ie. translation of texts, dynamic labels, etc).

You really can do all manner of things with layout, format, etc. with script, so you are not limited. On my past project we had a hiring form that due to the high licensing fees of AIF, we had to reuse for hiring/rehire AND had to reuse for EVERY step in our processes. So, we had to be very careful and make use of scripting to show/hide/rearrange the form as needed based on who/where the form was in the process. Kind of how I described above, we had a "help" section at the top of each form that described to the user what they needed to do on their form step. Using the same method mentioned, we would SHOW them the "help" subform section they needed while hiding all other ones. Likewise, we could inject "dynamic" content into that text.

So what I am saying is that what you seem to be wanting to do is very possible.

Former Member
0 Kudos

Thanks Chris,

valuable input especially in the area of HCM P&F is hard to get sometimes because there are not so many of us (at least yet!) who have been working on the topic, so a humble bow is in place to you (and Amit as well)!

Regarding our problem, we yesterday made the decision to go with the scripting based approach. This is because we couldn't make the code initialization work, so under the circumstances we really had no options other than to store the text object w their translations on the form itself. I'm still though quite confused about the code initialization approach not working, because with PDF print forms there is no problem with it...

In our case, we couldn't display/hide complete sections of the form dynamically because the dynamic label contents were scattered randomly on the form. Our solution approach was thus as follows:

- create a placeholder label element for all texts (9 of them) to their correct location on the form

- create company code specific labels (9 labels * 5 company codes/label = 45 in total) w their translations into the form header section and make all of them invisible

- in order to populate the placeholder labels with their correct ccode dependent value, enter the following pseudocode script

case ccode

when 1000

label.placeholder1.rowValue = label.place1.ccode1000.rowValue

label.placeholder2.rowValue = label.place2.ccode1000.rowValue

...

when 2000

label.placeholder1.rowValue = label.place1.ccode2000.rowValue

label.placeholder2.rowValue = label.place2.ccode2000.rowValue

...

This way we could dynamically populate individual labels and minimize the amount of scripting and isolate it to a single scripting location. If having done element specific scripting for all the labels individually, we would have produced a lot of redundant code when checking for the company codes and the elements would have also been hard to maintain.

Thanks for your help all, case closed!

-Mikko