Application Development and Automation 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: 
Read only

BAPI/FM Import Parameter Error.

Former Member
0 Likes
1,223

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.*========================================================================*

1 ACCEPTED SOLUTION
Read only

Sm1tje
Active Contributor
0 Likes
902

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.

5 REPLIES 5
Read only

Former Member
0 Likes
902

The parameters passed should not be tables but simple structure ..do not declare them in Perform as tables but structures

Read only

Former Member
0 Likes
902

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

Read only

Sm1tje
Active Contributor
0 Likes
903

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.

Read only

Former Member
0 Likes
902

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

Read only

Former Member
0 Likes
902

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