2015 Apr 28 2:37 PM
Hi experts,
I have created two functional modules under same function group and declared the internal table (ITAB)as global variable ,
i have populated the data to to ITAB n first function module , and These FM are used in a program , when i debug the program , the data is populated to 1st FM and but in 2nd function module the ITAB is null only internal table structure is available.
please let me know the reason.
Thanks NK
Hi experts,
I have created two functional modules under same function group and declared the internal table (ITAB)as global variable ,
i have populated the data to to ITAB n first function module , and These FM are used in a program , when i debug the program , the data is populated to 1st FM and but in 2nd function module the ITAB is null only internal table structure is available.
please let me know the reason.
Thanks NK
2015 Apr 28 2:53 PM
2015 Apr 28 3:50 PM
Hi Nishant,
thanks for the reply, where i need to create the local variable? is it inside the 2nd FM?
Thanks
2015 Apr 28 4:10 PM
Hi NK,
The itab should be declared only once, in the TOP include of the function group.
Jim
2015 Apr 28 4:15 PM
Hello NK,
In your FM use GOTO (In Menu)->Global Data.
At the end of the Include add your global table. It can then be used in both the FM's if you created them in same Function Group.
Regards,
Vijay.
2015 Apr 28 6:10 PM
thanks all, the program ( it also an FM) ,which is calling the 2nd FM is in background mode, i think thats the reason ITAB values are not populated.
i ts working fine with IMPORT/EXPORT but my lead says it is not advisable and they are obsolete in ECC 6.0,
---> declated iTAB as global variable.
---> call FM1 --populate itab
call function " MAIN_FM" in update task.
---> fm2 cllaed in side MAIN_FM, ( here values not populated)
please suggest global variable not filled incase of background mode.
thanks
NK
2015 Apr 28 6:22 PM
Hi NK,
The fact that the calling program runs in background mode would not have any effect on this.
You didn't mention before that the 2nd FM is called in update task - that's the reason your itab is empty. That starts a separate session so no shared memory from the function group. You would need to make the itab an importing parameter to the update function module and pass it from FM1.
2015 Apr 28 6:35 PM
Hi Jim,
thanks for your reply. can you explain more detail.
You would need to make the itab an importing parameter to the update function module and pass it from FM1.
Thanks
NK
2015 Apr 28 7:27 PM
You need to define an importing parameter in FM2 that can receive the contents of your itab. Then you have to pass those values from your calling program. If your calling program does not have access to those values, create an additional function module in the same function group that will return the itab contents. This is all because when you call FM2 using IN UPDATE TASK, the update task does not have the same global variables available; so you have to provide them.
Jim
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |