cancel
Showing results for 
Search instead for 
Did you mean: 

Send ADOBE FORM as email

Former Member
0 Kudos

hi all,

Does anybody knows what all parameters to be passed to FM 'FP_JOB_OPEN' to send the adobe form as an email .

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Once the vendor fills the form and sends it back the data needs to be extracted from the PDF file. In this

example we are assuming that the vendor sends back the whole PDF file. But we can also make it easier

  • First get name of the generated function module

call function 'FP_FUNCTION_MODULE_NAME'

exporting

i_name = 'ZVK_TESTHD'

importing

e_funcname = fm_name.

Start the Form Processing

Form printing needs to be explicitly opened and closed. Use the function FP_JOB_OPEN to open the form

for printing. The parameter ie_outputparams determines printer settings. This parameter is also where we

ask the generated function module to return a PDF file back. Since this is an offline scenario and there is no

printing involved we need to suppress the printer dialog popup as well. Optionally there is a parameter

connection which can be used to determine the RFC destination for ADS.

  • Set output parameters and open spool job

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

Call the Generated Function Module

This is similar to the generated function module in Smart Forms. Since the parameters of the function

module are defined in the interface, this will vary from form to form. However, /1bcdwb/docparams is a

standard parameter. This is used to set the forms locale. This is also where we tell the form that it is fillable.

Once this parameter is set - if the ADS is configured correctly (including the credential) - a fillable savable

form will be returned when the function module is executed.

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

fp_docparams-langu = 'E'.

fp_docparams-country = 'US'.

fp_docparams-FILLABLE = 'X'.

  • Now call the generated function module

call function fm_name

exporting

/1bcdwb/docparams = fp_docparams

Z_VNDBNK = wa_vndbnk

importing

/1BCDWB/FORMOUTPUT = fp_formoutput

exceptions

© 2006 SAP AG 7

usage_error = 1

system_error = 2

internal_error = 3

others = 4.

End Form Processing

Use the function FP_JOB_CLOSE to close the form for printing.

  • Close spool job

call function 'FP_JOB_CLOSE'

exceptions

usage_error = 1

system_error = 2

internal_error = 3

others = 4.

Try this.

Regards

Rohini.

dhruv_shah3
Active Contributor
0 Kudos

Hi,

check this,it may help you.

example

To get an overview idea about Adobe forms ,

Using SFP Tcode , first you need to create a interface . in interface you can declare the import and export parameters and also the declaration part, coding etc : This is nothing but similar to Function module interface.

And now we have to create the Form which is interactive. Create the form and enter the interface name which you have created in first step, so that the parameters , declarations of fields etc : will be copied and available in the form layout. So that you can drag and drop these declared fields ( dclared fields of interface ) to the layout.

Create the context and layout in the form.

The layout generated can be previewed and saved as PDF output.

Now we need to integrate the driver program and the PDF form to get the final output as per the requirement.

On activating and executing the form you will get a function module name just similar to smartforms.

The driver program needs to call this FM.

Refer to the below sample code :

DATA : is_customer TYPE scustom.

DATA : it_bookings TYPE ty_bookings.

DATA : iv_image_url TYPE string.

DATA : iv_sending_country TYPE adrc-country.

DATA : it_sums TYPE TABLE OF flprice_t.

DATA : docparams TYPE sfpdocparams.

DATA : formoutput TYPE fpformoutput.

DATA : outputparams TYPE sfpoutputparams.

PARAMETERS : pa_cusid TYPE scustom-id.

SELECT SINGLE * FROM scustom INTO is_customer

WHERE id = pa_cusid.

SELECT * FROM sbook

INTO CORRESPONDING FIELDS OF TABLE it_bookings

WHERE customid = pa_cusid.

outputparams-nodialog = 'X'.

outputparams-getpdf = 'X'.

*outputparams-adstrlevel = '02'.

CALL FUNCTION 'FP_JOB_OPEN'

CHANGING

ie_outputparams = outputparams

EXCEPTIONS

cancel = 1

usage_error = 2

system_error = 3

internal_error = 4

OTHERS = 5.

IF sy-subrc 0.

MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno

WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

ENDIF.

docparams-langu = 'E'.

docparams-country = 'US'.

docparams-fillable = 'X'.

CALL FUNCTION '/1BCDWB/SM00000043'

EXPORTING

/1bcdwb/docparams = docparams

is_customer = is_customer

it_bookings = it_bookings

IV_IMAGE_URL =

iv_sending_country = 'US'

IT_SUMS =

IMPORTING

/1bcdwb/formoutput = formoutput

EXCEPTIONS

usage_error = 1

system_error = 2

internal_error = 3

OTHERS = 4

.

IF sy-subrc 0.

MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno

WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

ENDIF.

CALL FUNCTION 'FP_JOB_CLOSE'

IMPORTING

E_RESULT =

EXCEPTIONS

usage_error = 1

system_error = 2

internal_error = 3

OTHERS = 4

.

IF sy-subrc 0.

MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

HTH,

Regards,

Dhruv Shah