cancel
Showing results for 
Search instead for 
Did you mean: 

SapScript Printing - Looping at itab

prince_isaac
Active Participant
0 Kudos

hie guys

im looping at an int tab printing line items, however the int tab header is being printed as well ie

DH 001 Prince Isaac $2000 (Header Detail)

LN 001 Prince Isaac $2000 (Line item 1)

LN 002 Isaac Prince $2000 (Line item 2)

i have declared my itab like so:

data: itab TYPE TABLE OF <table> WITH HEADER LINE.

and populated like so:

SELECT * FROM <table>

INTO table itab

WHERE kunnr = customer.

howcome it is behaving like this??

<MOVED BY MODERATOR TO THE CORRECT FORUM>

Edited by: Alvaro Tejada Galindo on Aug 18, 2008 1:09 PM

Accepted Solutions (0)

Answers (5)

Answers (5)

Former Member
0 Kudos

Could you post the portion of the code where you loop through the itab and call WRITE_FORM?

Rob

prince_isaac
Active Participant
0 Kudos

hie Rob can i post the code 2mrw morning since im now by my house

Former Member
0 Kudos

You get to go home? Lucky you

Post when ready.

Rob

prince_isaac
Active Participant
0 Kudos

thanx a lot guys the qsn is answered!!

prince_isaac
Active Participant
0 Kudos

the suggestions i tried dd not work for me..maybe am i failing to implement??

prince_isaac
Active Participant
0 Kudos

thanxalot for the suggestions guys..

prince_isaac
Active Participant
0 Kudos

hie guys

i recently implemented the suggestions i got from you but still for the print out will have the header item being printed. i have also adjusted the heights of my windows and added the protect command but nothing seems change. any more suggestions would be most wellcome.

Former Member
0 Kudos

HI,

try this below code

CALL FUNCTION 'OPEN_FORM'

EXPORTING

device = 'PRINTER'

dialog = ' '

form = 'ZMM_INVENTORY'

language = sy-langu

EXCEPTIONS

canceled = 1

device = 2

form = 3

OPTIONS = 4

unclosed = 5

mail_options = 6

archive_error = 7

invalid_fax_number = 8

more_params_needed_in_batch = 9

spool_error = 10

codepage = 11

OTHERS = 12.

IF sy-subrc <> 0.

ENDIF.

CALL FUNCTION 'WRITE_FORM'

EXPORTING

element = 'HEADER_DATA '

window = 'HEADER'

EXCEPTIONS

element = 1

function = 2

type = 3

unopened = 4

unstarted = 5

window = 6

bad_pageformat_for_print = 7

spool_error = 8

codepage = 9

OTHERS = 10.

IF sy-subrc <> 0.

ENDIF.

LOOP AT i_final INTO wa_final.

CALL FUNCTION 'WRITE_FORM'

EXPORTING

element = 'ITEM_DATA'

window = 'MAIN'

EXCEPTIONS

element = 1

function = 2

type = 3

unopened = 4

unstarted = 5

window = 6

bad_pageformat_for_print = 7

spool_error = 8

codepage = 9

OTHERS = 10.

IF sy-subrc <> 0.

ENDIF.

ENDLOOP.

CALL FUNCTION 'CLOSE_FORM'.

Regards,

Bhupal

Former Member
0 Kudos

Hi,

use this,

Data: itab type table of <table>,

wa type <table>.

loop at itab into wa.

*fill ur local variable and print on sap script.

clear wa.

endloop.

Yogesh N