‎2008 Feb 29 1:07 PM
Hi,
I have a extractor based on a function module. In the function module i need a set of lines to be called lot many times.
So , i tried using form and kept the code that needs to be called frequently in it.
The problem is FM is not allowing to keep the form inside the function (showing error).
Is there any other way to call a particular code in the FunctionModule repeatedly?
Can any one help me ASAP?
Thanks.
‎2008 Feb 29 1:11 PM
Hi,
Yes, you can do this.
Either move the FROM to after the ENDFUNCTION.
or
Move the FORM to an include of the function group, this will be available to all function modules in the group.
Regards,
Nick
‎2008 Feb 29 1:21 PM
Hi Prasad-
You can put PERFORM statements inside FUNCTIOn-ENDFUNCTION, whereas all FORMS need to be put only afetr ENDFUNCTION.
You can also put FORMs inside an Include Program of the respective Function Group.
Go to SE80 and look for the include programs. In one of those programs, u can put ur FORMS..
Hope this is clear to u..
Reward if useful
Cheeers
Shakir
‎2008 Feb 29 1:30 PM
Hi,
When ever u create a FM it will ask for function group and when u create function group it will create following includes by default.
1. LFunction group nameTOP - Similar to TOP include where we will do our data declarations.
2. LFunction group nameU01 - All function module source codes will present here.
3.LFunction group nameUXX - Will contain includes equal to number of function module(i.e one include for each FM)
U create one more include LFunction group nameF01.
WRITE ur PERFORM formname. In ur function module source code.
Just double click on form name. It will ask for creation and display one pop up asking for where to place. Select newly created include LFunction group nameF01. So ur perform will be in FM source code and FORM will be in this include.
Dont forgot to activate this include before u use it.
Hope this solves ur problem.
Thanks,
Vinod.
‎2008 Mar 01 8:16 AM
Hi every one,
Thanks for your replies.
I have created 2 includes , one for all declarations and the other include for the form which contains the code.
I have included them in the my actual program.
And in the actual program, i have a select statement on the internal table delared in the first include and i am looping into that table and assigning values to the fields and calling the form.
Now i am getting error like " the statement is not accessible" starting from the select stmt.
Can i know what is wrong in the code?
Thanks.
‎2008 Mar 01 8:45 AM
hi,
Your FM always belongs to a function group...... so if u want to create forms then u write the perform stmt and double click on it.
and create it in a new include......which will be in same FG.....
‎2008 Mar 01 8:47 AM
hi,
Your FM always belongs to a function group...... so if u want to create forms then u write the perform stmt and double click on it.
and create it in a new include......which will be in same FG.....