cancel
Showing results for 
Search instead for 
Did you mean: 

Adobe forms - USAGE_ERROR

fisher_li
Participant
0 Kudos

Hey, Adobe form Gurus,

I created an Adobe form and I can printed it correctly from an ABAP program.

But when I copied the codes from ABAP program and made a remote function module, I got USAGE_ERROR after the CALL FUNCTION I_FUNCNAME.

Again, if I copied the codes from function module back to another ABAP program, it worked.

Is something I missed?

Thank s in advance!

Fisher Li

Accepted Solutions (0)

Answers (1)

Answers (1)

fisher_li
Participant
0 Kudos

Ok. I found out that in the call

CALL FUNCTION XYZ

EXPORTING

/1BCDWB/DOCPARAMS = FP_DOCPARAMS

IM_START_DATE = I_BEGDA

IM_END_DATE = I_ENDDA

IMPORTING

/1BCDWB/FORMOUTPUT = LS_FORMOUTPUT

EXCEPTIONS

USAGE_ERROR = 1

SYSTEM_ERROR = 2

INTERNAL_ERROR = 3.

there is one check below and it caused the problem.

IF sy-cprog = 'RS_TESTFRAME_CALL'.

CALL FUNCTION 'FP_CREATE_COMPOSER_INPUT'

IMPORTING

outpar = %outpar.

CALL FUNCTION 'FPCOMP_JOB_OPEN'

CHANGING

ie_outpar = %outpar

EXCEPTIONS

usage_error = 1

system_error = 2

internal_error = 3

OTHERS = 4.

%fpcomp_error.

ENDIF

All I have to do is hardcode the sy-cprog to be my function module name before

the function call and the problem was resolved.

sy-cprog = Z_my_function_module_name.

CALL FUNCTION XYZ

EXPORTING

/1BCDWB/DOCPARAMS = FP_DOCPARAMS

IM_START_DATE = I_BEGDA

IM_END_DATE = I_ENDDA

IMPORTING

/1BCDWB/FORMOUTPUT = LS_FORMOUTPUT

EXCEPTIONS

USAGE_ERROR = 1

SYSTEM_ERROR = 2

INTERNAL_ERROR = 3.