Sie sind auf Seite 1von 8

Using 'COMMAND' to achieve page break

By Gokul R, Iteanz Technologies

In some cases user will ask only specific number of records should be displayed per page, but based on space availability
of main window data will populate. To restrict manually the number of records displayed per page we can use
COMMAND.
1. Go to smartforms tcode and create a smartform, in global definition part declare the variables and tables as shown in
above

2. Click on initialization tab, write the query and pass that internal table to output parameters

3.Click on main window and create table & also table line with 4 columns

4. Create assign table line for header and create text for each column

Cell1 = S.No
Cell2 = Customer No
Cell3 = City
Cell4 = Country Key
5. Click on main area and create a loop, give internal table & workarea as shown

6. Right click on loop and create command, followed by table line Create table line for the loop. we will get four columns
now. Create text for every column

7. In cell 5 i.e first column, create a code by right clicking on that cell->create->flow logic->programming lines

8. In that code, write the following code and pass variables to output parameters

Cell5 = &GV_NO&
Cell6 = & GS_KNA1-KUNNR&
Cell7 = & GS_KNA1-ORT01&
Cell8 = & GS_KNA1-LAND1&

9. Right click on page1 and create page2

10. Now go to command in page1-main window, click on condition tab in that command and give condition as shown

11. Click on general Attributes tab , check Go to New Page Box and choose page2 in the dropdown given next.

12.Go to page1 copy main window

13. Paste this main window in page2

Now our form should look like this

14. Check, Save, Activate & Execute it. Op will be

Only ten records per page will be displayed.


15. Comment our code which sets flag for page break

16. Save, Activate & Execute it , Output Will be

Summary
Using this command we manually control numbers of records displayed per page based on some condition. in the above
example our condition was only ten recods per page. we can implement the same for other conditions also.

Das könnte Ihnen auch gefallen