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

create internal table in function module and append it to global

Former Member
0 Likes
2,451

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
Read only

0 Likes
1,527

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.

Read only

Former Member
1,527

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.

Read only

SachinArtani
Active Participant
0 Likes
1,527

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.

Read only

Sandra_Rossi
Active Contributor
0 Likes
1,527

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.