Dates in WebFOCUS aren't much fun! Check out this documentation:
http://techsupport.informationbuilders.com/tech/ibm/ibm_nf_nf751.html The AYM function requires only the Year and Month portion of a date, that's why you were getting zero.
Here's the corrected code (I haven't got HPART to work in Dialog Manager yet).
-*-SET &ECHO=ALL;
-SET &TODAY_DT = &YYMD;
-SET &TODAY_YYM = EDIT(&TODAY_DT,'999999');
-*-SET WEEK = HPART(&YYMD, 'WEEK', 'I2');
-SET &LAST_MONTH = AYM(&TODAY_YYM,-1,YYM);
-SET &THIS_MONTH = AYM(&TODAY_YYM,0,YYM);
-SET &SDATE = &LAST_MONTH || '01';
-SET &FIRSTDAY = &THIS_MONTH || '01';
-SET &EDATE = AYMD(&FIRSTDAY,-1,YYMD);
-* DETERMINE BEGINNING OF WEEK FOR SELECTED DATE
-SET &WTDF =
- DATECVT(( DATEMOV((DATECVT(&TODAY_DT,'I8YYMD','YYMD')),'BOW')),
- 'YYMD','I8YYMD');
-TYPE TODAY_DT = &TODAY_DT
-*-TYPE WEEK=&WEEK
-TYPE LAST_MONTH = &LAST_MONTH;
-TYPE THIS_MONTH = &THIS_MONTH;
-TYPE FIRSTDAY = &FIRSTDAY;
-TYPE START_RANGE = &SDATE;
-TYPE END_RANGE = &EDATE;
-TYPE BEGIN_WEEK = &WTDF;