Print contents in the last page.
Dear all,
I am writing an ABAP program for a report. I have to print some text contents at the end of the page.
How do i do that?
TIA,
sinthu
Hi amit,
I have added some codes.... here is the code ..
SELECTION-SCREEN
SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.
SELECT-OPTIONS : S_AKONT FOR KNB1-AKONT OBLIGATORY.
PARAMETERS : P_BUKRS LIKE T001-BUKRS OBLIGATORY.
" COMPANY CODE
SELECT-OPTIONS : S_GSBER FOR TGSBT-GSBER OBLIGATORY, " BUSINESS AREA
S_BUDAT FOR BSID-BUDAT OBLIGATORY, " POSTING DATE
S_KUNNR FOR KNB1-KUNNR OBLIGATORY, " CUSTOMER NUMBER
S_UMSKZ FOR T074U-UMSKZ. " Special GL
"indicators
SELECTION-SCREEN END OF BLOCK B1.
Begin Of Authorization**********************
AT SELECTION-SCREEN.
AUTHORITY-CHECK OBJECT 'Z_FI_REP_N'
ID 'BUKRS' FIELD P_BUKRS
ID 'ACTVT' FIELD '03'.
IF SY-SUBRC <> 0.
MESSAGE E001(ZAUT) WITH P_BUKRS.
ENDIF.
LOOP AT S_AKONT.
AUTHORITY-CHECK OBJECT 'Z_FI_REP_N'
ID 'BEGRU' FIELD S_AKONT-LOW
ID 'ACTVT' FIELD '03'.
IF SY-SUBRC <> 0.
MESSAGE E001(ZAUT) WITH S_AKONT-LOW .
ENDIF.
IF S_AKONT-HIGH <> SPACE.
AUTHORITY-CHECK OBJECT 'Z_FI_REP_N'
ID 'BEGRU' FIELD S_AKONT-HIGH
ID 'ACTVT' FIELD '03'.
IF SY-SUBRC <> 0.
MESSAGE E001(ZAUT) WITH S_AKONT-HIGH .
ENDIF.
ENDIF.
ENDLOOP.
LOOP AT S_GSBER.
AUTHORITY-CHECK OBJECT 'Z_FI_REP_N'
ID 'GSBER' FIELD S_GSBER-LOW
ID 'ACTVT' FIELD '03'.
IF SY-SUBRC <> 0.
MESSAGE E001(ZAUT) WITH S_GSBER-LOW .
ENDIF.
IF S_GSBER-HIGH <> SPACE.
AUTHORITY-CHECK OBJECT 'Z_FI_REP_N'
ID 'GSBER' FIELD S_GSBER-HIGH
ID 'ACTVT' FIELD '03'.
IF SY-SUBRC <> 0.
MESSAGE E001(ZAUT) WITH S_GSBER-HIGH .
ENDIF.
ENDIF.
ENDLOOP.
End of Authorization*********************
SELECTION SCREEN VALIDATION
AT SELECTION-SCREEN ON S_AKONT.
IF NOT S_AKONT-LOW IS INITIAL.
SELECT SINGLE SAKNR FROM SKAT INTO SKAT-SAKNR
WHERE SAKNR = S_AKONT-LOW.
IF SY-SUBRC <> 0.
MESSAGE E999 WITH 'Reconciliation Account' S_AKONT-LOW
'does not exist'.
ENDIF.
ENDIF.
IF NOT S_AKONT-HIGH IS INITIAL.
SELECT SINGLE SAKNR FROM SKAT INTO SKAT-SAKNR
WHERE SAKNR = S_AKONT-HIGH.
IF SY-SUBRC <> 0.
MESSAGE E999 WITH 'Reconciliation Account' S_AKONT-HIGH
'does not exist'.
ENDIF.
ENDIF.
AT SELECTION-SCREEN ON S_KUNNR.
IF NOT S_KUNNR-LOW IS INITIAL.
SELECT SINGLE KUNNR FROM KNB1 INTO KNB1-KUNNR
WHERE AKONT IN S_AKONT
AND KUNNR = S_KUNNR-LOW.
IF SY-SUBRC <> 0.
MESSAGE E317 WITH S_KUNNR-LOW.
ENDIF.
ENDIF.
IF NOT S_KUNNR-HIGH IS INITIAL.
IF S_KUNNR-HIGH < S_KUNNR-LOW.
MESSAGE E381.
ENDIF.
SELECT SINGLE KUNNR FROM KNB1 INTO KNB1-KUNNR
WHERE AKONT IN S_AKONT
AND KUNNR = S_KUNNR-HIGH.
IF SY-SUBRC <> 0.
MESSAGE E317 WITH S_KUNNR-HIGH.
ENDIF.
ENDIF.
START OF SELECTION
START-OF-SELECTION.
P_KOART = 'D'.
LOOP AT S_UMSKZ.
IF S_UMSKZ-SIGN = 'E'.
S_UMSKZ-LOW = ' '.
S_UMSKZ-HIGH = ' '.
MODIFY S_UMSKZ INDEX SY-TABIX.
ENDIF.
ENDLOOP.
PERFORM GET_BKPF_BSEG_DATA.
PERFORM PROCESS_DISPLAY_DATA.
END-OF-SELECTION.
TOT OF PAGE
TOP-OF-PAGE.
FORMAT COLOR OFF INTENSIFIED OFF.
SELECT SINGLE BUTXT
FROM T001
INTO WA_BUTXT
WHERE BUKRS = P_BUKRS.
FORMAT COLOR COL_NORMAL INTENSIFIED OFF.
WRITE : / WA_BUTXT .
SELECT SINGLE VWERK
FROM KNVV
INTO WA_VWERK
WHERE KUNNR IN S_KUNNR.
SELECT SINGLE NAME1
FROM T001W
INTO WA_PNAME
WHERE WERKS EQ WA_VWERK.
PERFORM GET_SUP_PLANT.
WRITE: / WA_PNAME,
/ WA_NAME, / WA_NAME2 , / WA_NAME3,/ WA_NAME4, /
WA_CITY,/ WA_PSTLZ, /1(152) SY-ULINE.
*SKIP 1.
*ULINE AT (152).
WRITE : / 'Statement of Accounts', 100 'Page No : ', SY-PAGNO.
100 'Page No : ', SY-PAGNO.
IF S_BUDAT-HIGH = '00000000'.
S_BUDAT-HIGH = S_BUDAT-LOW.
ENDIF.
FORMAT COLOR OFF INTENSIFIED OFF.
FORMAT COLOR COL_NORMAL INTENSIFIED OFF.
WRITE : / 'From :', S_BUDAT-LOW, 'TO', S_BUDAT-HIGH ,100 'Date : ',
SY-DATUM, /1(152) SY-ULINE .
100 'Date : ', SY-DATUM.
FORMAT COLOR OFF INTENSIFIED OFF.
END OF PAGE
END-OF-PAGE.
WRITE:'Dear Sir,'.
WRITE:/15 'Confirmation of Balance'.
*INCLUDE ZFIGRIDISP.
FORM GET_BKPF_BSEG_DATA
FORM GET_BKPF_BSEG_DATA.
*INCLUDE ZFIGENDOCS.
DATA : I_FYV1 LIKE T009-PERIV.
*Commented by Sinthu
CALL FUNCTION 'CCODE_GET_FISCAL_YEAR_VARIANT'
EXPORTING
COMPANY_CODE = P_BUKRS
IMPORTING
FISCAL_YEAR_VARIANT = I_FYV1
EXCEPTIONS
COMPANY_CODE_NOT_FOUND = 1
OTHERS = 2.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
*CALL FUNCTION 'GM_GET_FISCAL_YEAR'
EXPORTING
I_DATE = S_BUDAT-LOW
I_FYV = I_FYV1
IMPORTING
E_FY = DATE1
EXCEPTIONS
FISCAL_YEAR_DOES_NOT_EXIST = 1
NOT_DEFINED_FOR_DATE = 2
OTHERS = 3
*IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
*ENDIF.
CLEAR DATE1.
CALL FUNCTION 'ME_DETERMINE_GJAHR'
EXPORTING
I_BSTYP =
I_BEDAT = S_BUDAT-LOW
I_PERIV = I_FYV1
IMPORTING
E_H_MONAT =
E_H_GJAHR = DATE1
E_H_DATUM =
End comment - sinthu
CUSTOMER CALCULATION
SELECT BUKRS BELNR GJAHR BLART
BLDAT BUDAT XBLNR BKTXT
WAERS KURSF XREVERSAL
INTO TABLE IT_BKPF
FROM BKPF
WHERE BUKRS = P_BUKRS
AND BUDAT IN S_BUDAT
AND BLART <> 'ZC' AND BLART <> 'ZV' AND BLART <> 'DA' AND
BLART <> 'AB'
AND BSTAT = ' '.
SELECT VBELN VBTYP
INTO TABLE IT_VBRK
FROM VBRK
FOR ALL ENTRIES IN IT_BKPF
WHERE VBELN = IT_BKPF-BELNR.
SORT IT_BKPF BY BUDAT.
IF P_KOART = 'D'.
IF S_UMSKZ <> ' '.
SELECT BUKRS BELNR GJAHR AUGBL
KOART UMSKZ SHKZG GSBER
DMBTR WRBTR ZUONR SGTXT
KOSTL VBELN SAKNR HKONT
KUNNR LIFNR REBZG
INTO TABLE IT_BSEG
FROM BSEG
WHERE BUKRS = P_BUKRS
AND GSBER IN S_GSBER
AND UMSKZ IN S_UMSKZ
AND ( UMSKZ = '' OR UMSKZ IN S_UMSKZ )
AND KUNNR IN S_KUNNR
AND KOART = P_KOART.
AND GJAHR = DATE1.
ELSE.
SELECT BUKRS BELNR GJAHR AUGBL
KOART UMSKZ SHKZG GSBER
DMBTR WRBTR ZUONR SGTXT
KOSTL VBELN SAKNR HKONT
KUNNR LIFNR REBZG
INTO TABLE IT_BSEG
FROM BSEG
WHERE BUKRS = P_BUKRS
AND GSBER IN S_GSBER
AND ( UMSKZ = ' ' )
OR UMSKZ IN S_UMSKZ )
AND KUNNR IN S_KUNNR
AND KOART = P_KOART.
AND GJAHR = DATE1.
ENDIF.
SORT IT_BKPF BY BELNR.
SORT IT_BSEG BY BELNR.
LOOP AT IT_BSEG.
CNT = SY-TABIX.
READ TABLE IT_BKPF
WITH KEY BELNR = IT_BSEG-BELNR
BINARY SEARCH.
IF SY-SUBRC NE 0.
DELETE IT_BSEG INDEX CNT.
CLEAR IT_BSEG.
ENDIF.
ENDLOOP. " END OF IT_BSIK
ENDIF.
OPENING BALANCE CALCULATION************
SELECT BELNR
FROM BKPF
INTO TABLE IT_BKPF_OPEN_BAL
WHERE BUKRS = P_BUKRS
AND BUDAT < S_BUDAT-LOW
AND GJAHR = DATE1
AND BLART <> 'ZC' AND BLART <> 'ZV' AND BLART <> 'DA' AND
BLART <> 'AB'
AND BSTAT = ' '.
****************end of ZFIGENDOCS***************************
ENDFORM. "GET_BKPF_BSEG_DATA
FORM PROCESS_DISPLAY_DATA.
FORM PROCESS_DISPLAY_DATA.
SELECT GSBER INTO TABLE IT_TGSBT
FROM TGSBT
WHERE GSBER IN S_GSBER.
SELECT KUNNR INTO TABLE IT_KNB1
FROM KNB1
WHERE KUNNR IN S_KUNNR
AND AKONT IN S_AKONT.
LOOP AT IT_TGSBT.
LOOP AT IT_KNB1.
IT_BA_CUST_COMB-GSBER = IT_TGSBT-GSBER.
IT_BA_CUST_COMB-KUNNR = IT_KNB1-KUNNR.
APPEND IT_BA_CUST_COMB.
ENDLOOP. " END OF IT_KNB1
ENDLOOP. " END OF IT_TGSBT
DELETE ADJACENT DUPLICATES FROM IT_BA_CUST_COMB.
SORT IT_BA_CUST_COMB BY KUNNR.
IF NOT IT_BA_CUST_COMB[] IS INITIAL.
LOOP AT IT_BA_CUST_COMB.
COUNTR1 = COUNTR1 + 1.
IF S_UMSKZ <> ''.
SELECT BELNR SHKZG DMBTR
INTO TABLE IT_BSEG_OPEN_BAL
FROM BSEG
WHERE BUKRS = P_BUKRS
AND GSBER = IT_BA_CUST_COMB-GSBER
AND UMSKZ IN S_UMSKZ
AND ( UMSKZ = ' ' OR UMSKZ IN S_UMSKZ )
AND KUNNR = IT_BA_CUST_COMB-KUNNR
AND KOART = P_KOART.
AND GJAHR = DATE1.
ELSE.
SELECT BELNR SHKZG DMBTR
INTO TABLE IT_BSEG_OPEN_BAL
FROM BSEG
WHERE BUKRS = P_BUKRS
AND GSBER = IT_BA_CUST_COMB-GSBER
AND ( UMSKZ = ' ' )
OR UMSKZ IN S_UMSKZ )
AND KUNNR = IT_BA_CUST_COMB-KUNNR
AND KOART = P_KOART.
AND GJAHR = DATE1.
ENDIF.
SORT IT_BKPF_OPEN_BAL BY BELNR.
SORT IT_BSEG_OPEN_BAL BY BELNR.
LOOP AT IT_BSEG_OPEN_BAL.
CNT = SY-TABIX.
READ TABLE IT_BKPF_OPEN_BAL
WITH KEY BELNR = IT_BSEG_OPEN_BAL-BELNR
BINARY SEARCH.
IF SY-SUBRC <> 0.
DELETE IT_BSEG_OPEN_BAL INDEX CNT.
CLEAR IT_BSEG_OPEN_BAL.
ENDIF.
ENDLOOP. " END IT_BSEG_OPEN_BAL
PREV_YR_BAL = 0. " TO BE ADDED LATER ......
OPEN_BAL = PREV_YR_BAL.
LOOP AT IT_BSEG_OPEN_BAL.
IF IT_BSEG_OPEN_BAL-SHKZG = 'S'.
OPEN_BAL = OPEN_BAL + IT_BSEG_OPEN_BAL-DMBTR.
ELSE.
OPEN_BAL = OPEN_BAL - IT_BSEG_OPEN_BAL-DMBTR.
ENDIF.
ENDLOOP. " END OF IT_BSEG_OPEN_BAL
IF OPEN_BAL <> 0. " LATER CHECK CLOSING BAL = 0...
SELECT SINGLE NAME1 INTO WA_NAME1 FROM KNA1
WHERE KUNNR = IT_BA_CUST_COMB-KUNNR.
SELECT SINGLE GTEXT INTO WA_GTEXT FROM TGSBT
WHERE GSBER = IT_BA_CUST_COMB-GSBER.
LOOP AT IT_BSEG WHERE GSBER = IT_BA_CUST_COMB-GSBER
AND KUNNR = IT_BA_CUST_COMB-KUNNR.
IT_LINE_ITEMS-BELNR = IT_BSEG-BELNR.
IT_LINE_ITEMS-UMSKZ = IT_BSEG-UMSKZ.
IT_LINE_ITEMS-SHKZG = IT_BSEG-SHKZG.
IT_LINE_ITEMS-DMBTR = IT_BSEG-DMBTR.
IT_LINE_ITEMS-SGTXT = IT_BSEG-SGTXT.
IT_LINE_ITEMS-XBLNR = IT_BSEG-ZUONR.
IT_LINE_ITEMS-ZUONR = IT_BSEG-ZUONR.
APPEND IT_LINE_ITEMS.
ENDLOOP. " END OF IT_BSEG
SORT IT_BKPF BY BELNR.
CLOSE_BAL = OPEN_BAL.
LOOP AT IT_LINE_ITEMS.
CNT1 = SY-TABIX.
MONCR = 0. MONDR = 0.
READ TABLE IT_BKPF
WITH KEY BELNR = IT_LINE_ITEMS-BELNR
BINARY SEARCH.
IT_LINE_ITEMS-BUKRS = IT_BKPF-BUKRS.
IT_LINE_ITEMS-BUDAT = IT_BKPF-BUDAT.
IT_LINE_ITEMS-BLDAT = IT_BKPF-BLDAT.
IT_LINE_ITEMS-BLART = IT_BKPF-BLART.
IF IT_BKPF-BLART = 'ZS' AND IT_BKPF-BLART = 'ZT'.
SELECT SINGLE * FROM ZFIH0004
WHERE KUNNR = IT_BA_CUST_COMB-KUNNR
AND ZGROUP = IT_BKPF-XBLNR
AND SCH10_PRSC = IT_LINE_ITEMS-ZUONR
AND BUKRS = IT_BKPF-BUKRS.
IF SY-SUBRC = 0.
IT_LINE_ITEMS-BLDAT = ZFIH0004-BLDAT.
ENDIF.
ENDIF.
IF IT_LINE_ITEMS-BLART <> 'ZS' AND IT_LINE_ITEMS-BLART <> 'DZ'
AND IT_LINE_ITEMS-BLART <> 'ZT'.
IT_LINE_ITEMS-XBLNR = IT_BKPF-XBLNR.
ENDIF.
SELECT SINGLE LTEXT FROM T003T
INTO IT_LINE_ITEMS-LTEXT
WHERE BLART = IT_LINE_ITEMS-BLART
AND SPRAS = 'E'.
READ TABLE IT_VBRK
WITH KEY VBELN = IT_LINE_ITEMS-BELNR.
IF SY-SUBRC = 0.
IF IT_LINE_ITEMS-BLART = 'RV'.
IF IT_VBRK-VBTYP = 'M'.
IT_LINE_ITEMS-LTEXT = 'Invoice'.
ELSEIF IT_VBRK-VBTYP = 'N'.
IT_LINE_ITEMS-LTEXT = 'Invoice Cancellation'.
ELSEIF IT_VBRK-VBTYP = 'O'.
IT_LINE_ITEMS-LTEXT = 'Credit Note'.
ELSEIF IT_VBRK-VBTYP = 'P'.
IT_LINE_ITEMS-LTEXT = 'Debit Note'.
ENDIF.
ENDIF.
ENDIF.
SELECT SINGLE LTEXT FROM T074T
INTO IT_LINE_ITEMS-SGLTX
WHERE SHBKZ = IT_LINE_ITEMS-UMSKZ
AND SPRAS = 'E'
AND KOART = P_KOART.
IT_LINE_ITEMS-DAMNT = 0.
IT_LINE_ITEMS-CAMNT = 0.
IF IT_LINE_ITEMS-SHKZG = 'S'.
AND IT_LINE_ITEMS-BLART <> 'ZC'
AND IT_LINE_ITEMS-BLART <> 'DA'
AND IT_LINE_ITEMS-BLART <> 'ZV'.
IT_LINE_ITEMS-DAMNT = IT_LINE_ITEMS-DMBTR.
CLOSE_BAL = CLOSE_BAL + IT_LINE_ITEMS-DMBTR.
ELSE.
IF IT_LINE_ITEMS-BLART <> 'ZC' AND IT_LINE_ITEMS-BLART <> 'DA'
AND IT_LINE_ITEMS-BLART <> 'ZV'.
IT_LINE_ITEMS-CAMNT = IT_LINE_ITEMS-DMBTR.
CLOSE_BAL = CLOSE_BAL - IT_LINE_ITEMS-DMBTR.
ENDIF.
ENDIF.
MODIFY IT_LINE_ITEMS INDEX CNT1.
ENDLOOP.
SORT IT_LINE_ITEMS BY BELNR DMBTR.
*******************MODIFICATION**********
*LOOP AT IT_LINE_ITEMS.
*IF IT_LINE_ITEMS-BELNR = CLRDOC AND IT_LINE_ITEMS-DMBTR = CLRAMT.
DELETE IT_LINE_ITEMS WHERE BELNR = CLRDOC AND DMBTR = CLRAMT.
*ENDIF.
*CLRDOC = IT_LINE_ITEMS-BELNR.
*CLRAMT = IT_LINE_ITEMS-DMBTR.
*ENDLOOP.
CLRDOC = 0. CLRAMT = 0.
CNT = 0.
LOOP AT IT_LINE_ITEMS.
IT_LINEITEMS_DUP-CBELNR = IT_LINE_ITEMS-BELNR.
IT_LINEITEMS_DUP-CDMBTR = IT_LINE_ITEMS-DMBTR.
IT_LINEITEMS_DUP-CSHKZG = IT_LINE_ITEMS-SHKZG.
APPEND IT_LINEITEMS_DUP.
ENDLOOP.
LOOP AT IT_LINE_ITEMS.
*CNT = SY-TABIX.
LOOP AT IT_LINEITEMS_DUP WHERE CBELNR = IT_LINE_ITEMS-BELNR.
IF IT_LINEITEMS_DUP-CSHKZG = 'S'.
CLRAMT = CLRAMT + IT_LINEITEMS_DUP-CDMBTR.
ELSEIF IT_LINEITEMS_DUP-CSHKZG = 'H'.
CLRAMT = CLRAMT - IT_LINEITEMS_DUP-CDMBTR.
ENDIF.
ENDLOOP.
IF CLRAMT = 0.
DELETE IT_LINE_ITEMS WHERE BELNR = IT_LINEITEMS_DUP-CBELNR.
ENDIF.
CLRAMT = 0.
ENDLOOP.
****************MODIFICATION***********
SORT IT_LINE_ITEMS BY BUDAT BELNR.
IF OPEN_BAL = 0 AND CLOSE_BAL = 0 AND IT_LINE_ITEMS[] IS INITIAL.
COUNTR2 = COUNTR2 + 1.
CONTINUE.
ELSE.
AT NEW KUNNR.
NEW-PAGE.
ENDAT.
CLEAR G_FL.
SKIP 1.
CLEAR: WA_NAME,WA_NAME2,WA_NAME3,WA_NAME4,WA_CITY,WA_PSTLZ.
SELECT SINGLE NAME1 NAME2 ORT01 PSTLZ
FROM KNA1
INTO (WA_NAME01,WA_NAME21,WA_CITY1,WA_PSTLZ1)
WHERE KUNNR IN S_KUNNR.
WRITE : / 'Customer Account : ', IT_BA_CUST_COMB-KUNNR,
100 'Business Code : ', IT_BA_CUST_COMB-GSBER,
/ WA_NAME01, 100 'Business Area : ', WA_GTEXT,
/ WA_NAME21,/ WA_CITY1,/ WA_PSTLZ1.
SKIP 1.
G_FL = 'X'.
SKIP 1.
ULINE AT (152).
FORMAT COLOR COL_HEADING INTENSIFIED.
WRITE :/ SY-VLINE NO-GAP, 'Doc.Date',
12 SY-VLINE NO-GAP, 'Doc.No.',
23 SY-VLINE NO-GAP, 'Ref.Doc.No.',
37 SY-VLINE NO-GAP, 'Ref.Doc.Date',
49 SY-VLINE NO-GAP, 'Ref.Doc.Name',
70 SY-VLINE NO-GAP, 'Advances/Deposits',
70 SY-VLINE NO-GAP, 'Description',
95 SY-VLINE NO-GAP, ' Debit' RIGHT-JUSTIFIED,
120 SY-VLINE NO-GAP, ' Credit' RIGHT-JUSTIFIED,
136 SY-VLINE NO-GAP, ' Balance' RIGHT-JUSTIFIED,
152 SY-VLINE NO-GAP.
ULINE AT (152).
FORMAT COLOR OFF INTENSIFIED OFF.
FORMAT COLOR COL_TOTAL INTENSIFIED OFF.
IF OPEN_BAL >= 0.
WRITE : / SY-VLINE NO-GAP,
70 SY-VLINE NO-GAP, 'OPENING BALANCE',
95 SY-VLINE NO-GAP, OPEN_BAL NO-GAP,
120 SY-VLINE NO-GAP,
136 SY-VLINE NO-GAP,
152 SY-VLINE NO-GAP.
ELSE.
WRITE : / SY-VLINE NO-GAP,
70 SY-VLINE NO-GAP, 'OPENING BALANCE',
95 SY-VLINE NO-GAP,
120 SY-VLINE NO-GAP, OPEN_BAL NO-GAP,
136 SY-VLINE NO-GAP,
152 SY-VLINE NO-GAP.
ENDIF.
FORMAT COLOR COL_TOTAL INTENSIFIED OFF.
ULINE AT (152).
LOOP AT IT_LINE_ITEMS.
WHERE BLART NE 'ZC'
AND BLART NE 'DA'
AND BLART NE 'ZV'.
**************MODIFICATIONS**************
IF MON = 0.
MON = IT_LINE_ITEMS-BUDAT+4.
MONTOT = OPEN_BAL.
ENDIF.
IF MON <> IT_LINE_ITEMS-BUDAT+4(2).
MONTOT = MONTOT + MONDR - MONCR.
ULINE AT (152).
FORMAT COLOR COL_TOTAL INTENSIFIED OFF.
WRITE :/ SY-VLINE NO-GAP,
70 SY-VLINE NO-GAP, 'MONTH TOTAL',
95 SY-VLINE NO-GAP, MONDR,
120 SY-VLINE NO-GAP, MONCR,
136 SY-VLINE NO-GAP,
152 SY-VLINE NO-GAP.
ULINE AT (152).
IF MONTOT >= 0.
WRITE :/ SY-VLINE NO-GAP,
70 SY-VLINE NO-GAP, 'MONTH CLOSING BALANCE',
95 SY-VLINE NO-GAP, MONTOT,
120 SY-VLINE NO-GAP,
136 SY-VLINE NO-GAP,
152 SY-VLINE NO-GAP.
ELSE.
WRITE :/ SY-VLINE NO-GAP,
70 SY-VLINE NO-GAP, 'MONTH CLOSING BALANCE',
95 SY-VLINE NO-GAP,
120 SY-VLINE NO-GAP, MONTOT,
136 SY-VLINE NO-GAP,
152 SY-VLINE NO-GAP.
ENDIF.
FORMAT COLOR COL_TOTAL INTENSIFIED OFF.
ULINE AT (152).
MON = IT_LINE_ITEMS-BUDAT+4.
MONDR = 0. MONCR = 0.
ENDIF.
IF IT_LINE_ITEMS-SHKZG = 'S'.
MONDR = MONDR + IT_LINE_ITEMS-DMBTR.
ELSE.
MONCR = MONCR + IT_LINE_ITEMS-DMBTR.
ENDIF.
IF IT_LINE_ITEMS-SGTXT = ' '.
PERFORM SUB_GET_TEXT.
ENDIF.
ULINE AT (152).
FORMAT COLOR COL_NORMAL INTENSIFIED.
FORMAT COLOR COL_BACKGROUND INTENSIFIED OFF.
IF IT_LINE_ITEMS-DAMNT = 0.
WRITE :/ SY-VLINE NO-GAP, IT_LINE_ITEMS-BUDAT NO-GAP,
12 SY-VLINE NO-GAP, IT_LINE_ITEMS-BELNR NO-GAP,
23 SY-VLINE NO-GAP, IT_LINE_ITEMS-XBLNR NO-GAP,
37 SY-VLINE NO-GAP, IT_LINE_ITEMS-BLDAT NO-GAP,
49 SY-VLINE NO-GAP, IT_LINE_ITEMS-LTEXT NO-GAP,
70 SY-VLINE NO-GAP, 71(23) IT_LINE_ITEMS-SGTXT
NO-GAP,
95 SY-VLINE NO-GAP,
120 SY-VLINE NO-GAP, IT_LINE_ITEMS-CAMNT NO-GAP,
136 SY-VLINE NO-GAP,
152 SY-VLINE NO-GAP.
ELSEIF IT_LINE_ITEMS-CAMNT = 0.
WRITE :/ SY-VLINE NO-GAP, IT_LINE_ITEMS-BUDAT NO-GAP,
12 SY-VLINE NO-GAP, IT_LINE_ITEMS-BELNR NO-GAP,
23 SY-VLINE NO-GAP, IT_LINE_ITEMS-XBLNR NO-GAP,
37 SY-VLINE NO-GAP, IT_LINE_ITEMS-BLDAT NO-GAP,
49 SY-VLINE NO-GAP, IT_LINE_ITEMS-LTEXT NO-GAP,
70 SY-VLINE NO-GAP, 71(23) IT_LINE_ITEMS-SGTXT NO-GAP,
95 SY-VLINE NO-GAP, IT_LINE_ITEMS-DAMNT NO-GAP,
120 SY-VLINE NO-GAP,
136 SY-VLINE NO-GAP,
152 SY-VLINE NO-GAP.
ELSE.
WRITE :/ SY-VLINE NO-GAP, IT_LINE_ITEMS-BUDAT NO-GAP,
12 SY-VLINE NO-GAP, IT_LINE_ITEMS-BELNR NO-GAP,
23 SY-VLINE NO-GAP, IT_LINE_ITEMS-XBLNR NO-GAP,
37 SY-VLINE NO-GAP, IT_LINE_ITEMS-BLDAT NO-GAP,
49 SY-VLINE NO-GAP, IT_LINE_ITEMS-LTEXT NO-GAP,
70 SY-VLINE NO-GAP, 71(23) IT_LINE_ITEMS-SGTXT NO-GAP,
95 SY-VLINE NO-GAP, IT_LINE_ITEMS-DAMNT NO-GAP,
120 SY-VLINE NO-GAP, IT_LINE_ITEMS-CAMNT NO-GAP,
136 SY-VLINE NO-GAP,
152 SY-VLINE NO-GAP.
ENDIF.
IT_LINE_ITEMS-SGLTX = ''.
ENDLOOP.
MONTOT = MONTOT + MONDR - MONCR.
ULINE AT (152).
FORMAT COLOR COL_TOTAL INTENSIFIED OFF.
WRITE :/ SY-VLINE NO-GAP,
70 SY-VLINE NO-GAP, 'MONTH TOTAL',
95 SY-VLINE NO-GAP, MONDR,
120 SY-VLINE NO-GAP, MONCR,
136 SY-VLINE NO-GAP,
152 SY-VLINE NO-GAP.
ULINE AT (152).
IF MONTOT >= 0.
WRITE :/ SY-VLINE NO-GAP,
70 SY-VLINE NO-GAP, 'MONTH CLOSING BALANCE',
95 SY-VLINE NO-GAP, MONTOT,
120 SY-VLINE NO-GAP,
136 SY-VLINE NO-GAP,
152 SY-VLINE NO-GAP.
ELSE.
WRITE :/ SY-VLINE NO-GAP,
70 SY-VLINE NO-GAP, 'MONTH CLOSING BALANCE',
95 SY-VLINE NO-GAP,
120 SY-VLINE NO-GAP, MONTOT,
136 SY-VLINE NO-GAP,
152 SY-VLINE NO-GAP.
ENDIF.
FORMAT COLOR COL_TOTAL INTENSIFIED OFF.
ULINE AT (152).
MONCR = 0. MONDR = 0.
FORMAT COLOR COL_NORMAL INTENSIFIED OFF.
FORMAT COLOR COL_TOTAL INTENSIFIED.
IF CLOSE_BAL >= 0.
WRITE : / SY-VLINE NO-GAP,
70 SY-VLINE NO-GAP, 'CLOSING BALANCE',
95 SY-VLINE NO-GAP, CLOSE_BAL NO-GAP,
120 SY-VLINE NO-GAP,
136 SY-VLINE NO-GAP,
152 SY-VLINE NO-GAP.
ELSE.
WRITE : / SY-VLINE NO-GAP,
70 SY-VLINE NO-GAP, 'CLOSING BALANCE',
95 SY-VLINE NO-GAP,
120 SY-VLINE NO-GAP, CLOSE_BAL NO-GAP,
136 SY-VLINE NO-GAP,
152 SY-VLINE NO-GAP.
ENDIF.
ULINE AT (152).
MON = 0. MONTOT = 0.
MONDR = 0. MONCR = 0.
ENDIF.
FORMAT COLOR COL_TOTAL INTENSIFIED OFF.
FORMAT COLOR COL_BACKGROUND INTENSIFIED OFF.
*****MODIFICATION ON 13.08.2005***
CLEAR IT_LINE_ITEMS.
REFRESH IT_LINE_ITEMS.
CLEAR OPEN_BAL.
CLEAR CLOSE_BAL.
******END OF MODIFICATION****
FREE OPEN_BAL.
FREE CLOSE_BAL.
FREE IT_LINE_ITEMS.
IF G_FL = 'X'.
AT END OF KUNNR.
NEW-PAGE.
ENDAT.
CLEAR G_FL.
SKIP 1.
ENDIF.
ENDLOOP.
ENDIF. " ENDIF OF NOT INITIAL IT_BA_CUST_COMB.
***********MODIFICATION**********
IF COUNTR1 = COUNTR2.
WRITE : /20 '********** NO DATA SELECTED **********'.
ENDIF.
********END OF MODIFICATION********
IF IT_BA_CUST_COMB[] IS INITIAL.
WRITE : /20 '********** NO DATA SELECTED **********'.
ENDIF.
ENDFORM. "PROCESS_DISPLAY_DATA
*& Form sub_get_text
text
FORM SUB_GET_TEXT .
*select single * from vbak where vbeln = it_vbrk-aubel.
DATA: L_VBELN LIKE THEAD-TDNAME.
SELECT SINGLE AUBEL FROM VBRP INTO VBRP-AUBEL WHERE VBELN =
IT_LINE_ITEMS-BELNR.
L_VBELN = VBRP-AUBEL..
l_vbeln = it_vbrk-aubel.
CALL FUNCTION 'READ_TEXT'
EXPORTING
CLIENT = SY-MANDT
ID = '0001'
LANGUAGE = SY-LANGU
NAME = L_VBELN
OBJECT = 'VBBK'
ARCHIVE_HANDLE = 0
LOCAL_CAT = ' '
IMPORTING
HEADER =
TABLES
LINES = IT_TEXT
EXCEPTIONS
ID = 1
LANGUAGE = 2
NAME = 3
NOT_FOUND = 4
OBJECT = 5
REFERENCE_CHECK = 6
WRONG_ACCESS_TO_ARCHIVE = 7
OTHERS = 8
IF SY-SUBRC <> 0.
REFRESH: IT_TEXT.
CLEAR: IT_TEXT.
ENDIF.
LOOP AT IT_TEXT.
IT_LINE_ITEMS-SGTXT = IT_TEXT-TDLINE.
ENDLOOP.
ENDFORM. "sub_get_text
*& Form GET_SUP_PLANT
text
--> p1 text
<-- p2 text
FORM GET_SUP_PLANT .
CALL FUNCTION 'PIA_CSO_PLANT_ADDRESS_READ'
EXPORTING
PI_PLANT = WA_VWERK
IMPORTING
PE_PLADDR = IT_PLANT
PE_RETURN1 =
APPEND IT_PLANT.
LOOP AT IT_PLANT.
WA_NAME = IT_PLANT-NAME.
WA_NAME2 = IT_PLANT-NAME_2.
WA_NAME3 = IT_PLANT-NAME_3.
WA_NAME4 = IT_PLANT-NAME_4.
WA_CITY = IT_PLANT-CITY.
WA_PSTLZ = IT_PLANT-POSTL_COD1.
ENDLOOP.
ENDFORM. " GET_SUP_PLANT
Similar Messages
-
I need to print a text but only for the last page in the main window.
I have tried with IF.
IF &PAGE& = &SAPSCRIPT-FORMPAGES&
BOTTOM
....TEXT
ENDBOTTOM
ENDIF
But it prints in all pages in every main window.
Can someone point me what I am doing wrong or how can I do this?
Regards,
CarlosHello Carlos,
the problem with this condition is the following.
The Sapscript composer cannot know during the processing of e.g. the first page,
how many pages will follow. So &SAPSCRIPT-FORMPAGES& still contains the same
value like& PAGE& and is filled with the correct values only at the very end of the processing.
(when the total number of pages is known).
So I suggest you to use the BOTTOM command in the print program,
when the processing of all item of the MAIN window is ended.
There is an other variable &NEXTPAGE&. &NEXTPAGE& will always be 0
when it reaches to last page to print. The problem with this variable that
it can not be used in a condition in MAIN window too, only in a separate page window.
Regards,
Hedvig -
Layout Question - How to print a frame on the bottom of the last page ?
I have a summary frame for my report. I want to print the summary information at the bottom of the last page of the report. Currently depending on the data, the summary frame prints anywhere on the last page. How do I make sure it prints exactly at the bottom of the last page (just the last page).
Thanks in advance.You might like to take a look at the following threads:
Last frame with last record of proceding repeating frame
Re: How to capture a keystroke - including control chars? -
Formatting - How to print a frame on the bottom of the last page ?
I have a summary frame for my report. I want to print the summary information at the bottom of the last page of the report. Currently depending on the data, the summary frame prints anywhere on the last page. How do I make sure it prints exactly at the bottom of the last page.
Thanks in advance.Hello,
I know this is an old post, but I have the same problem. I am unable to access the examples for Note.252881.1 (corrupted file). May I impose on you to send me examples via e-mail? If this is not possible can you point me in a direction where there is "good" documentation on frame manipulations? What I've found on metalink, otn, internet, etc. haven't been too forthcoming.
Thank you. -
How to print based on the logic that it is the last page of the report
HI
I want to print something on the last page.For example,I have to print a image(signature) file on the last page.How can I have the logic that it is the last page or any counter or variable to find that it is the last page of the report??
Thanks in advance.Is there an example of this posted somewhere that actually works?
I have used this exact syntax in everyway, every location possible and it either locks my MSWORD window on preview or throws a Java error.
I am using the most current BIP template builder v10.1.3.2.1
Thanks,
Scott
Sample files below:
<?start:body?><?for-each:G_TEST?>
<?TEST1?> <?TEST2?>
<?TEST3?>
THIS SHOULD PRINT ON ALL PAGES
<?start@last-page:body?> PRINT ONLY ON THE LAST PAGE<?end body?>
<?end for-each?><?end body?>
<?xml version="1.0" encoding="WINDOWS-1252"?>
<TEST>
<LIST_G_TEST>
<G_TEST>
<TEST1>TEST Data Line Number One</TEST1>
<TEST2>Test Data Line 2</TEST2>
<TEST3>33 Test Data Line 3</TEST3>
</G_TEST>
<G_TEST>
<TEST1>TEST Data Line Number One</TEST1>
<TEST2>Test Data Line 2</TEST2>
<TEST3>33 Test Data Line 3</TEST3>
</G_TEST>
<G_TEST>
<TEST1>TEST Data Line Number One</TEST1>
<TEST2>Test Data Line 2</TEST2>
<TEST3>33 Test Data Line 3</TEST3>
</G_TEST>
<G_TEST>
<TEST1>TEST Data Line Number One</TEST1>
<TEST2>Test Data Line 2</TEST2>
<TEST3>33 Test Data Line 3</TEST3>
</G_TEST>
<G_TEST>
<TEST1>TEST Data Line Number One</TEST1>
<TEST2>Test Data Line 2</TEST2>
<TEST3>33 Test Data Line 3</TEST3>
</G_TEST>
</LIST_G_TEST>
</TEST> -
How do i make a frame a enclosing a repeating frame appear only on the last page of a report?
I have a frame that encloses a repeating frame. How so i make them print only on the last page?
Assuming you have other content, you could:
set the Print Object On property to be last page.
anchor it to the main content that repeats on every page, so this frame only prints after the other one is done
Assign a format trigger where you make it display only if current page is equal to total number of pages
create a trailer and move the frame there -
How to make the footer text to come only on the last page
Hi,
Iam just making an print forms using adobe forms,Iam havinga text and some variable in the end of the page.these things need to be printed only on the last page.
if my output of the main window comes for 2 pages then it should print only in the second page not in the first page.
if the data of my main item data comes to one page then this should be printed on the first page itself.
how to put a condition on this type of footer windows.
Thanks in advance.
regards,
Sasidhartry with the following formcalc Scripting on the subform which contains the footer text...
var curpage = $layout.page ( ref ( $ ) )
var totpages = $layout.pageCount()
if ( curpage ne totpages ) then
$.presence = "hidden"
endif -
Page Break-An extra blank page as the last page.
I have a template with a page break (<?split-by-page-break:?>) at the end of the template prior to the end of loop <?end for-each?>. This is causing an extra blank page at the end everytime the report is run. I checked this forum and got some pointers and used couple of them but didn't get the blank page to go!
I tried this in my page break filed! <?if:position()!=last()?><?split-by-page-break:?><?end if?>
Please help.
Thanks,
FranHi, ive faced a similar problem in the past, I worked around it using subtemplates, but it still gives out an extra blank page if the content on the last page comes within 3 lines of the bottom of the page.. otherwise its ok..if you could send me your template and a sample xml file at domnic26ATgmail, i will see what i can do to help.
regards,
Domnic -
I don't want to print the last page of a smartform when there is no content
I don't want to print the last page of a smartform when there is no content. Kindly help
If the last page is printed, there are two possibilities
-1- The MAIN WINDOW is only in this page
-2- The page is explicitly printed from another page (new-page)
-3- There is date but its only space or skip line.
So in your form
-1- Redefine the logic of your form
-2- Check that, there are some data to be printed before calling the NEW-PAGE
-3- Do skip or write space lines before printing an actual line and not after
Regards -
How to print a label in the last page of the report
Hi, I have a report af bottom page I trid to put a label, the label is in the margin, but when I change the print condition send me a error, illegal print condition, how can I print this label only in the last page at the botton of the page
ThanksHerbe,
You can do this using format trigger
Please see the building reports manual / Tutorial for details
at http://otn.oracle.com/docs/products/reports/content.html
Thanks
The Oracle Reports team -
Avoid printing Header and Footer in the last page
Hi,
Could anyone please let me know how to avoid print the header and footer in the last page?
Note: I'm printing RTF template for publishing the output.
Looking forward for your valuable inputs/suggestions.
Thanks in advance,
Regards,
MuruHai,
My report got FROM PO & TO PO parameters and i need to print footer only in first page of each PO. Tried with section but now i am getting first page of all PO contionious and then all lines together.
Please call me or sent replies to [email protected] -
How can I print a label on the last page of the report in the margin
I would like to display a label on my report but has to appear only on the last page of the report in the margin area or as a footer. I have tried using the solution below that I came across in this forum. This solution only worked if I put the label as a report trailer and not in the margin of the main section of report. The problem of putting the label as a report trailer is that it will only appear at the end of the report on it's own page, i.e. on a new page. I would like the label to appear at the end of the report, on the last page which has the other report details and not to appear on a new page on its own. Could you please help? Thanks.
1. Create a dummy query, like
select 1 dummy
from dual
2. Create a package spec:
PACKAGE pkg_globals IS
totalPages number(3);
END;
2. Create a repeating frame and field for this dummy at the end of the report layout.
3. Create a format trigger for this frame:
function R_1FormatTrigger return boolean is
begin
SRW.GET_PAGE_NUM(pkg_globals.totalPages);
return (FALSE);
end;
4. Create a format trigger for your margin field:
function F_1FormatTrigger return boolean is
pagenum number;
begin
srw.get_page_num(pagenum);
if pagenum = pkg_globals.totalPages then
return (TRUE);
else
return (false);
end if;
end;user8655468 wrote:
I would like to display a label on my report but has to appear only on the last page of the report in the margin areaCreate a fixed frame at the bottom of margin area and inside the frame put your label.
set the frame print object on: Last page
Hope this works.. -
How to Print T&C on backside of the last page in smartform.
Hi All,
I have requirement from one of the my client to print the terms & condition page on the back side of last page in invoice form.
I have created three pages as below.
First page: To Print header data,Print mode:blank,Next page : NEXT.
Second page : Contains the continuation of the data,if there are enough lines,Print Mode: D,Next page : NEXT.
Last page:To Print T&C,Print mode : blank,Next page :blank.
This is working properly when form has 2 pages.Here my question is,
How to print the T&C on backside of first page,if form has only one page.
Thanks in Advance.Hi Vineesh,
I have 3 pages in my form.
First page: To Print header data, Print mode:blank, Next page : NEXT.
First page has the comment node, go to next page as Third page.
Second page : Contains the continuation of the data, if there are enough lines, Print Mode: D,
Next page : NEXT.
Third Page: T&C page, Print mode : blank,Next page :blank
The 3rd page should print back side of the page.
If form has only one page,then first page should be in D mode.Hence the T&C page will print back side of first page.
If form has multiple pages. then the last page ( where the main window gets end ) should be D.Hence
the T&C page will print back side of last page.
How to achieve this both the scenarios?
Thanks & Regards,
Priya Chandran -
(Smartform) Print grand total on the last page
Hi everyone,
I'm trying to print the Grand Totals on the last page of my Smartform. I have two pages - FIRST and SECOND.
What I did was I created a Text to display the grand total, and I specified that this text should be printed 'Only After End of Main Window'. However, the total is not being printed out.
I can't change the condition to 'Not on First Page', because my form has more than two pages, and I only want the grand totals on the last page.
Any help would be appreciated.hi,
we have a window type called final window if u define this type window in second page . create a table in the window and go to calculations tab and define an internal table. i think u can get the grand totals.
if u want maore clearly go throuh this link
https://www.sdn.sap.com/irj/sdn/forums
hope this will help you.
REWARD ME IF USEFUL.
thanks,
gupta
Edited by: gupta pullipudi on Apr 9, 2008 9:23 PM -
How to print text or field (inside a rep fram)on the last page in report 6i
Hi Everyone,
I want to print the text on the last page.
my text is inside a repetating frame.
as i want to display page no in the filed
and if it is a last page, display page number appended with Last
so it will look like
for 3 pages
on the first page
1
on second page
2
and on last page it should display
3 LastYou cannot know if you are on the last page or not. See this similar thread: Get value of total pages variable
Why not put the page number in the margin like this:
Page 1 of 3
Page 2 of 3
Page 3 of 3
You do that by creating a text field in the margin. Enter this text:
Page &<PhysicalPageNumber> of &<TotalPhysicalPages>
Maybe you are looking for
-
Receiver RFC error- RfcClientException: functiontemplate from repository wa
Hi All, I am in an R/3(IDOC) - XI - 3rd party(File) scenario. Need to do a lookup to R/3 from XI before file is sent to 3rd party system. For RFC, I followed various blogs( currently using Michaels blog https://www.sdn.sap.com/irj/sdn/go/portal/prtro
-
Flex and Augmented Reality, Preview not working
Hi I have been following the tutorial Introduction to Augmented Reality on gotoandlearn(http://www.gotoandlearn.com/play.php?id=105). I have followed the coding exactly and yet nothing happens when I go to preview it. I have even copied the code
-
Enterprise Services, Service Operations and Functional Business Component
Hi, in the Enterprise Service desing guide (see https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/40c05360-0501-0010-63bd-aedd415b6e05 ) the relations between Enterprise Services and Service Operations are covered. I understand
-
There is one page on my website that when I press "edit page", it says that it "cannot create a local lock file". Every other page on the website can at least access the edit screen, except this one. The website is http://www.ergofitconsulting.com/ ,
-
Indesign crashes on opening (Quit unexpededly notice) CS5
Indesign crashes immediately on opening. Several times saying it is corrupted but recently just 'quit unexpectedly' This began after moving all software & files from old macbook to new Imac, Is there a way I can uninstall then re install just Indesig