cancel
Showing results for 
Search instead for 
Did you mean: 

sapscript - header line shoud be displayed in page 2 also along with items

Former Member
0 Kudos

hi All,

i hav an issue vt sapscripts, my requirement is , i want to print the header line not only in the first page

but also in the second page .

How do i acheive this.?

regards

venkat

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

i hav written a peice of code sayin after so many lines call the header

Former Member
0 Kudos

Hi,

However you have said this thread to be solved i want explain my piece of code.

Because it is also a good solution for your problem and maybe you can use this in the future.

First. PRINT HEADER.

CALL FUNCTION 'WRITE_FORM' "First header

EXPORTING element = 'ITEM_HEADER'

EXCEPTIONS OTHERS = 1.

IF sy-subrc NE 0.

PERFORM protocol_update.

ENDIF.

Second TAKE CARE HEADER WILL BE PRINTED AT TOP OF THE MAIN IN EVERY NEW PAGE/MAIN

CALL FUNCTION 'WRITE_FORM' "Activate header

EXPORTING element = 'ITEM_HEADER'

type = 'TOP'

EXCEPTIONS OTHERS = 1.

IF sy-subrc NE 0.

PERFORM protocol_update.

ENDIF.

Third PRINT YOUR ITEMS

LOOP AT tvbdpa.

****here are the items printed

ENDLOOP.

Last; DEACTIVATE PRINTING HEADER AT TOP OF EACH PAGE/MAIN

CALL FUNCTION 'WRITE_FORM' "Deactivate Header

EXPORTING element = 'ITEM_HEADER'

function = 'DELETE'

type = 'TOP'

EXCEPTIONS OTHERS = 1.

IF sy-subrc NE 0.

PERFORM protocol_update.

ENDIF.

Hope anyone can use this explanation.

Gr., Frank

Answers (4)

Answers (4)

Former Member
0 Kudos

Hi,

try this in driver program.

CALL FUNCTION 'WRITE_FORM' "First header

EXPORTING element = 'ITEM_HEADER'

EXCEPTIONS OTHERS = 1.

IF sy-subrc NE 0.

PERFORM protocol_update.

ENDIF.

CALL FUNCTION 'WRITE_FORM' "Activate header

EXPORTING element = 'ITEM_HEADER'

type = 'TOP'

EXCEPTIONS OTHERS = 1.

IF sy-subrc NE 0.

PERFORM protocol_update.

ENDIF.

LOOP AT tvbdpa.

****here are the items printed

ENDLOOP.

CALL FUNCTION 'WRITE_FORM' "Deactivate Header

EXPORTING element = 'ITEM_HEADER'

function = 'DELETE'

type = 'TOP'

EXCEPTIONS OTHERS = 1.

IF sy-subrc NE 0.

PERFORM protocol_update.

ENDIF.

This will work. It is standard SAP/

Gr., Frank

Former Member
0 Kudos

hi venkat,

you can achieve this by two ways

copy the header window to next page also only when you required all the header data.

give the text element in the next page where ever you want to print by giving element also.

regards,

venkat.

Former Member
0 Kudos

Hi,

Simply add those windows to second page which u want to print on second page.

Regards,

Deepak.

Former Member
0 Kudos

hi deepak ,

i m not using a different window for header

i m printing it in main window itself

in main window first line shoud be header line and rest shud be item lines

for every page it shud be the same case (header shud be the first line)

how to achieve ??

regards

venkat

former_member194416
Contributor
0 Kudos

If it's a standard script generally first and next pages. Add your header to next page too.