Looks like what you are trying to do is reverse-engineering. Use an existing program or code and then convert to ABAP.
You can use the existing code as the base to get the functional details, then design and develop an ABAP program.
I would not blindly use an existing program to create a new one. There would not be much benefit in this.
This looks like the scenario where some organisations fall into the trap of implementing a SAP solution which just mirrors their existing processes and system. This does not help the company in the long run. If you read the best practices, you can see why this does not help.
When a new implementation is planned, you need to take the opportunity to revamp or streamline the existing business processes, then build the system to support the business processes.
Best of luck!