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: 

Parameter Passing in Functions

Former Member
0 Kudos

Hi,

I need to pass in an internal table of C (Max length 1024), bit confused about the best way of doing this.

What is the best way of doing this? Do I define it under imports , or tables? Do I have to define a new type in SE11?

Thanks

1 ACCEPTED SOLUTION

Former Member
0 Kudos

hi,

create a structure in SE11.

and using that same under parameter type tables create the FM.

regards,

Manohar

4 REPLIES 4

manuel_bassani
Contributor
0 Kudos

Hi Sims,

you should pass your table in TABLES section.

in the case of a table of C you can pass it with type "ANY TABLE" for example not structured table as:


data: xtab(1024) occurs 0.

in the case of a structured table you should create a type table in SE11 and declare your table as "TYPE Z_TAB_TYPE"

Example:


data: xtab type Z_TAB_TYPE.

or


data: begin of xtab occurs 0.
.......
data: end of xtab.

Regards, Manuel

Former Member
0 Kudos

hi,

create a structure in SE11.

and using that same under parameter type tables create the FM.

regards,

Manohar

former_member181962
Active Contributor
0 Kudos

Hi Sims,

If you want to pass the internal table in FMs, then use the Tables option. You don't need to crate any tables in SE11 .

Regards,

Ravi

jayanthi_jayaraman
Active Contributor
0 Kudos

Hi,

Here is the sample code.Kindly reward points by clicking the star on the left of reply,if it helps.

data itab type standard table of pa0001.

select * from pa0001 into table itab.

perform func <b>tables itab</b>.

form func tables p_itab <b>structure pa0001</b>.

data lw type pa0001.

loop at p_itab into lw.

write lw-pernr.

endloop.

endform. " func