You have to create a new program. You can copy SAPFM06P into Z program and should make some changes in new program.
CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
formname = "write the formname you created
fm_name = function_module_name.
CALL FUNCTION function_module_name
After writing this program, go to NACT transaction and set your Z program.