on 09-14-2008 7:12 AM
Hi All,
I got one script requirement like, as of now in a the output it is printing some 8 to 9 line items in the main window.But new requirement is like we need to restrict that no of items to 5 or 6.Can anybody provide me the logic with sample code for this requirement plz .
Regards,
Rakesh.
You might be calling the WRITE_FORM for main window in loop. so if the sy-tabix reaches 6or7 then exit the loop.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello,
Find where the WRITE command for the line items is in your print program.
Add the following in the global data section
constants: c_lines_per_page type i value '5'.
data: z_lines_per_page type i.
Add the following inside the loop but BEFORE the WRITE call.
if z_lines_per_page = c_lines_per_page.
clear z_lines_per_page.
control function 'CONTROL_FORM'
exporting
command = 'NEW-PAGE'.
endif.
add 1 to z_lines_per_page.
Every 5 lines it will trigger a new page. Change the constant if you want to change the number of lines. Don't put the check after the write or you could trigger blank pages.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
80 | |
9 | |
9 | |
7 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.