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: 

create internal table in function module and append it to global

former_member628874
Discoverer
0 Kudos

i want to create an internal table in function module and apppend it to global and second function module will take the data and perform operation and give it to export

can anyone help??

4 REPLIES 4

0 Kudos

Try declaring the internal table which you want to use in your second FM at the top include of your function group. To do so,

open your first FM in SE37.

click on object list button at the top or view your function group.

you will see a top include for your function group. Declare your internal table here in this include.

create the second function module under the same function group. you can access the internal table directly in second function module.

gabmarian
Active Contributor

Don't use that kind of obsolete encapsulation anymore. Use a global class with the internal table as an attribute with setter-getter methods. If there can be only one instance apply the singleton design pattern.

SachinArtani
Participant
0 Kudos

Create one internal table inside FM and one in main program with same structure.

Add data in Internal Table of FM and export it to the main program in main program's Internal Table (global).

Now pass that global Internal table to second FM and use it.

Sandra_Rossi
Active Contributor
0 Kudos

Are the 2 function modules in the same function group? Is your question about how to declare a global variable in a function group or what?

Anyway don't do it that way, refer to the answer by Gábor Márián.