Application Development 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: 

Issue with a "perform in program" call.

Former Member
0 Kudos

I am trying to do a call to a form in a zprogram. This call is being done inside an enhancement. The reason for this is because I can't delcare forms in the enhancement. Below is the issue:

The parameters I am trying to pass are typed as follows (in the SAP enhancement - SAP code):

types: begin of mrm_rbkpv.
        include structure rbkp_v.
types: begin of mmcr_drseg.
        include structure drseg.
types: mmcr_tdrseg type mmcr_drseg occurs 0.

I have the following as the call to the form and the form declaration:

PERFORM cancel_ret IN PROGRAM zcancel_retention USING e_trbkpv e_tdrseg[].

FORM cancel_ret  USING p_tdrseg TYPE rbkp_v
                      it_tdrseG TYPE J_1IDRSEG.

I am getting a run-time error saying:

An exception occurred that is explained in detail below.

The exception, which is assigned to class 'CX_SY_DYN_CALL_ILLEGAL_TYPE', was

not caught in

procedure "EXIT_SAPLMRMP_010" "(FUNCTION)", nor was it propagated by a RAISING

clause.

Since the caller of the procedure could not have anticipated that the

exception would occur, the current program is terminated.

The reason for the exception is:

Call to FORM "CANCEL_RET" is incorrect:

The actual parameter no. 1 has a different data type in the

PERFORM than requested for the FORM "CANCEL_RET" in program

"ZCANCEL_RETENTION".

This is telling me that the system doesn't see e_trbkpv being the same type as p_tdrseg. However, I can't see why they aren't the same time. I also assume I will have the issue with the second parameter. The table type (in my opinion) J_1IDRSEG should be the same type as mmcr_drseg.

Any ideas? The enhancement I am using is EXIT_SAPLMRMP_010 (LMR1M001).

Regards,

Aaron

Edited by: Aaron Shover on Apr 11, 2009 7:21 PM

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi Aaron,

In your program Zcancel_retention declare your parameter p_tdrseg as type mrm_rbkpv and also declare the type pool MRM in your program zcancel_retention.

Your actual parameter e_trbkpv has type MRM_RBKPV which is different from your formal parameter type which is RBKP_V

Have a closer look.

Cheers,

Aditya

7 REPLIES 7

Former Member
0 Kudos

Hi,

How are the declarations for e_trbkpv and e_tdrseg, I guess they are parameters of a function. So you should declare the parameters of the subroutine of the same type as e_trbkpv and e_tdrseg are typed in the functions parameters.

For the second parameter (sorry I dont have access to the system) my suggestion is that in the Z program, declare the same types as you have given in your post.

regards,

Advait

0 Kudos

Thanks for the response, Advait, but typing them the same as they are in the FM interface is not possible. They are typed as I described in my first post so they are not available to me in my zprogram.

Regards,

Aaron

Former Member
0 Kudos

Hi Aaron,

In your program Zcancel_retention declare your parameter p_tdrseg as type mrm_rbkpv and also declare the type pool MRM in your program zcancel_retention.

Your actual parameter e_trbkpv has type MRM_RBKPV which is different from your formal parameter type which is RBKP_V

Have a closer look.

Cheers,

Aditya

0 Kudos

Aditya, thanks for the idea of declaring the type pool. That solved the issue for the first parameter. However, I am still having trouble passing the second (table) parameter.

Regards,

Aaron

0 Kudos

OK, Aditya, I added another type pool to my program and I can now use the same type that SAP is using.

Thanks for pointing out the [obvious] solution that I was overlooking!

Aaron

0 Kudos

Hi Aaron,

The second parameter is again from another type pool viz. MMCR

Hence declare your second parameter in the subroutine as type MMCR_TDRSEG (after including the type pool MMCR in zcancel_Retention program).

Cheers,

Aditya

0 Kudos

>

> OK, Aditya, I added another type pool to my program and I can now use the same type that SAP is using.

>

> Thanks for pointing out the [obvious] solution that I was overlooking!

>

> Aaron

Aaron, I was not aware of the type pools as mentioned I don't have access to the system at the moment. But type pool has type declarations as well, so what I meant was pulling out the 2 declarations that you need into your Z program could have solved the problem :). Which will happen now since you've included the type pools.

Anyways good to know that you problem is solved.

Cheers,

Advait