10-19-2007 9:35 AM
Hi everyone,
I want to develop a general invoice form which include the header and line item. If the line items cannot be display within one page. Then, those records will then be displayed in subsequence page. Can i do this with one PAGE Sap Script (i.e. without defining NEXT page).
Regards,
Kit
10-19-2007 9:40 AM
Can we know y you want to avoid next page option... what is urr objective which you want to achive..
10-19-2007 9:45 AM
Hi
Create only one page and in the next page option text box give the same page name, the line items will be displayed in the next page if the data gets over flowed.
Regards
Haritha.
10-19-2007 9:48 AM
I tried this approach in the INVOICE01_PROF form. but, i encounter an error: "write_form invalid..". do i need to modify the print program??
10-19-2007 9:46 AM
Hi Chun...
Yes . You can do this.
Create a Single page(Eg: Page1) . With Main window (For item details) and Variable window for Header details etc. Assign the NEXT PAGE as PAGE1. i.e the Same page.
In this case it will continue the Line items in Subsequent pages of PAGE1 itself.
Note: You must assign the NEXT PAGE . otherwise it wont work.
REWARD IF HELPFUL.
10-19-2007 9:59 AM
Hi
The program should be like this. You compare the below program with your program may be u will be knowing what might be the prob. This is just an example and simple program.
Data: itab like lfa1 occurs 0 with header line.
select * from lfa1 into table itab.
CALL FUNCTION 'OPEN_FORM'
EXPORTING
FORM = 'Z13816_VENDOR1'
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
.
loop at itab.
CALL FUNCTION 'WRITE_FORM'
EXPORTING
FUNCTION = 'SET'
TYPE = 'BODY'
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
.
endloop.
CALL FUNCTION 'CLOSE_FORM'
EXCEPTIONS
UNOPENED = 1
BAD_PAGEFORMAT_FOR_PRINT = 2
SEND_ERROR = 3
SPOOL_ERROR = 4
CODEPAGE = 5
OTHERS = 6
.
Regards
Haritha.
10-19-2007 10:03 AM
thx for your code. i have reviewed the code. The skeleton is like this:
OPEN FORM
WRITE FORM
WRITE FORM
.....
.......
CLOSE FORM