cancel
Showing results for 
Search instead for 
Did you mean: 

usage error while generating spool for adobe forms

Former Member
0 Kudos

I need to create a function module which would be called from a BRF. The function module must generate an adobe form and sent to the spool.

I get usage error at the call form function module level. could someone suggest if anything is missing in the below code.

*"----


""Local Interface:

*" IMPORTING

*" REFERENCE(I_FORM_NAME) TYPE FPNAME

*" REFERENCE(I_BP_DETAILS) TYPE ZRP_STRU_RTRN_BP_DETAILS

*" REFERENCE(I_AMT_DETAILS) TYPE ZRP_STRU_RTRN_AMT_DETAILS

*" EXPORTING

*" REFERENCE(E_RETURN) TYPE BAPIRET2_T

*"----


DATA : gv_fm_name TYPE rs38l_fnam,

ga_outputparams TYPE sfpoutputparams,

gs_docparams TYPE sfpdocparams,

le_result TYPE sfpjoboutput,

gs_output TYPE fpformoutput,

l_return TYPE bapiret2..

Get the Form function module name

CALL FUNCTION 'FP_FUNCTION_MODULE_NAME'

EXPORTING

i_name = i_form_name

IMPORTING

e_funcname = gv_fm_name

E_INTERFACE_TYPE =

.

Open Print Job

ga_outputparams-device = 'PRINTER'.

ga_outputparams-nodialog = 'X'.

ga_outputparams-preview = space.

ga_outputparams-dest = 'LP01'.

CALL FUNCTION 'FP_JOB_OPEN'

CHANGING

ie_outputparams = ga_outputparams

EXCEPTIONS

cancel = 1

usage_error = 2

system_error = 3

internal_error = 4

OTHERS = 5.

call the generated Function Module

gs_docparams-langu = 'E'.

gs_docparams-country = 'US'.

CALL FUNCTION gv_fm_name "'/1BCDWB/SM00000014'

EXPORTING

/1bcdwb/docparams = gs_docparams

is_bp_details = i_bp_details

is_return_details = i_amt_details

IMPORTING

/1bcdwb/formoutput = gs_output

EXCEPTIONS

usage_error = 1

system_error = 2

internal_error = 3

OTHERS = 4.

IF sy-subrc EQ 0.

Close spool job

CALL FUNCTION 'FP_JOB_CLOSE'

IMPORTING

e_result = le_result

EXCEPTIONS

usage_error = 1

system_error = 2

internal_error = 3

OTHERS = 4.

ELSE.

l_return-type = 'E'.

l_return-message = 'Print Error'.

APPEND l_return TO e_return.

ENDIF.

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Suri , Have you solve this  please replly as i am facing such a problem