2017 Oct 24 10:23 AM
Hi all ,
I have an existing FM in which I need to change some of its code dynamically before calling it .
so is there is any way that I can change its code and store it in some temp FM and then call that temp FM ?
2017 Oct 26 12:35 PM
I solved my problem in these steps :
1- copying FM RS_FUNCTION_COPY
2- read copy FM into itab
3- change the code in the itab
4- INSERT REPORT <FM include name> ["L" + Function Group name + "U" + 01/02...] from itab
5- call my copy FM
6- delete copy FM using RS_FUNCTION_DELETE .
2017 Oct 24 10:46 AM
Why do you think you have to have self modifying code? What are you actually trying to achieve? It may be doable through other dynamic techniques.
2017 Oct 24 10:50 AM
I want to export variable that is will be only there in the FM ... the variable and the FM is run-time data so I need something generic .
2017 Oct 24 11:22 AM
Hi,
I still don't fully understand why in this case you need generated code. What is the functional requirement?
Kind regards, Rob Dielemans
2017 Oct 24 1:22 PM
Could you please explain more in details why you can't export the variable!?
2017 Oct 26 12:35 PM
I solved my problem in these steps :
1- copying FM RS_FUNCTION_COPY
2- read copy FM into itab
3- change the code in the itab
4- INSERT REPORT <FM include name> ["L" + Function Group name + "U" + 01/02...] from itab
5- call my copy FM
6- delete copy FM using RS_FUNCTION_DELETE .