‎2008 Apr 11 3:09 PM
Greetings all,
Could anyone please advice me, I'm getting syntax error on FM Import parameter.
please advice and thanks in advance.
========================================================================
TYPES: ty_header TYPE zapo_gr_header.
DATA: ty_item TYPE zapo_gr_item.
DATA: t_header TYPE STANDARD TABLE OF ty_header,
t_item LIKE STANDARD TABLE OF ty_item,
******************************************
PERFORM goodsmvt_post TABLES t_header
t_item.
******************************************
FORM goodsmvt_post TABLES P_T_HEADER STRUCTURE zapo_gr_header
P_T_ITEM STRUCTURE zapo_gr_item.
CALL FUNCTION 'Z_APO_BAPI_GR_POST'
EXPORTING
I_GR_HEADER = P_T_HEADER
I_GR_ITEM = P_T_ITEM
TABLES
RETURN = gt_gr_out.
ENDFORM.
******************************************
FUNCTION Z_APO_BAPI_GR_POST.
*"----------------------------------------------------------------------
*"*"Local Interface:
*" IMPORTING
*" VALUE(I_GR_HEADER) TYPE ZAPO_GR_HEADER
*" VALUE(I_GR_ITEM) TYPE ZAPO_GR_ITEM
LOOP AT I_GR_HEADER INTO wa_header.
------
ENDLOOP.
********************************************SYNTAX ERROR:****
****Function Module Z_APO_BAPI_GR_POST****
****"I_GR_HEADER" is neither specified under "TABLES" nor defined as an****
****internal table.*========================================================================*
‎2008 Apr 11 3:20 PM
the parameter ZAPO_GR_HEADER is not an internal table so you can't do a LOOP AT.
This is because you have declared it as an import parameter in stead of under TABLES tab.
You can use the tables tab do declare parameter in function module, or you should declare zapo_gr_header as TABLE TYPE in the Data Dictionary.
‎2008 Apr 11 3:12 PM
The parameters passed should not be tables but simple structure ..do not declare them in Perform as tables but structures
‎2008 Apr 11 3:15 PM
hi BK,
Check out if the declarations part of the code is activated or not and wa_header is not yet declared. So take care of it even.
Regards,
Santosh
‎2008 Apr 11 3:20 PM
the parameter ZAPO_GR_HEADER is not an internal table so you can't do a LOOP AT.
This is because you have declared it as an import parameter in stead of under TABLES tab.
You can use the tables tab do declare parameter in function module, or you should declare zapo_gr_header as TABLE TYPE in the Data Dictionary.
‎2008 Apr 11 3:21 PM
There may be two causes which u need to check.
1) First check that u need to pass the structure to the I_GR_HEADER parameter
and it is not table.
2) If you are passing the structure correctly, the problem is with the type specification
FORM goodsmvt_post TABLES P_T_HEADER STRUCTURE zapo_gr_header
It should not be table.
Check that.
Venkat
‎2008 Apr 11 3:36 PM
Greetings all,
I have declared under TABLES tab rather Import Paramters and is working now.
Thanks to all for valuable advices.
<REMOVED BY MODERATOR>
Edited by: Alvaro Tejada Galindo on Apr 11, 2008 12:22 PM