‎2005 Jun 10 6:54 AM
Hi,
Does anyone know how to find current line number and total number of lines printed on a page in SAPScripts?
Is it possible to use sy-linno and sy-linct?
Regards ,
Amina.
‎2005 Jun 10 8:07 AM
Hello,
It is not possible to find the current line number / total number of lines inside the SAPScript by a system variable.
Anyhow we can control the same from the driver program. In such cases we may have to use monospaced fonts like Courier / Arial monospaced for SAP etc.,
The total number of lines in a SAPScript cannot be determined in the Script dynamically, because the line size in a form depends on font used and the size of the font.
Hope this helps you.
Best Regards, Murugesh AS
‎2005 Jun 10 8:21 AM
Hi,
You can very well use the folling system variables
sy-linno - Current line
sy-linct - Page length
For further you can refer the table "SYST".
Regs,
Venkat Ramanan
‎2005 Jun 10 10:20 AM
Thankyou Murugesh and Venkat,
I have tried sy-linno and sy-linct but it is not returning any value.
I want to print a text with a heading.
if there are less than 3 lines remaining on a page then i dont want to print the heading (i.e. i want to force a page break here)
text can vary up to N number of lines so I cannot use Protect-Endprotect.
If you know some way out please help me out.
Regards,
Amina.
‎2005 Jun 14 6:59 PM
Hi Amina,
Please let me know how the data gets in to the form. I had a situation in a payroll remuneration form where I solved a similar issue by calling external subroutines and incrementing the counter by 1 everytime I print a line. Little performance overhead but ok. The catch is I was printing only one line of content each time(from an internal table) through a text element. So I could calculate the number of lines. System variables were not helpful to me.
Please let me know if you need any more details!
‎2005 Jun 18 10:31 AM
Hi Srinivasan,
Thankyou,
I am printing data from an internal table as well as standard text. I have coded a Transaction for end users to enter some text. So the problem is when I print a particular text element I dont know how many lines will be printed. Also I am using different font size for paragraphs.
There are FMs READ_FORM and CHECK_FORM but they donot return any value. Also when I define a paragraph there is a check box 'Next paragraph same page'. But this is also not working.
Regards,
Amina.