Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

SAPScript Page

Former Member
0 Kudos

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

6 REPLIES 6

Former Member
0 Kudos

Can we know y you want to avoid next page option... what is urr objective which you want to achive..

Former Member
0 Kudos

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.

0 Kudos

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??

varma_narayana
Active Contributor
0 Kudos

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.

Former Member
0 Kudos

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.

0 Kudos

thx for your code. i have reviewed the code. The skeleton is like this:

OPEN FORM

WRITE FORM

WRITE FORM

.....

.......

CLOSE FORM