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: 

Proper way to pass a structure as FORM parameter

Former Member
0 Kudos

Folks,

I need to pass a table that is of type LISTZEILE to a subroutine.

form mytest using myTable LIKE LISTZEILE.

loop at myTable.

write: / myTable.

endloop.

endform.

Syntax checker flags this declaration as an error. Can someone please suggest me the right way to declare this?

Just some background info. This subroutine is invoked from a custom RFC:

FUNCTION Z_MYRFC.

*"----


""Local Interface:

*" IMPORTING

blah

*" EXPORTING

blah

*" TABLES

*" RETURNTABLE STRUCTURE LISTZEILE

*"----


perform MyTest using returntable.

blah.

endfunction.

Thank you in advance for your help.

Regards,

Peter

4 REPLIES 4

Former Member
0 Kudos

Hi,

Check this... instead of using statement you need to use th Tables option

form mytest tables myTable Structure LISTZEILE.

loop at myTable.
write: / myTable.
endloop.

endform.


perform MyTest tables returntable.

Former Member
0 Kudos

Hi,

Try in this way,

PERFORM mytest TABLES mytable.

FORM MYTEST TABLES P_MYTABLE .

ENDFORM.

I355602
Advisor
Advisor
0 Kudos

Hi,

Refer:-


PERFORM mytest TABLES returntab.

FORM mytest TABLES returntab STRUCTURE listzeile.
  "code
ENDFORM.

Hope this helps you.

Regards,

Tarun

Former Member
0 Kudos

hi,

try this..

PERFORM mytest TABLES <Table name>.

FORM mytest TABLES < table name >STRUCTURE listzeile.

" wriite your code here

ENDFORM.

hope this helps

Regards

RItesh J