cancel
Showing results for 
Search instead for 
Did you mean: 

SAP Script info req to print new line iten on new page

Former Member
0 Kudos

hi

i had an req to print the list of MATNR & KUNNR on script,but the req is like this,at NEW MATNR,the script shd start with new page,say,if there are 5 MATNR,2 are same & 3 are same with diff KUNNR.

On first page:2 MATNR shd be printed

On Second Page:3 MATNR shd be printed & so on each time on new page...

Please tell me how to do it,in window MAIN,how shd i wirte code for this?

regds

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

hmm,act my prob is this,the window size is increasing depending updon thenos of records in itab,so its not working perfectly.

any other way...

Former Member
0 Kudos

hey,

Check this,

First in your print program call FM 'START_FORM'.

Then call FM 'WRITE_FORM'

After this call FM 'CONTROL_FORM' :

CALL FUNCTION 'CONTROL_FORM'

EXPORTING

command = 'NEW-PAGE'

EXCEPTIONS

UNOPENED = 1

UNSTARTED = 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.

At last call FM 'CLOSE_FORM'.

By using FM control_form and passing parameter 'NEW-PAGE' you will get one new page even thow if content of ur main window of previous page is not exceeding..

hey call new-page for every new matnr

Regards,

Midhun Abraham

Edited by: Midhun Abraham on Oct 11, 2008 8:47 AM