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: 

dump while calling external subroutine

Former Member
0 Kudos
213

Hi all,

am getting a short dump while calling external subroutine due to type conflict in the actual and formal parameters,,code is shown below

data: begin of it_error occurs 0.

include structure y_error.

data: end of it_error occurs 0.

perform form2 in program (prog_name) tables it_error.

in prog_name.

form form2 tables p_error type structure y_error.

endform.

In the above code am getting dump saying mismatch in the type of actual and formal parameters ...am using the same type structure for both actual and formal parameters, formal parameters are in standard program

Thanks

John

15 REPLIES 15

PedroGuarita
Active Contributor
0 Kudos
162

Don't know if it's exactly like that, but if it is, in prog_name the command should be tables p_error structure y_error and not

tables p_error type structure y_error.

0 Kudos
162

Thanks for the reply.

but i dont think is there any mismatch between actual and formal parameters....infact both are same

0 Kudos
162

I'm not saying there is a mismatch, but if you have the sintax like you posted then it's assuming a table of the type "structure". Therefore, remove the "TYPE" instruction from the sintax in the FORM statement and try it like i said :

FORM formname TABLES tablename STRUCTURE structurename.

ENDFORM.

Hope i've been clear this time.

0 Kudos
162

the form is in a standard program .thats the problem ....the syntax is like wat u mentioned....i can only do changes in custom program during perform call....

0 Kudos
162

Hi John,

I think you can use this way...


data: it_error  type standard table of y_error with header line.

perform form2 in program (prog_name) tables it_error.

Let me know if any.

Regards,

Srinivas

0 Kudos
162

hi srinivas thanks for the reply..

am using ecc6.0 in the oop context we cannot use wtih header line...

am still facing the dump

0 Kudos
162

Hi,

if you call a standart program can you please show the real perform statement wich you use.

Regards, Dieter

0 Kudos
162

PERFORM check IN PROGRAM (lv_progname) TABLES <fs_tempa> i_err_detail IF FOUND.

where lv_progname is progname generated based on some i/p parameters.

in the short dump its says that the formal parameter no.2 is typed . hence type conflict.

regards

john

0 Kudos
162

Hi,

can you please show the value of lv_progname.

Regards, Dieter

Former Member
0 Kudos
162

Hi John

try using IF FOUND.

perform form2 in program (prog_name) tables it_error IF FOUND.

Regards,

Abhi

0 Kudos
162

Hi John,

In the first case you have declared an internal table with header line. You are passing that to the subroutine. But in the subroutine you are saying that the type is of structure which is declared in the dictionary. So this is a clear case of mismatch.

Try this.

Declare your internal tabel like : Data T_table type standard table of (structure).

Then declare a table type in the dictionary for the strcuture.

And now in the perform statement use changing parameter instead of tables. With the changing parameter type tour table as 'type <tabeltype name created in dictionary>'. Please try this..

Thanking you,

Jerry Jerome

0 Kudos
162

Hi Abhi,

I tried using IF FOUND but sitll dumo ...

thanks

john

Former Member
0 Kudos
162

You cannot pass a table in structure type. You can only pass a structure.

For the table to be passed in actual parameters your formal parameter should be of type tabletype i.e. y_error should be a table type and not structure.

So while using perform you need to pass structure or work area and not table.

0 Kudos
162

HI ,

am again writing the exact following code which getting dump for me

DATA: BEGIN OF i_err_detail OCCURS 0.

INCLUDE STRUCTURE y_error

DATA: END OF i_err_detail.

PERFORM form_name IN PROGRAM (progname) TABLES i_err_detail IF FOUND.

In progname

FORM form_name TABLES ptab STRUCTURE y_error.

........

endform

after executing the perform stmt am getting dump.

Thanks ...John

0 Kudos
162

Hi,

I did not get any dump using this code.

Might be the structure "y_error" is different in the standard program and the calling.

May I know the standard program which is called.

Regards,

Srini.