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: 

Function Modules

Former Member
0 Kudos
112

1> Assume we are calling 2 FMs in our custom program. These 2 FMs belongs two a common FG where ITAB is declared as a global data. Now with the execution of FM1 the internal table is populated . After that when FM2 has called will ITAB hold the same data populated earlier?

2> I have used a FM in some programs. Now i made some modifications to the FM . My aim is the modification should not affect the previous programs. How to

achieve this?

1 ACCEPTED SOLUTION

Former Member
0 Kudos
89

1> Yes ITAB holds data of the previous data.. because all the FG will be stored in a new program group, in the same internal session... ( for the first FM call itself) and this will not be deleted even if the end function reaches.... When u call the second FM of the same FG this FG will not be loaded again into the program group....

i hope u understood what am saying...

2> No , u cannot do that... u need to copy the same FM into someother and do the modifications... B'coz these function modules are globally available routines.. and data consistency is the main objective of these FM's...

3 REPLIES 3

Former Member
0 Kudos
89

1a) FM2 will hold the same data as ITAB has earlier.... i.e., if u are callin the function module after populating the data into ITAB, FM2 holds the data in ITAB.

2a) If u modify the function module, it will definitely affect the programs in which it was used.. To avoid this copy the FM to another and perform the respective operations....

Regards,

Pavan P

Former Member
0 Kudos
90

1> Yes ITAB holds data of the previous data.. because all the FG will be stored in a new program group, in the same internal session... ( for the first FM call itself) and this will not be deleted even if the end function reaches.... When u call the second FM of the same FG this FG will not be loaded again into the program group....

i hope u understood what am saying...

2> No , u cannot do that... u need to copy the same FM into someother and do the modifications... B'coz these function modules are globally available routines.. and data consistency is the main objective of these FM's...

Former Member
0 Kudos
89

Ya got it.

Thanks Body.