‎2007 Feb 21 5:52 PM
Hello Consultants,
my requirement is, i have created one function group and it holds around 6 function modules. when i call my first FM in the group, i want to pass header data and store as a global data and i want to use the same data in other FM also. I don't want pass the same data all the times. how is it possible?
I tried by declaring as STATICS but no use..:-(
Thanks a lot in advance...
Rgds,
Mohan
‎2007 Feb 21 5:56 PM
Hi,
Declare the internal tables in the TOP INCLUDE of the function group.
Thanks,
Naren
‎2007 Feb 21 5:59 PM
yes i declared as a global variables only. but i am loosing data when the second FM is called..
‎2007 Feb 21 6:00 PM
declare those ITABs as global @ the top include so that they can be accessed anywhere in the program .... but it is not a good practise ... u shud pass those tables to the table parameters of each FM...
hope this will help...
bbye tac care
Ashwani
‎2007 Feb 21 6:03 PM
yes i declared as a global variables only. but i am loosing data when the second FM is called..
‎2007 Feb 21 6:01 PM
Hi Mohan,
Declare your internal table in the <functiongroup>TOP INCLUDE.
This will be globally avialable to all the function modules defined under the function group.
Thanks,
Vinay
‎2007 Feb 21 6:30 PM
Hell,
i am able to solve this using below,
instead of passing the header data through FM first time, i have exported data to memory in my program and in the first FM i have imported the same and now i am able to use the same in all FM with out passing header data all the time.
Please share your thoughts..
Thanks for your time..
Rgds,
Mohan
‎2007 Feb 21 6:51 PM
Hi Mohan,
The best Idea is to use the Global Definition in TOP include at Function Group level.
You may be loosing data.. .Because U may have called this FM in Different reports...
If u call all FMs in SAME report then the Global Data will remain present all the time.. there is no second thought about that..
Please reward this if u are convinced....:)
DARSHAN
‎2007 Feb 21 7:03 PM
Hello Darshan,
Nice to see ur confidence level... but unfortunately i am loosing data even though i am calling all the FM in one smartform only. I hope i am clear, i send all my header data (say IT_VBAK) through my first FM, i have declared IT_VBAK as global variable. but when i call my second FM with out passing IT_VBAK, with in my 2nd FM IT_VBAK is blank.....
Thanks a lot for your time...
Rgds,
Mohan
‎2007 Feb 21 7:30 PM
Hello Mohan,
what about a different approach? I am not familiar with smart forms but storing a state in global varibles is generally not the best solution on the long run. Is it possible with smartforms to use object instances? In this case you can solve the problem by returning a state object or by even replacing the fubas with a class-pool.
Regards,
Klaus