‎2006 Jul 07 4:06 PM
Hello,
I have written the following piece of code:
FORM PC_SSL_UPLOAD USING WA_UPLOAD_DATA LIKE LINE OF LT_UPLOAD_DATA
CHANGING P_UPLOAD_DATA TYPE STANDARD TABLE OF TY_UPLOAD_DATA.
where LT_UPLOAD_DATA was declared as an internal table of type TY_UPLOAD_DATA.
When I tried to do a syntax check, I've got the following message:
Different number of parameters in FORM and PERFORM (routine:PC_SSL_UPLOAD, number of formal parameters: 4, number of actual parameters: 2).
I thought all I have declared was 2 formal parameters: WA_UPLOAD_DATA as the work space and P_UPLOAD_DATA as the parameter, why there are 4 parameters? and how can I change the code such that it works the way I intend to get it to work?
Thanks a lot!
Regards,
Anyi
‎2006 Jul 07 4:10 PM
hi,
do this
FORM PC_SSL_UPLOAD
tables P_UPLOAD_DATA
USING WA_UPLOAD_DATA type TY_UPLOAD_DATA
or
FORM PC_SSL_UPLOAD
tables P_UPLOAD_DATA like <original table name>
USING WA_UPLOAD_DATA type TY_UPLOAD_DATA
Note :- whatever u use in type or like should be global; that is accessable in the form
‎2006 Jul 07 4:10 PM
hi,
do this
FORM PC_SSL_UPLOAD
tables P_UPLOAD_DATA
USING WA_UPLOAD_DATA type TY_UPLOAD_DATA
or
FORM PC_SSL_UPLOAD
tables P_UPLOAD_DATA like <original table name>
USING WA_UPLOAD_DATA type TY_UPLOAD_DATA
Note :- whatever u use in type or like should be global; that is accessable in the form
‎2006 Jul 07 4:14 PM
Or you can do this too. Using a table type and changing .
types: begin of ty_upload_data,
str type string,
end of ty_upload_data.
<b>Types: ty_tab_upload_data type table of ty_upload_data.</b>
data: i_upload_data type table of ty_upload_data.
data: wa_upload_data like line of i_upload_data.
perform pc_ssl_upload
using wa_upload_data
<b> changing i_upload_data.</b>
*---------------------------------------------------------------------*
* FORM PC_SSL_UPLOAD *
*---------------------------------------------------------------------*
* ........ *
*---------------------------------------------------------------------*
* --> WA_UPLOAD_DATA *
* --> P_UPLOAD_DATA *
* --> OF *
* --> TY_UPLOAD_DATA *
*---------------------------------------------------------------------*
form pc_ssl_upload
using wa_upload_data structure wa_upload_data
<b> changing p_upload_data type ty_tab_upload_data</b>.
endform.
Regards,
Rich Heilman
‎2006 Jul 07 4:25 PM
Hi,
Thanks for all the replies.
However, when I tried to use USING...CHANGE way, like what Rich has suggested, I got an error message like this:
In PERFORM or CALL FUNCTION "PC_SSL_UPLOAD", the actual parameter "LT_UPLOAD_DATA" is incompatible with the formal parameter "P_UPLOAD_DATA".
However, I did declare the LT_UPLOAD_DATA like this:
DATA: LT_UPLOAD_DATA TYPE STANDARD TABLE OF TY_UPLOAD_DATA,And I am pretty sure I declared P_UPLOAD_DATA as:
CHANGING P_UPLOAD_DATA TYPE TY_UPLOAD_DATASo where is the problem now?
Thanks!
Regards,
Anyi
‎2006 Jul 07 4:12 PM
Please try it like this.
types: begin of ty_upload_data,
str type string,
end of ty_upload_data.
data: i_upload_data type table of ty_upload_data.
data: wa_upload_data like line of i_upload_data.
perform pc_ssl_upload tables i_upload_data
using wa_upload_data.
*---------------------------------------------------------------------*
* FORM PC_SSL_UPLOAD *
*---------------------------------------------------------------------*
* ........ *
*---------------------------------------------------------------------*
* --> WA_UPLOAD_DATA *
* --> P_UPLOAD_DATA *
* --> OF *
* --> TY_UPLOAD_DATA *
*---------------------------------------------------------------------*
form pc_ssl_upload tables p_upload_data structure wa_upload_data
using wa_upload_data structure wa_upload_data.
endform.
Regards,
Rich Heilman
‎2006 Jul 07 4:13 PM
p_upload_data should be a TABLES parameter and not CHANGING.
PERFORM PC_SSL_UPLOAD USING W_UPLOAD_DATA TABLES T_UPLOAD_DATA .
FORM PC_SSL_UPLOAD
USING PW_UPLOAD_DATA LIKE LT_UPLOAD_DATA
TABLES PT_UPLOAD_DATA STRUCTURE LT_UPLOAD_DATA.
ENDFORM
-Kiran
‎2006 Jul 07 4:14 PM
Hi Anyi,
It is always better if you write your perform statement and then double click on the form name to create the form routine by itself.
perform pc_sll_upload using <data> tables <itab>.
double click on the pc_sll_upload to create a form routine.
Regards,
Ravi
‎2006 Jul 07 4:15 PM
Hi use Structure
DATA: wa_upload_data like line of lt_upload_data.
FORM PC_SSL_UPLOAD TABLES p_upload_data structure wa_upload_data
USING P_UPLOAD LIKE wa_upload_data