cancel
Showing results for 
Search instead for 
Did you mean: 

Global data declaring/using in Function modules

Former Member
0 Kudos

Hi,

I have declared an internal table(say ITAB1) in the top include.Appending the values through FM1(function module).

I am using the same through FM2 (Tables ITAB1).

( Function group is same for both FM1 and FM2 )

but i am not getting the values in the ITAB1.

Can anyone help me....

Thanks in advance

KB

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi

BADI is based on Object oriented concept .

Whatever your change in BADI Method1 ( No matter even if its in a function module of same group ) , will be visible in BADI method2 only depending the data visibility within a class. Maybe BADI mathod1 is one instance and method 2 is another instance of same class . So better use ABAP memory rather than fighting with this issue.

Cheers

Former Member
0 Kudos

Hi

how is program flow?

It should be

CALL FUNCTION FM1 <---- Append lines to ITAB

CALL FUNCTION FM2 <---- Read ITAB

Max

Former Member
0 Kudos

Hi Max,

Teh scenario is like this,

Appending the values to ITAB in FM1(BADI Method1).

And reading/modifying in another FM2BADI Method2) which contains TABLES ITAB Parameter, Inside the BADI.

Here we have function module interface. the global data can be accessed freely without using EXPORT/IMPORT. since I am trying to use withing the same Function group.

Thanks

Former Member
0 Kudos

Bhavani,

I don't think it works that way. If you are accessing that variable with in that function module you will be able to access that table.

As you are calling another function module else where, the execution memory is different and the previous variables will not exist any more. However, if you call function2 with function1 it should work.

The other way could using the EXPORT and IMPORT commands. Then you should be able to access the data.

Regards,

Ravi

Note : Please reward points, if this helps you.