Skip to Content

How to enable javascript coded actions in adobe forms

Hi,

I have created a form where you can add new items to a table. The add-button has the following javascript code :

Table._Item.addInstance(1);

xfa.form.recalculate(1);

This works when i push the preview pdf tab. But when i launch it via a program the button isn't doing anything.

Any ideas to fix this?

Here program to generate form :

PARAMETERS AIFname TYPE fpname.

DATA: fm_name TYPE funcname.

  • First get name of the generated function module

call function 'FP_FUNCTION_MODULE_NAME'

EXPORTING

i_name = AIFname

IMPORTING

e_funcname = fm_name.

DATA: fp_outputparams TYPE SFPOUTPUTPARAMS.

  • Set output parameters and open spool job

*fp_outputparams-nodialog = ''. " 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.

  • Set form language and country (->form locale)

DATA: fp_docparams TYPE sfpdocparams,

lt_employee TYPE zemployee_tbt.

fp_docparams-langu = 'E'.

fp_docparams-country = 'BE'.

fp_docparams-FILLABLE = 'X'.

  • Now call the generated function module

call function fm_name

EXPORTING

/1bcdwb/docparams = fp_docparams

  • IMPORTING

  • /1BCDWB/FORMOUTPUT = fp_formoutput

EXCEPTIONS

usage_error = 1

system_error = 2

internal_error = 3

others = 4.

CALL FUNCTION 'FP_JOB_CLOSE'

  • IMPORTING

  • E_RESULT =

EXCEPTIONS

usage_error = 1

system_error = 2

internal_error = 3

OTHERS = 4.

IF sy-subrc <> 0.

  • <error handling>

ENDIF.

kind regards

Jonas

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Best Answer
    Nov 08, 2009 at 09:35 PM

    try to setparameter fp_docparams-dynamic = 'X'

    Norbert

    Add comment
    10|10000 characters needed characters exceeded