If you have a DITA topic file, either .dita or one of its specializations, or a collection with <dita> as root, you can use command-line program DITA2Map to generate a .ditamap.
Working from an optional configuration file, a DTD, and your DITA topic file, DITA2Map generates a .ditamap by making a topicref from each topic ID, title, and shortdesc (if any) in the topic file. DITA2Map nests the topicrefs as the topics are nested, and optionally adds a reltable with one row and a column for each topic type found.