on 2005 Aug 04 12:06 PM
We have a requirement to print article pricing data on a report (simple list, not ALV or SAP Script). If data for the next article does not fit on the remaining lines of the current page then a new page should be started. I know we can use the RESERVE command but this means working out how many lines the next article will use. Is there anything like the PROTECT/END PROTECT command used in SAP Script that we can use in the ABAP report? Or can anyone suggest another way?
Regards
Hi Andreas,
What do you mean by MAX? Do you mean the MAX any article will ever need, if this is the case then there will too much wasted space. For example if we reserve a MAX of 30 lines for each article and only ever use on average 10 lines.
Or did you mean something else.
Dhillon
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I don't think there is anyway around this other than to count the number of lines for the article before starting to print and throw a new page if necessary. I was hoping to avoid doing this as counting the number of print lines for an article will be quite involved.
I think what I shall do is collect all required data for an article and then call a print routine. The print routine shall be called twice, the first time it shall not print the data but count each line that would be printed. On return from the first call to this routine I shall have available the total number of print lines for the article. Now I shall do a NEW-PAGE if needed and call the print routine a second time to actually print the data.
Each WRITE command in the print routine shall have to take the form:
IF print_on.
WRITE:/ ......
ELSE.
ADD 1 TO g_total_print_lines_for_article.
ENDIF.
The overhead to calling the print routine twice shall not be that great as all the data will already have been collected prior to the first call.
Messy but necessary I guess.
Cheers
Hi,
can't you calculate the (max) number of lines to reserve
before output ?
regards Andreas
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
59 | |
11 | |
7 | |
7 | |
6 | |
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.