cancel
Showing results for 
Search instead for 
Did you mean: 

printing Smartform for a series of data

Former Member
0 Kudos

hello People,

i am stuck up in a situation which sums up like this

i am having a range of check numbers for which the details of checks have to be printed.

the req is all the check between the range has to be printed in that many pages and printer should be assigned once only

that is for 10 checks smartform should have 10 pages.

the code i have designed is mentioned below

it is working fine in terms of execution, the only problem is that

only the last check in the range is showing in the preview.

all other are bieng overwritten.

in the debugger i can see the values for all checks being assigned.

<u><i><b>the thing is i want the first time the loop execute it should print check in first page

the next time the loop executes it should print check in second page

and so on till the tenth.</b></i>.</u>

<b>few points i wud lik to mention :

its not the standard check format, so dont think in dat direction,

the whole content including the main and secondary window is changing not just the table in main window</b>

please help

here is the code i devised

**********************************

upper = upper.

lower = lower.

itab = itab.

select chect

from payr

into table itab

where HBKID EQ BANK

AND CHECT between lower and upper.

break-point.

DATA: l_char18 TYPE char18,

l_p TYPE p DECIMALS 2.

loop at itab into wa_itab.

SELECT SINGLE zbukr

hbkid

hktid

rzawe

chect

lifnr

kunnr

ubhkt

vblnr

zaldt

waers

rwbtr

pridt

zanre

znme1

FROM payr

INTO wa_payr

WHERE chect EQ wa_itab-chect

and hbkid eq bank.

IF sy-subrc EQ 0.

SELECT SINGLE lifnr

adrnr

FROM lfa1

INTO wa_lfa1

WHERE lifnr EQ wa_payr-lifnr.

SELECT SINGLE addrnumber

date_from

nation

name1

name2

name4

city1

post_code1

po_box_loc

street

tel_number

region

FROM adrc

INTO wa_adrc

WHERE addrnumber EQ wa_lfa1-adrnr.

SELECT bukrs

belnr

gjahr

buzei

augbl

shkzg

mwskz

dmbtr

qbshb

FROM bseg

INTO TABLE it_bseg

WHERE augbl EQ wa_payr-vblnr

AND shkzg = 'H'.

IF sy-subrc EQ 0.

SELECT bukrs

belnr

gjahr

xblnr

FROM bkpf

INTO TABLE it_bkpf

FOR ALL ENTRIES IN it_bseg

WHERE belnr = it_bseg-belnr.

LOOP AT it_bseg INTO wa_bseg.

READ TABLE it_bkpf INTO wa_bkpf

WITH KEY belnr = wa_bseg-belnr.

wa_disp-billno = wa_bkpf-xblnr.

  • wa_disp-amount = wa_bseg-dmbtr.

l_char18 = wa_bseg-dmbtr.

SHIFT l_char18 LEFT DELETING LEADING space.

wa_disp-amount = l_char18.

l_p = wa_disp-amount.

CLEAR wa_disp-amount.

wa_disp-amount = l_p.

CLEAR l_p.

SHIFT wa_disp-amount LEFT DELETING LEADING space.

  • wa_disp-tdsamt = wa_bseg-qbshb.

l_char18 = wa_bseg-qbshb.

SHIFT l_char18 LEFT DELETING LEADING space.

wa_disp-tdsamt = l_char18.

l_p = wa_disp-tdsamt.

CLEAR wa_disp-tdsamt.

wa_disp-tdsamt = l_p.

CLEAR l_p.

SHIFT wa_disp-tdsamt LEFT DELETING LEADING space.

APPEND wa_disp TO it_disp.

CLEAR wa_disp.

ENDLOOP.

ENDIF.

ELSE.

MESSAGE 'Entered Cheque No is Incorrect' TYPE 'E' RAISING exc1.

ENDIF.

endloop.

help people

thanks & regards

Nitin

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

hi Nitin

just give a try with this .

create one loop and for that give your int_tab which holds the records of all the checks say 10 checks.

also create one program lines wherein you l set the flag to 1 whenever the itab count increases if not then set the flag to 0.

now inside the main window create one command node and check the go to new page checkbox and give your second(or next page) name , and in the conditions tab keep the flag = 1.

the extra work you need to do is you have to create one next page with all the same windows which will triggers for evry new line item.

hope it may be helpful to you.

plz reward points if helpful

Regards

Zarina