Using 'COMMAND' to achieve page break

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.

 

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值