S
saint
Guest
I am trying to create a brose for these temp tables however im not sure of how to go about to solve this problem. Since there isn't much documentation or many resources on how to achieve this I decided to come here to ask for help.
Here is my source code, all and any help is well appreaciated
So far I have tried replacing the frame with the browse, adding the browse to the display but I do not know enough about this language to understand how it works.
Continue reading...
Here is my source code, all and any help is well appreaciated
Code:
CURRENT-WINDOW:WIDTH = 190.
CURRENT-WINDOW:HEIGHT = 29.
DISABLE TRIGGERS FOR LOAD OF CGLTR.
/*****----------------------------------------------*****/
/* define variables */
/*****----------------------------------------------*****/
DEF VAR I-PERIOD LIKE CGLTR.GL-PERIOD NO-UNDO.
DEF VAR I-JOURNAL LIKE CGLTR.JOURNAL-NO NO-UNDO.
DEF VAR I-YEAR LIKE CGLTR.ACTUAL-FI-YR NO-UNDO.
DEF VAR I-COMPANY LIKE CGLTR.COMPANY NO-UNDO.
DEF VAR I-SEQ LIKE CGLTR.GLTR-SEQ-CNT NO-UNDO.
DEF VAR I-ACCT LIKE CGLTR.ACCT-NUMBER NO-UNDO.
DEF VAR NO-CGLMS AS CHAR FORMAT "XX" NO-UNDO.
DEF VAR UPDATE-YN AS LOGICAL NO-UNDO.
DEF VAR VIEW-ONLY AS LOGICAL NO-UNDO.
DEF VAR ADD-ACCT AS LOGICAL NO-UNDO.
DEF VAR detail-yn AS LOGICAL NO-UNDO.
DEF VAR JOURNAL-TOT AS LOGICAL NO-UNDO.
DEF VAR seq-tot AS LOGICAL NO-UNDO.
DEF VAR i-date AS DATE NO-UNDO.
DEF VAR out-file AS CHAR NO-UNDO.
DEF VAR out-file-resumen AS CHAR NO-UNDO.
DEF VAR out-file-journal-detail AS CHAR NO-UNDO.
DEF VAR output-to-file AS LOGICAL NO-UNDO.
/*****----------------------------------------------*****/
/* define buffers */
/*****----------------------------------------------*****/
DEF BUFFER buf-cgltr FOR cgltr.
DEF BUFFER buf-cglms FOR cglms.
/***-------------------------------***/
/*define querys */
/***-------------------------------***/
DEF QUERY Qry-cgltr FOR buf-cgltr SCROLLING.
DEF QUERY Qry-cglms FOR buf-cglms SCROLLING.
OPEN QUERY qry-cgltr FOR EACH buf-cgltr NO-LOCK.
OPEN QUERY qry-cglms FOR EACH buf-cglms NO-LOCK.
/***---------------------------***/
/*define browse */
/***---------------------------***/
DEF BROWSE brw-cgltr
QUERY Qry-cgltr NO-LOCK
DISPLAY
buf-CGLTR.COMPANY-CODE
buf-CGLTR.ACTUAL-FI-YR LABEL "YEAR"
buf-CGLTR.GL-PERIOD LABEL "P"
buf-CGLTR.JOURNAL-NO LABEL "JORNL" FORMAT "X(10)"
buf-CGLTR.GLTR-SEQ-CNT LABEL "SEQ" FORMAT "9999999"
buf-CGLTR.ACCT-NUMBER LABEL "ACCOUNT"
buf-CGLTR.GL-TRAN-DATE LABEL "TR DATE"
buf-CGLTR.JOURNL-DESCR LABEL "DESCR" FORMAT "X(40)"
buf-CGLTR.DEBIT LABEL "DEBIT" FORMAT "->,>>>,>>>,>>9.99"
buf-CGLTR.CREDIT LABEL "CREDIT" FORMAT "->,>>>,>>>,>>9.99"
buf-CGLTR.UPDATE-IND LABEL "UPD"
buf-CGLTR.CLEARED LABEL "CLR" FORMAT "Y/N"
ENABLE buf-cgltr.GL-PERIOD
WITH 2 DOWN NO-ROW-MARKERS SEPARATORS SIZE 29 BY 190 FONT 15.
/* Make GL-PERIOD read-only */
buf-cgltr.GL-PERIOD:READ-ONLY IN BROWSE brw-cgltr = TRUE.
DEF BROWSE brw-cglms
QUERY Qry-cglms NO-LOCK
DISPLAY
buf-CGLMS.DESCRIPTION
buf-cglms.BAL-FWD-LAST LABEL "YR BEGBAL"
NO-CGLMS LABEL "BAD ACCT"
ENABLE buf-cglms.BAL-FWD-LAST
WITH 50 DOWN NO-ROW-MARKERS SEPARATORS SIZE 50 BY 5 FONT 15.
/* Make GL-PERIOD read-only */
buf-cglms.BAL-FWD-LAST:READ-ONLY IN BROWSE brw-cglms = TRUE.
/*****----------------------------------------------*****/
/* define temp-table */
/*****----------------------------------------------*****/
DEF TEMP-TABLE SELECTED-cgltr
FIELD COMPANY-CODE AS CHAR FORMAT "x" LABEL "CO"
FIELD ACTUAL-FI-YR AS INTEGER FORMAT "-9999" LABEL "GL YR"
FIELD GL-PERIOD AS INTEGER FORMAT "-99" LABEL "GL PRD"
FIELD ACCT-NUMBER AS INTEGER FORMAT "9999999999" LABEL "ACCT"
FIELD act-desc AS CHAR FORMAT "x(40)"
FIELD DEBIT AS DECIMAL FORMAT "->,>>>,>>9.99"
FIELD CREDIT AS DECIMAL FORMAT "->,>>>,>>9.99"
INDEX SELECTED-cgltr-KEY IS PRIMARY
COMPANY-CODE
ACTUAL-FI-YR
GL-PERIOD
ACCT-NUMBER.
DEF TEMP-TABLE SELECTED-cgltr-journal
FIELD COMPANY-CODE AS CHAR FORMAT "x" LABEL "CO"
FIELD ACTUAL-FI-YR AS INTEGER FORMAT "-9999" LABEL "GL YR"
FIELD GL-PERIOD AS INTEGER FORMAT "-99" LABEL "GL PRD"
FIELD JOURNAL-NO AS CHAR FORMAT "x(8)" LABEL "JOURNAL#"
FIELD ACCT-NUMBER AS INTEGER FORMAT "9999999999" LABEL "ACCT"
FIELD GLTR-SEQ-CNT AS INTEGER FORMAT ">>>>999" LABEL "SEQ"
FIELD act-desc AS CHAR FORMAT "x(40)"
FIELD GL-TRAN-DATE AS DATE FORMAT "99/99/9999" LABEL "TR DATE"
FIELD DEBIT AS DECIMAL FORMAT "->,>>>,>>9.99"
FIELD CREDIT AS DECIMAL FORMAT "->,>>>,>>9.99"
INDEX SELECTED-cgltr-journal-KEY IS PRIMARY
COMPANY-CODE
ACTUAL-FI-YR
GL-PERIOD
JOURNAL-NO
ACCT-NUMBER
GLTR-SEQ-CNT.
/*****----------------------------------------------*****/
/* get default company */
/*****----------------------------------------------*****/
FIND FIRST cmpny NO-LOCK NO-ERROR.
IF AVAIL cmpny THEN
DO:
ASSIGN i-company = cmpny.company-code.
FIND acprd WHERE acprd.company-code = i-company
NO-LOCK NO-ERROR.
IF AVAIL acprd THEN
DO:
ASSIGN
i-year = ACPRD.ACTUAL-FI-YR
i-period = ACPRD.CURR-PERIOD - 1.
END.
END.
/*****----------------------------------------------*****/
/* define frame */
/*****----------------------------------------------*****/
DEF FRAME F1
I-COMPANY LABEL "CO"
I-YEAR LABEL "YEAR"
I-PERIOD LABEL "PRD"
I-JOURNAL LABEL "JOURNAL" FORMAT "X(10)"
I-SEQ LABEL "SEQ" FORMAT "9999999"
I-ACCT LABEL "ACCT" FORMAT "999999999"
i-date LABEL "TRANS DATE"
DETAIL-YN LABEL "DETAIL?"
JOURNAL-TOT LABEL "JOURNAL TOTALS?"
seq-tot LABEL "SEQ TOTALS?"
VIEW-ONLY LABEL "VIEW ONLY?"
ADD-ACCT LABEL "ADD MISSING?"
UPDATE-YN LABEL "UPDATE DATA?"
output-to-file LABEL "OUTPUT TO FILE?"
out-file NO-LABEL FORMAT "X(80)"
WITH FRAME F1 CENTERED THREE-D FONT 1 WIDTH 188
TITLE "DISPLAY CGLTR FOR: " + cmpny.company-name.
ASSIGN
UPDATE-YN = NO
VIEW-ONLY = YES
ADD-ACCT = NO
DETAIL-YN = YES
JOURNAL-TOT = YES
seq-tot = NO
DETAIL-YN:TOOLTIP = "NO = DISPLAY TOTALS ONLY (use to find bad journal), YES = VIEW DETAIL"
VIEW-ONLY:TOOLTIP = "YES = DO NOT UPDATE CGLTR DATA, NO = ALLOW UPDATE TO CGLTR DATA".
DISPLAY
I-COMPANY
I-YEAR
I-PERIOD
I-JOURNAL
I-SEQ
I-ACCT
I-DATE
DETAIL-YN
JOURNAL-TOT
VIEW-ONLY
ADD-ACCT
UPDATE-YN
output-to-file
WITH FRAME F1 .
/*****----------------------------------------------*****/
/*****----------------------------------------------*****/
REPEAT:
UPDATE
I-COMPANY
I-YEAR
I-PERIOD
I-JOURNAL
I-SEQ
I-ACCT
I-DATE
DETAIL-YN
JOURNAL-TOT
seq-tot
VIEW-ONLY
ADD-ACCT
UPDATE-YN
output-to-file
WITH FRAME F1 .
DISPLAY
I-COMPANY
I-YEAR
I-PERIOD
I-JOURNAL
I-SEQ
I-ACCT
I-DATE
DETAIL-YN
JOURNAL-TOT
VIEW-ONLY
ADD-ACCT
output-to-file
UPDATE-YN
WITH FRAME F1 .
IF ADD-ACCT = YES THEN
DO:
CREATE CGLTR.
ASSIGN
CGLTR.COMPANY-CODE = I-COMPANY
CGLTR.ACTUAL-FI-YR = I-YEAR
CGLTR.GL-PERIOD = I-PERIOD
CGLTR.JOURNAL-NO = I-JOURNAL
CGLTR.GLTR-SEQ-CNT = I-SEQ.
UPDATE
CGLTR.COMPANY-CODE LABEL "CO"
CGLTR.ACTUAL-FI-YR LABEL "YEAR"
CGLTR.GL-PERIOD LABEL "P"
CGLTR.JOURNAL-NO LABEL "JORNL" FORMAT "X(10)"
CGLTR.GLTR-SEQ-CNT LABEL "SEQ" FORMAT "9999999"
CGLTR.ACCT-NUMBER LABEL "ACCOUNT"
CGLTR.GL-TRAN-DATE LABEL "TR DATE"
CGLTR.JOURNL-DESCR LABEL "DESCR" FORMAT "X(30)"
CGLTR.DEBIT LABEL "DEBIT" FORMAT "->,>>>,>>9.99" (TOTAL)
CGLTR.CREDIT LABEL "CREDIT" FORMAT "->,>>>,>>9.99" (TOTAL)
CGLTR.UPDATE-IND LABEL "UP"
CGLTR.CLEARED LABEL "CL" FORMAT "Y/N"
WITH NO-BOX NO-LABEL FONT 1 NO-UNDERLINE WITH WIDTH 250.
END.
IF output-to-file THEN
DO:
ASSIGN
out-file = "./saved-data/gl/CGLTR-"
+ I-COMPANY
+ "-"
+ string(I-YEAR, "9999")
+ "-"
+ string(I-PERIOD, "99") .
/*** only one account was selected ***/
IF I-ACCT <> 0 THEN
DO:
ASSIGN out-file = out-file
+ "-"
+ STRING(I-ACCT, "99999999").
END.
ASSIGN
out-file-resumen = out-file
+ "-"
+ "resumen"
out-file = out-file
+ ".txt"
out-file-resumen = out-file-resumen
+ ".txt"
out-file-journal-detail = out-file
+ "-"
+ "journal-detail.txt" .
DISPLAY
out-file
WITH FRAME F1 .
OUTPUT TO value(out-file).
END. /* IF output-to-file */
EMPTY TEMP-TABLE SELECTED-cgltr.
EMPTY TEMP-TABLE SELECTED-cgltr-journal.
/*****----------------------------------------------*****/
/* selected transacctions */
/*****----------------------------------------------*****/
FOR EACH CGLTR WHERE (CGLTR.JOURNAL-NO = I-JOURNAL
OR I-JOURNAL = " ")
AND (I-PERIOD = 0
OR CGLTR.GL-PERIOD = I-PERIOD)
AND (I-ACCT = 0
OR CGLTR.ACCT-NUMBER = I-ACCT)
AND (I-SEQ = 0
OR CGLTR.GLTR-SEQ-CNT = I-SEQ)
AND (I-DATE = ?
OR CGLTR.GL-TRAN-DATE = I-DATE)
AND CGLTR.ACTUAL-FI-YR = I-YEAR
AND CGLTR.COMPANY-CODE = I-COMPANY
/**
NO-LOCK
**/
BREAK
BY CGLTR.COMPANY-CODE
BY CGLTR.ACTUAL-FI-YR
BY CGLTR.GL-PERIOD
BY CGLTR.JOURNAL-NO
BY CGLTR.GLTR-SEQ-CNT
BY CGLTR.ACCT-NUMBER
:
ASSIGN NO-CGLMS = " ".
FIND CGLMS WHERE CGLMS.ACCT-NUMBER = CGLTR.ACCT-NUMBER
AND CGLMS.COMPANY-CODE = CGLTR.COMPANY-CODE
NO-LOCK NO-ERROR.
IF NOT AVAILABLE CGLMS THEN
ASSIGN NO-CGLMS = "**".
/*****----------------------------------------------*****/
/* temp table by account */
/*****----------------------------------------------*****/
FIND SELECTED-cgltr WHERE SELECTED-cgltr.COMPANY-CODE = CGLTR.COMPANY-CODE
AND SELECTED-cgltr.ACTUAL-FI-YR = CGLTR.ACTUAL-FI-YR
AND SELECTED-cgltr.GL-PERIOD = CGLTR.GL-PERIOD
AND SELECTED-cgltr.ACCT-NUMBER = CGLTR.ACCT-NUMBER
EXCLUSIVE-LOCK NO-ERROR.
IF NOT AVAIL SELECTED-cgltr THEN
DO:
CREATE SELECTED-cgltr.
ASSIGN
SELECTED-cgltr.COMPANY-CODE = CGLTR.COMPANY-CODE
SELECTED-cgltr.ACTUAL-FI-YR = CGLTR.ACTUAL-FI-YR
SELECTED-cgltr.GL-PERIOD = CGLTR.GL-PERIOD
SELECTED-cgltr.ACCT-NUMBER = CGLTR.ACCT-NUMBER .
IF AVAIL cglms THEN
DO:
SELECTED-cgltr.act-desc = CGLMS.DESCRIPTION.
END. /* IF AVAIL cglms */
END. /* IF NOT AVAIL SELECTED-cgltr */
ASSIGN
SELECTED-cgltr.DEBIT = SELECTED-cgltr.DEBIT + CGLTR.DEBIT
SELECTED-cgltr.CREDIT = SELECTED-cgltr.CREDIT + CGLTR.CREDIT .
/*** only one account was selected ***/
IF I-ACCT <> 0 THEN
DO:
FOR EACH Buf-cgltr WHERE Buf-cgltr.COMPANY-CODE = CGLTR.COMPANY-CODE
AND Buf-cgltr.ACTUAL-FI-YR = CGLTR.ACTUAL-FI-YR
AND Buf-cgltr.GL-PERIOD = CGLTR.GL-PERIOD
AND Buf-cgltr.JOURNAL-NO = CGLTR.JOURNAL-NO
/* AND Buf-cgltr.GLTR-SEQ-CNT = CGLTR.GLTR-SEQ-CNT */
NO-LOCK:
/* MESSAGE */
/* Buf-cgltr.COMPANY-CODE SKIP */
/* Buf-cgltr.ACTUAL-FI-YR SKIP */
/* Buf-cgltr.GL-PERIOD SKIP */
/* Buf-cgltr.JOURNAL-NO SKIP */
/* Buf-cgltr.GLTR-SEQ-CNT SKIP */
/* Buf-cgltr.ACCT-NUMBER SKIP */
/* Buf-cgltr.GL-TRAN-DATE SKIP */
/* Buf-cgltr.DEBIT SKIP */
/* Buf-cgltr.CREDIT SKIP */
/* VIEW-AS ALERT-BOX */
/* TITLE "debug". */
/*****----------------------------------------------*****/
/* temp table by journal */
/*****----------------------------------------------*****/
FIND SELECTED-cgltr-journal WHERE SELECTED-cgltr-journal.COMPANY-CODE = Buf-cgltr.COMPANY-CODE
AND SELECTED-cgltr-journal.ACTUAL-FI-YR = Buf-cgltr.ACTUAL-FI-YR
AND SELECTED-cgltr-journal.GL-PERIOD = Buf-cgltr.GL-PERIOD
AND SELECTED-cgltr-journal.JOURNAL-NO = Buf-cgltr.JOURNAL-NO
AND SELECTED-cgltr-journal.ACCT-NUMBER = Buf-cgltr.ACCT-NUMBER
AND SELECTED-cgltr-journal.GLTR-SEQ-CNT = Buf-cgltr.GLTR-SEQ-CNT
EXCLUSIVE-LOCK NO-ERROR.
FIND buf-CGLMS WHERE buf-CGLMS.ACCT-NUMBER = Buf-cgltr.ACCT-NUMBER
AND buf-CGLMS.COMPANY-CODE = Buf-cgltr.COMPANY-CODE
NO-LOCK NO-ERROR.
IF NOT AVAIL SELECTED-cgltr-journal THEN
DO:
CREATE SELECTED-cgltr-journal.
ASSIGN
SELECTED-cgltr-journal.COMPANY-CODE = Buf-cgltr.COMPANY-CODE
SELECTED-cgltr-journal.ACTUAL-FI-YR = Buf-cgltr.ACTUAL-FI-YR
SELECTED-cgltr-journal.GL-PERIOD = Buf-cgltr.GL-PERIOD
SELECTED-cgltr-journal.JOURNAL-NO = Buf-cgltr.JOURNAL-NO
SELECTED-cgltr-journal.ACCT-NUMBER = Buf-cgltr.ACCT-NUMBER
SELECTED-cgltr-journal.GLTR-SEQ-CNT = Buf-cgltr.GLTR-SEQ-CNT .
IF AVAIL buf-CGLMS THEN
DO:
ASSIGN SELECTED-cgltr-journal.act-desc = buf-CGLMS.DESCRIPTION.
END.
ASSIGN
SELECTED-cgltr-journal.GL-TRAN-DATE = Buf-cgltr.GL-TRAN-DATE
SELECTED-cgltr-journal.DEBIT = SELECTED-cgltr-journal.DEBIT + Buf-cgltr.DEBIT
SELECTED-cgltr-journal.CREDIT = SELECTED-cgltr-journal.CREDIT + Buf-cgltr.CREDIT .
END. /* IF NOT AVAIL SELECTED-cgltr-journal*/
END. /* FOR EACH Buf-cgltr */
END. /* IF I-ACCT <> 0*/
IF DETAIL-YN = YES
OR NOT AVAILABLE CGLMS THEN
DISPLAY
CGLTR.COMPANY-CODE NO-LABEL
CGLTR.ACTUAL-FI-YR LABEL "YEAR"
CGLTR.GL-PERIOD LABEL "P"
CGLTR.JOURNAL-NO LABEL "JORNL" FORMAT "X(10)"
CGLTR.GLTR-SEQ-CNT LABEL "SEQ" FORMAT "9999999"
CGLTR.ACCT-NUMBER LABEL "ACCOUNT"
CGLMS.DESCRIPTION NO-LABEL WHEN AVAIL cglms
CGLTR.GL-TRAN-DATE LABEL "TR DATE"
CGLTR.JOURNL-DESCR LABEL "DESCR" FORMAT "X(40)"
cglms.BAL-FWD-LAST LABEL "YR BEGBAL" WHEN AVAIL CGLMS
CGLTR.DEBIT LABEL "DEBIT" FORMAT "->,>>>,>>>,>>9.99" TO 155
CGLTR.CREDIT LABEL "CREDIT" FORMAT "->,>>>,>>>,>>9.99" TO 175
NO-CGLMS LABEL "BAD ACCT"
CGLTR.UPDATE-IND LABEL "UPD"
CGLTR.CLEARED LABEL "CLR" FORMAT "Y/N"
WITH NO-BOX NO-LABEL NO-UNDERLINE FONT 1 WIDTH 250 STREAM-IO.
/* IF VIEW-ONLY = NO */
/* OR NOT AVAILABLE CGLMS THEN */
/* UPDATE */
/* UPDATE-YN LABEL "FIX?" */
/* WITH FONT 1. */
/* ELSE */
/* ASSIGN */
/* UPDATE-YN = NO */
/* ADD-ACCT = NO. */
/* */
IF UPDATE-YN = YES
THEN
UPDATE
CGLTR.GL-PERIOD
CGLTR.ACCT-NUMBER
CGLTR.DEBIT
CGLTR.CREDIT
WITH FONT 1 NO-VALIDATE.
ACCUMULATE CGLTR.DEBIT (SUB-TOTAL BY CGLTR.GLTR-SEQ-CNT).
ACCUMULATE CGLTR.CREDIT (SUB-TOTAL BY CGLTR.GLTR-SEQ-CNT).
ACCUMULATE CGLTR.DEBIT (SUB-TOTAL BY CGLTR.JOURNAL-NO).
ACCUMULATE CGLTR.CREDIT (SUB-TOTAL BY CGLTR.JOURNAL-NO).
ACCUMULATE CGLTR.DEBIT (TOTAL BY CGLTR.COMPANY-CODE).
ACCUMULATE CGLTR.CREDIT (TOTAL BY CGLTR.COMPANY-CODE).
IF SEQ-TOT = YES THEN
DO:
IF LAST-OF(CGLTR.GLTR-SEQ-CNT) THEN
DISPLAY
"SEQ" AT 03
CGLTR.GLTR-SEQ-CNT
/* "TOTAL" */
ACCUM SUB-TOTAL BY CGLTR.GLTR-SEQ-CNT CGLTR.DEBIT TO 145 FORMAT "->>>>>>>>>9.99"
LABEL "TOTAL DB"
ACCUM SUB-TOTAL BY CGLTR.GLTR-SEQ-CNT CGLTR.CREDIT TO 175 FORMAT "->>>>>>>>>9.99"
LABEL "TOTAL CR"
(ACCUM SUB-TOTAL BY CGLTR.GLTR-SEQ-CNT CGLTR.DEBIT) -
(ACCUM SUB-TOTAL BY CGLTR.GLTR-SEQ-CNT CGLTR.CREDIT)
LABEL "DIFF" TO 200 SKIP(1)
WITH FRAME ST-SEQ SIDE-LABELS NO-BOX OVERLAY NO-UNDERLINE WIDTH 250
ROW 5 FONT 1 STREAM-IO.
END. /* IF SEQ-TOT = YES */
IF JOURNAL-TOT = YES THEN
DO:
IF LAST-OF(CGLTR.JOURNAL-NO) THEN
DISPLAY
CGLTR.GL-PERIOD AT 03
"JOURNAL"
CGLTR.JOURNAL-NO FORMAT "X(10)"
/* "TOTAL DB" AT 70 */
ACCUM SUB-TOTAL BY CGLTR.JOURNAL-NO CGLTR.DEBIT TO 145 FORMAT "->,>>>,>>>,>>9.99"
LABEL "TOTAL DB"
ACCUM SUB-TOTAL BY CGLTR.JOURNAL-NO CGLTR.CREDIT TO 175 FORMAT "->,>>>,>>>,>>9.99"
LABEL "TOTAL CR"
(ACCUM SUB-TOTAL BY CGLTR.JOURNAL-NO CGLTR.DEBIT) -
(ACCUM SUB-TOTAL BY CGLTR.JOURNAL-NO CGLTR.CREDIT)
LABEL "DIFF" TO 200 FORMAT "->,>>>,>>>,>>9.99" SKIP(1)
WITH FRAME ST-JRN SIDE-LABELS NO-BOX OVERLAY NO-UNDERLINE WIDTH 250
ROW 5 FONT 1 STREAM-IO.
END. /* IF JOURNAL-TOT = YES */
IF LAST-OF(CGLTR.COMPANY-CODE) THEN
DISPLAY
CGLTR.GL-PERIOD AT 03
"COMPANY TOTAL"
ACCUM TOTAL BY CGLTR.COMPANY-CODE CGLTR.DEBIT TO 155 FORMAT "->,>>>,>>>,>>9.99"
LABEL "TOTAL DB"
ACCUM TOTAL BY CGLTR.COMPANY-CODE CGLTR.CREDIT TO 175 FORMAT "->,>>>,>>>,>>9.99"
LABEL "TOTAL CR"
(ACCUM TOTAL BY CGLTR.COMPANY-CODE CGLTR.DEBIT) -
(ACCUM TOTAL BY CGLTR.COMPANY-CODE CGLTR.CREDIT) TO 210 FORMAT "->,>>>,>>>,>>9.99"
LABEL "DIFF" SKIP(1)
WITH FRAME ST-CO NO-LABELS NO-BOX OVERLAY NO-UNDERLINE WIDTH 250
ROW 5 FONT 1 STREAM-IO.
END. /* FOR EACH CGLTR */
OUTPUT CLOSE.
IF output-to-file THEN
OUTPUT TO value(out-file-resumen).
FOR EACH SELECTED-cgltr
NO-LOCK:
DISPLAY
SELECTED-cgltr
WITH WIDTH 190 STREAM-IO.
DISPLAY
SELECTED-cgltr.DEBIT (TOTAL)
SELECTED-cgltr.CREDIT (TOTAL)
(SELECTED-cgltr.DEBIT - SELECTED-cgltr.CREDIT) (TOTAL) FORMAT "->,>>>,>>9.99" .
END.
OUTPUT CLOSE.
IF output-to-file THEN
OUTPUT TO value(out-file-journal-detail).
FOR EACH SELECTED-cgltr-journal
NO-LOCK
BREAK
BY SELECTED-cgltr-journal.COMPANY-CODE
BY SELECTED-cgltr-journal.ACTUAL-FI-YR
BY SELECTED-cgltr-journal.GL-PERIOD
BY SELECTED-cgltr-journal.JOURNAL-NO
BY SELECTED-cgltr-journal.ACCT-NUMBER
BY SELECTED-cgltr-journal.GLTR-SEQ-CNT
:
DISPLAY
SELECTED-cgltr-journal
WITH WIDTH 190 STREAM-IO.
DISPLAY
SELECTED-cgltr-journal.DEBIT (TOTAL BY SELECTED-cgltr-journal.JOURNAL-NO )
SELECTED-cgltr-journal.CREDIT (TOTAL BY SELECTED-cgltr-journal.JOURNAL-NO )
(SELECTED-cgltr-journal.DEBIT - SELECTED-cgltr-journal.CREDIT) (TOTAL BY SELECTED-cgltr-journal.JOURNAL-NO ) FORMAT "->,>>>,>>9.99"
.
END.
OUTPUT CLOSE.
END. /*REPEAT */
So far I have tried replacing the frame with the browse, adding the browse to the display but I do not know enough about this language to understand how it works.
Continue reading...