To access Flash or WFlash, some APIs of SROM is prepared and when we call the SROM API, I think the program in SROM must execute to write or read the Flash in SROM. But Creator show the error below although I put the API, Write_DAP or WriteIO, in my code.

You don't have to use/call the SROM APIs. PSoC Creator and the PDL code that comes with it, provides handles/access to all the SROM calls required for accessing Flash/WFlash/SFlash. It should be noted that only through these handles (or the equivalent code) you can access the SROM APIs and not directly.