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: 

error in call function statement

Former Member
0 Kudos

hi,

i have defined a function with one of the "tables" parameter as shipto_xxx.

in my calling prorgam , i say

call function "zzzz"

tables

shipto_xxx = yyy.

where yyy is a similar structure to hold the data received by the function module.

when i compile i get the error "The field shipto_xxx is unknown but there is a similar field " *shipto_xxx".

why ?

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Try adding the call using the PATTERN Button in the editor.

Put the cursor where you want the call

press teh Pattern button

enter your function name

this will put the format of the function with required fields/tables uncommented and optional fields/tables will be commented out.

Then verify that it is what you are expecting.

You must put your ship_to in the TABLES tab and it MUST be a TABLE.

You can not pass a structure.

Use READ "your table" index 1. to retrieve the structure.

6 REPLIES 6

Former Member
0 Kudos

Try adding the call using the PATTERN Button in the editor.

Put the cursor where you want the call

press teh Pattern button

enter your function name

this will put the format of the function with required fields/tables uncommented and optional fields/tables will be commented out.

Then verify that it is what you are expecting.

You must put your ship_to in the TABLES tab and it MUST be a TABLE.

You can not pass a structure.

Use READ "your table" index 1. to retrieve the structure.

0 Kudos

Thanks Paul. But Pattern did not help. I am getting the same error.

also, i am not getting this error for other tables. let me show you how my shipto is declared

DATA: BEGIN OF *shipto OCCURS 0,

xxx LIKE yyy-xxx,

mmm LIKE yyy-mmm,

END OF *shipto.

where as other tables are based on structures as follows

DATA *vvvv TYPE SORTED TABLE OF t_vvvv

WITH HEADER LINE.

also, i want my function module to deal with data in 2D, i,e, as internal tables only. and so i created the relevant structures in SE11 and included the same under TABLES tab in se37 for the FM. Where have I gone wrong ?

0 Kudos

better provide the 'whole' coding, i.e. the relevant part, so data declaration and part where you are calling your function module and function module coding and interface.

0 Kudos

Hi Micky,

Here we go. Main program logic...

DATA: BEGIN OF *uuu OCCURS 0,

xxx LIKE vbap-xxx,

END OF *uuu.

DATA: BEGIN OF *shipto OCCURS 0,

vbeln LIKE likp-vbeln,

adrnr LIKE vbpa-adrnr,

END OF *shipto.

TYPES: BEGIN OF t_xxx,

vbeln LIKE vbrp-vbeln,

vgtyp LIKE vbrp-vgtyp,

END OF t_xxx.

DATA *vvv TYPE SORTED TABLE OF t_xxx

WITH HEADER LINE

WITH NON-UNIQUE KEY vbeln.

CALL FUNCTION 'ZZZZ'

TABLES

UUUU = *uuu.

VVVV = *vvv.

SHIPTO = *shipto.

Here I am trying to call the RFC function which will interface with XI and pull the data from another SAP system and get me the results in the two internal tables, i.e. *vvv and *shipto. The internal table *uuu acts as input data which will be passed to XI and thru that to another sap system.

Now the FM "ZZZZ" has been created based on the relevant structures created in SE 11. and these have been included in the TABLES tab of the function.

so i have created 3 structures zuuu, zshipto and zvvv in SE11 similar to the code above and included the same in the function udner the tables tab. no import / export parameters have been set. and no code in the FM. this FM is dummy and is used just to pass the data and retrieve the data from other sap system.

the basic thing is send an internal table of values and receive multiple internal table of values. hope i am clear...please let me know how to proceed. thks

0 Kudos

Hi

It seems you need to delete some dots

CALL FUNCTION 'ZZZZ'
  TABLES
*     UUUU = *uuu. <--------------- here the dot is wrong
    UUUU = *uuu
*     VVVV = *vvv.  <--------------- here the dot is wrong
     VVVV = *vvv
     SHIPTO = *shipto.

Max

0 Kudos

thanks max, that really helped..