2010 Nov 24 10:43 AM
hi all,
I use the function module "rs_functionmodule_insert" to generate function module dynamic. And my code looks like below:
DO 10 TIMES.
CALL FUNCTION "RS_FUNCTIONMODULE_INSERT"
EXPORTING
funcname = lv_fname
.....
.....
CALL FUNCTION lv_fname
....
....
ENDDO.However, the system tell me "Function module not found or not active"(a very red exception) at twice (call function lv_fname).
How to deal it?
hi all,
I use the function module "rs_functionmodule_insert" to generate function module dynamic. And my code looks like below:
DO 10 TIMES.
CALL FUNCTION "RS_FUNCTIONMODULE_INSERT"
EXPORTING
funcname = lv_fname
.....
.....
CALL FUNCTION lv_fname
....
....
ENDDO.However, the system tell me "Function module not found or not active"(a very red exception) at twice (call function lv_fname).
How to deal it?
2010 Nov 24 10:53 AM
You can check this include as refernce LBDBGF04 as how this FM should be used.
2010 Nov 25 3:27 AM
2010 Nov 24 11:15 AM
Hi,
This function would generate a function module based on the inputs, and what you need to provide to this function is the function module name, the function group, the input parameters,output parameters,tables parameters,exceptions and the code for the FM that you want to generate once you provide all this then the function module should generated . In order to check whats not working add the exceptions to the function module call and then check the subrc that should give youo some idea on what the issue is.
reagrds,
Himanshu
2010 Nov 24 11:54 AM
Hi Himanshu,
For excample, the lv_fname='z_one' at first time, and the lv_fname='z_two' at twice. Actuallty, I have seen them in SE80 when I debug it, but the system still tell me "not found or inactive"
2010 Nov 24 2:40 PM
Make sure you are calling the FM with single quotes (') instead of double quotes (").
Rob
2010 Nov 25 3:24 AM
hi Rob,
that's a mistake when I edit the post, don't care it.
2010 Nov 25 4:32 AM
Hi friend,
Please excute this statement and select all the function module place in one internal table.
OTHER WISE all the function module are stored in THIS table TFDIR.
do 10 times.
READ TABLE ITAB INTO WA INDEX LV_COUNT.
SELECT SINGLE funcname FROM tfdir INTO func WHERE funcname = wa-srname.
CALL FUNCTION func
EXPORTING
in_string = lv_in_str
IMPORTING
out_string = lv_out_str.
LV_COUNT = LV_COUNT + 1.
CLEAR:FUNC.
ENDDO.
call function will call dynamically.
thanks®ards,
muralii
2010 Nov 25 6:49 AM
hi muralii,
your codes similar to mine. but in my program, it need to generate a new function by another function "RS_FUNCTIONMODULE_INSERT", and then call the new function. and the system can't discover the second new function.
2010 Nov 25 7:39 AM
Hi,
I created as below and I was able to create the FM ..
Call the function 'SBUF_SYNCHRONIZE' before calling 'RS_FUNCTIONMODULE_INSERT' ...
DATA : funcname type RS38L_FNAM value 'ZTEST_CREATE_001', "
function_pool type AREA value 'ZFG_GENERIC', <-- ensure that the function group is active
short_text type RS38L_FTXT value 'Test FM',
l_active type c value 'X',
new_include like trdir-name.
call function 'SBUF_SYNCHRONIZE'.
CALL FUNCTION 'RS_FUNCTIONMODULE_INSERT'
EXPORTING
funcname = funcname
function_pool = function_pool
short_text = short_text
SAVE_ACTIVE = l_active
IMPORTING
FUNCTION_INCLUDE = new_include
EXCEPTIONS
DOUBLE_TASK = 1
ERROR_MESSAGE = 2
FUNCTION_ALREADY_EXISTS = 3
INVALID_FUNCTION_POOL = 4
INVALID_NAME = 5
TOO_MANY_FUNCTIONS = 6
NO_MODIFY_PERMISSION = 7
NO_SHOW_PERMISSION = 8
ENQUEUE_SYSTEM_FAILURE = 9
CANCELED_IN_CORR = 10
OTHERS = 11
.
CALL FUNCTION funcname .
Regards,
Srini.
2010 Nov 25 8:49 AM
2010 Nov 26 6:11 AM
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |