04-17-2012 11:02 AM
As part of custom cleanup ,i want have a program that will delete all custom function modules starting with Z and Y from my Ec4 server.So please help me out in this.
04-17-2012 11:25 AM
Hi,
I dont think we have a direct command to programatically delete FMs. But you can try a workaround.
table TFDIR stores detailst for the FMs.
You can fetch all z fms from it.
Then you can use DELETE REPORT XXXXX , to delete the program associated with it.
Might work
Message was edited by: sap wiz
04-17-2012 11:37 AM
Hi,
The workaround of sap wiz shall work. As alternative to DELETE REPORT you can use also function module RS_DELETE_PROGRAM.
Kind regards,
Jens Klingelhöfer
04-17-2012 12:01 PM
You will have to write a custom program for this.
it invovles geting z functino modues from v_fdir -> find it's fg -> scan fg source code for includes-> delete all includes ( inluding the fms i.e. FMs are also includes in FG ). -> delete the function group.
Regarding the logic check the mass download program in the link below. Check the logic how function group are scanned and all includes can be dtermined.
04-17-2012 12:09 PM
Record the deletion of any z function.
use this recording in LSMW or BDC and delete all the z functions.
you can get the list of all the z functions from TFDIR.
Hope this helps.
04-17-2012 12:17 PM
Some solutions
- Loop at function group, and use FM RS_FUNCTION_POOL_DELETE (use parameter SUPPRESS_POPUPS) You can find function group per function module in TFDIR (PNAME+4 or FUNCTION_INCLUDE_SPLIT) or directly access to function group in table TLIFG or via object direcory TADIR for R3TR FUGR objects.
- Loop at function modules in TFDIR and use RS_FUNCTION_DELETE (but you will then have to delete function groups)
Regards,
Raymond