Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

strange error of CALL FUNCTION within Method

Former Member
0 Likes
560

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é

1 ACCEPTED SOLUTION
Read only

rainer_hbenthal
Active Contributor
0 Likes
508

How is iv_pernr is declared in the calling program?

3 REPLIES 3
Read only

rainer_hbenthal
Active Contributor
0 Likes
509

How is iv_pernr is declared in the calling program?

Read only

0 Likes
508

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é

Read only

0 Likes
508

return parameter is not a table.

This one works:


  DATA gt_return TYPE bapireturn1.