cancel
Showing results for 
Search instead for 
Did you mean: 

how to write program for handling script ?

Former Member
0 Kudos

In script i have 2 pages.

In first page i have constant windows and variable windows.

In second page i have main window.

How to write program for this?

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi

You need to write a driver program. You need to use open form, then write_form to write data into various windows and then close_form to close.

As you don't want main window in the first page first try out just by having the window in the second page; i guess system will take care of it. As all other windows filled and if u start writing data in the main it'll go for next page.

If doesn't work have the window on the first page with the least hight and write a command

IF &SYST-PAGE& EQ 1

NEXT-PAGE.

ENDIF.

Then in the second page you can have the main window hight as per your requirement.

Here is an example

  • (1) Get customer data

TABLES: scustom, sbook, spfli.

DATA: bookings like sbook...

select * from...

  • (2) Open form

CALL FUNCTION 'OPEN_FORM'

EXPORTING

DEVICE = 'PRINTER'

FORM = 'S_EXAMPLE_1'

DIALOG = 'X'

EXCEPTIONS

others = 1

  • (3) Print table heading

CALL FUNCTION 'WRITE_FORM'

EXPORTING

ELEMENT = 'HEADING'

TYPE = 'TOP'

WINDOW = 'MAIN'

FUNCTION = 'SET'

...

  • (4) Print customer bookings

LOOP AT bookings WHERE

CALL FUNCTION 'WRITE_FORM'

EXPORTING

ELEMENT = 'BOOKING'

TYPE = 'BODY'

WINDOW = 'MAIN'

...

ENDLOOP

  • (5) Close form

CALL FUNCTION 'CLOSE_FORM'

Regards

Surya.

Answers (1)

Answers (1)

Former Member
0 Kudos

hi,

You need not write a program for this.

Just design in SE71 accordingly.