I don't remember developer studio dealing much with DM code, but you can insert the code yourself. You probably need to get a Focus manual. A simple example would be; if &REQUEST is 'A', I want to report on FIELD1. Otherwise, I want to use FIELD2. So...
TABLE FILE SAMEFILE
-SET &WORK=IF &REQUEST IS 'A' THEN 'FIELD1' ELSE 'FIELD2';
SUM &WORK
END
DM code can put intelligence into an application, but it can also get very complicated and extensive. It can READ, WRITE, DECODE, IF-THEN-ELSE, GOTO, call functions, default values, etc. That's why you need a manual.