Skip to end of metadata
Go to start of metadata

To give a page break in smartforms we need to create a COMMAND line in the Main Window.

For example if we want to display only five records per page and the records of the particular flight or purchase order should be on one page only then we can use page breaks.

The following illustration will give a nice idea how to achieve the above conditions.

 Step 1:

After creating a Main window -> Right click on the main window -> Create ->  Flow logic -> Command

Declare the variable W_CARR in the Global Definitions type S_CARR_ID default value 'AA'.

In FORM INTERFACES -> TABLES TAB give the table T_FLIGHT LIKE SFLIGHT.

In initialization tab give the select query.

SELECT * FROM SFLIGHT INTO TABLE T_FLIGHT.


Step 2:

Create a LOOP and give the LOOP AT tab as T_FLIGHT INTO T_FLIGHT.

In this Command we have 2 tabs 

1. General

2. Conditions

In General Tab check the check box for GO TO NEXT PAGE and give the page in which the data should go.

Now in Condition tab give the condition which ever applicable in this example i would like to display the entries of the flights in separate pages no 2 flight details should come on same page.

Step 3.

Give the logic in the Program lines window.

Step 4:

Now run the Program you have the desired output


  • No labels