05-08-2009 10:10 AM
Hi all,
i'm facing a very strange problem. Some Function Modules can't be called from within a method and a dump appears with the following message CALL_FUNCTION_CONFLICT_LENG (CX_SY_DYN_CALL_ILLEGAL_TYPE).
Here's an example: I've created a normal class with only one static method.
Class: ZCL_TEST
Method: CHECK_EMPLOYEE
Importing Parameter: IV_PERNR TYPE PERNR_D
Coding:
DATA gt_return TYPE TABLE OF bapireturn1.
CALL FUNCTION 'BAPI_EMPLOYEET_ENQUEUE'
EXPORTING
number = iv_pernr
validitybegin = sy-datum
IMPORTING
return = gt_return.
CALL FUNCTION 'BAPI_EMPLOYEET_DEQUEUE'
EXPORTING
number = iv_pernr
validitybegin = sy-datum.
If i call this method a dump appears and if the same code of that method is implemented directly in a normal report everything works fine.
Why can't i call this function module from within a method?
Regards
Mark-André
05-08-2009 10:15 AM
05-08-2009 10:15 AM
05-08-2009 10:26 AM
Hi,
the dump even appears by testing the method from Class Builder with F8!
In my test report iv_pernr isn't declared as follows:
REPORT z_test.
PARAMETERS p_pernr TYPE pernr_d.
zcl_test=>check_employee( p_pernr ).
The reason of the dump is parameter RETURN. But i don't understand it why it only doesn't work from within a method.
Dump Message:
In the function module interface, you can specify only
fields of a specific type and length under "RETURN".
Although the currently specified field
"GT_RETURN" is the correct type, its length is incorrect.
Regards
Mark-André
05-08-2009 11:07 AM
return parameter is not a table.
This one works:
DATA gt_return TYPE bapireturn1.