on 03-05-2008 9:08 PM
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.
Suri , Have you solve this please replly as i am facing such a problem
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
85 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.