2010 Nov 02 5:26 PM
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
2010 Nov 02 5:32 PM
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.
2010 Nov 02 5:37 PM
Thanks for the reply.
but i dont think is there any mismatch between actual and formal parameters....infact both are same
2010 Nov 02 5:40 PM
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.
2010 Nov 02 5:45 PM
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....
2010 Nov 02 7:34 PM
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
2010 Nov 03 2:17 AM
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
2010 Nov 03 8:25 AM
Hi,
if you call a standart program can you please show the real perform statement wich you use.
Regards, Dieter
2010 Nov 03 8:36 AM
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
2010 Nov 03 8:46 AM
Hi,
can you please show the value of lv_progname.
Regards, Dieter
2010 Nov 03 5:34 AM
Hi John
try using IF FOUND.
perform form2 in program (prog_name) tables it_error IF FOUND.
Regards,
Abhi
2010 Nov 03 5:49 AM
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
2010 Nov 03 7:01 AM
2010 Nov 03 7:07 AM
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.
2010 Nov 03 7:36 AM
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
2010 Nov 03 7:56 AM
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.