Please,Help.

If you name the frame explicity, make it a DOWN frame and use DOWN WITH FRAME these problems normally go away.

You can also use @ to display totals in the same frame (but be careful about the display formats - you might have to expand them if you are totalling a lot of values or high values) and use the UNDERLINE comand to underline display columns.

Try the following variation of your program:

Code:
DEF TEMP-TABLE temp-detail                                      
     FIELD temp-supp1   LIKE ad_addr                            
     FIELD temp-invoice LIKE vo_invoice                         
     FIELD temp-voucher LIKE ckd_voucher                        
     FIELD temp-amt     AS DEC /*IG01*/ FORMAT ">,>>>,>>9.99"   
     FIELD temp-zzamt   LIKE zzckd_amt                          
     FIELD temp-net-amt AS DEC.   

DEFINE VAR i AS INT INIT 0 NO-UNDO.
DEFINE VAR ch AS CHAR  NO-UNDO.
DEFINE VAR tot-temp-amt AS DEC NO-UNDO.
DEFINE VAR tot-temp-zzamt AS DEC NO-UNDO.
DEFINE VAR tot-temp-net-amt AS DEC NO-UNDO.
 
DO WHILE i < 5:
                                   
    CREATE temp-detail.
    ch = STRING(i). 
    ASSIGN
        temp-supp1   = "12345678"
        temp-invoice = "12345678901234567890" 
        temp-voucher = "12345678"        
        temp-amt     = 9999999.99    
        temp-zzamt   = 9999999999.99
        temp-net-amt = -999999999.99 
        tot-temp-amt = tot-temp-amt + temp-amt
        tot-temp-zzamt = tot-temp-zzamt + temp-zzamt
        tot-temp-net-amt = tot-temp-net-amt + temp-net-amt.
    i = i + 1 .
END.

PAUSE (1).

FOR EACH temp-detail NO-LOCK BREAK BY temp-supp1:
    DISP
        temp-invoice   FORMAT "x(20)"               LABEL "Invoice"
        temp-voucher                                LABEL "Voucher"
        temp-amt       FORMAT ">>,>>>,>>9.99"        LABEL "Gross Amount"            /* *IG01* add =>> FORMAT ">,>>>,>>9.99" */    
        temp-zzamt     FORMAT ">>,>>>,>>>,>>9.99"    LABEL "Tax Deduction"           /* *IG01* add =>> FORMAT ">,>>>,>>>,>>9.99" */
        temp-net-amt   FORMAT "->,>>>,>>>,>>9.99"     LABEL "Net Amt" 
        WITH STREAM-IO FRAME f1 DOWN WIDTH 100 /*GUI*/ /* *IG01* ====>  WIDTH 80*/ . 
    DOWN WITH FRAME f1.
    IF LAST-OF(temp-supp1) THEN DO:
        UNDERLINE 
            temp-amt      
            temp-zzamt    
            temp-net-amt  
            WITH FRAME f1 DOWN.
        DOWN WITH FRAME f1.
        DISPLAY
            tot-temp-amt     @ temp-amt
            tot-temp-zzamt   @ temp-zzamt    
            tot-temp-net-amt @ temp-net-amt
            WITH FRAME f1 DOWN.
        DOWN WITH FRAME f1.
    END.
END.
 
Back
Top