on 04-08-2009 7:22 AM
hi all,
i made a script but problem is that when i m calling it in driver program then its repeating the main window while i taken main window in loop but in ITAB there is only one value.
can anyone please help me?
regards saurabh.
Edited by: saurabh srivastava on Apr 8, 2009 8:41 AM
Saurabh,
Please use the meaningful subject while posting
Please post the Script related questions in the section FORM Printing.
Now coming to your question, can you elaborate what is your requirement?
I am confused with the statement you have written. plz explain clearly
Thanks,
Babu Kilari
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
actually i made only one page in script that is PAGE1 and in next page i m giving same PAGE1, i think reason is that. but if i dont give next page then its giving error in driver program as 'Write_Form is Invalid and Start_form is mising' .
can anyone please help me?
driver program :
REPORT zpf_trust_print NO STANDARD PAGE HEADING LINE-SIZE 125.
TABLES : zprint, zpf_loan, zprev_emp, zpf_clos_bal, pa0001, pa0587, itcpo.
TYPE-POOLS : slis.
***********************************************************************
DATA : BEGIN OF itab OCCURS 0,
pernr LIKE zprint-pernr,
period LIKE zprint-period,
gjahr LIKE zprint-gjahr,
eepf LIKE zprint-eepf,
eevpf LIKE zprint-eevpf,
erpf LIKE zprint-erpf,
er_pens LIKE zprint-er_pens,
ref_loan LIKE zprint-ref_loan,
non_rfloan LIKE zprint-non_rfloan,
loan_col LIKE zprint-loan_col,
er_open_bal LIKE zprint-er_open_bal,
er_clos_bal LIKE zprint-er_clos_bal,
ee_open_bal LIKE zprint-ee_open_bal,
ee_clos_bal LIKE zprint-ee_clos_bal,
ee_intrest LIKE zprint-ee_intrest,
er_intrest LIKE zprint-er_intrest,
flag LIKE zprint-flag,
eepf_p LIKE zprev_emp-eepf,
eevpf_p LIKE zprev_emp-eevpf,
erpf_p LIKE zprev_emp-erpf,
ename LIKE pa0001-ename,
kostl LIKE pa0001-kostl,
eepfn LIKE pa0587-eepfn,
END OF itab.
DATA : period1 TYPE i.
DATA : closing TYPE p DECIMALS 2.
DATA : closing1 TYPE p DECIMALS 2.
DATA : gjahr1 TYPE zprint-gjahr.
DATA : date TYPE d.
DATA : tot TYPE p DECIMALS 2.
DATA : tot1 TYPE p DECIMALS 2.
DATA : tot2 TYPE p DECIMALS 2.
***********************************************************************
SELECTION-SCREEN : BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
SELECT-OPTIONS : pernr FOR zprint-pernr,
period FOR zprint-period NO INTERVALS NO-EXTENSION,
gjahr FOR zprint-gjahr NO INTERVALS NO-EXTENSION.
SELECTION-SCREEN : END OF BLOCK b1.
***********************************************************************
AT SELECTION-SCREEN.
IF period IS NOT INITIAL.
IF period-low LT '01' OR period-low GT '12'.
MESSAGE 'Please Enter Period Betveen 1 to 12' TYPE 'I'.
ENDIF.
ENDIF.
*START-OF-SELECTION.
PERFORM print_form.
*&---------------------------------------------------------------------*
*& Form PRINT_FORM
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* --> p1 text
* <-- p2 text
*----------------------------------------------------------------------*
FORM print_form .
itcpo-tdimmed = 'X'.
itcpo-tddelete = 'X'.
CALL FUNCTION 'OPEN_FORM'
EXPORTING
* APPLICATION = 'TX'
device = 'PRINTER'
dialog = 'X'
form = 'ZPF_TRUST'
language = sy-langu.
SELECT pernr period gjahr FROM zprint INTO TABLE itab WHERE pernr IN pernr AND period IN period AND gjahr IN gjahr.
IF sy-subrc NE 0.
MESSAGE 'Data not found in ZPRINT table.' TYPE 'I'.
ENDIF.
SORT itab BY pernr PERIOD DESCENDING.
DELETE ADJACENT DUPLICATES FROM ITAB COMPARING PERNR.
LOOP AT itab.
CLEAR : tot, tot1, tot2.
date = sy-datum.
SELECT SINGLE ename kostl FROM pa0001 INTO (itab-ename , itab-kostl) WHERE pernr = itab-pernr.
SELECT SINGLE eepfn FROM pa0587 INTO itab-eepfn WHERE pernr = itab-pernr AND endda = '99991231'.
SELECT SINGLE ee_open_bal FROM zprint INTO itab-ee_open_bal WHERE pernr = itab-pernr AND period = itab-period AND gjahr = itab-gjahr.
SELECT SINGLE er_open_bal FROM zprint INTO itab-er_open_bal WHERE pernr = itab-pernr AND period = itab-period AND gjahr = itab-gjahr.
SELECT SUM( eepf ) FROM zprint INTO itab-eepf WHERE pernr = itab-pernr AND gjahr = itab-gjahr.
SELECT SUM( erpf ) FROM zprint INTO itab-erpf WHERE pernr = itab-pernr AND gjahr = itab-gjahr.
SELECT SUM( ee_intrest ) FROM zprint INTO itab-ee_intrest WHERE pernr = itab-pernr AND gjahr = itab-gjahr.
SELECT SUM( er_intrest ) FROM zprint INTO itab-er_intrest WHERE pernr = itab-pernr AND gjahr = itab-gjahr.
tot = itab-ee_open_bal + itab-eepf + itab-ee_intrest.
tot1 = itab-er_open_bal + itab-erpf + itab-er_intrest.
tot2 = tot + tot1.
CALL FUNCTION 'WRITE_FORM'
EXPORTING
* ELEMENT = ' '
function = 'SET'
type = 'BODY'
window = 'HEADER'.
CALL FUNCTION 'WRITE_FORM'
EXPORTING
* ELEMENT = ' '
function = 'SET'
type = 'BODY'
window = 'HEADER2'.
CALL FUNCTION 'WRITE_FORM'
EXPORTING
* ELEMENT = ' '
function = 'SET'
type = 'BODY'
window = 'HEADER3'.
CALL FUNCTION 'WRITE_FORM'
EXPORTING
* ELEMENT = ' '
function = 'SET'
type = 'BODY'
window = 'MAIN'.
CALL FUNCTION 'WRITE_FORM'
EXPORTING
* ELEMENT = ' '
function = 'SET'
type = 'BODY'
window = 'TRUSTEE'.
delete itab.
clear itab.
ENDLOOP.
CALL FUNCTION 'CLOSE_FORM'
* IMPORTING
* RESULT =
* RDI_RESULT =
* TABLES
* OTFDATA =
* EXCEPTIONS
* UNOPENED = 1
* BAD_PAGEFORMAT_FOR_PRINT = 2
* SEND_ERROR = 3
* SPOOL_ERROR = 4
* CODEPAGE = 5
* OTHERS = 6
.
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDFORM. " PRINT_FORM
User | Count |
---|---|
95 | |
11 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.