Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

SAPScripts

Former Member
0 Likes
727

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.

5 REPLIES 5
Read only

Former Member
0 Likes
656

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

Read only

Former Member
0 Likes
656

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

Read only

0 Likes
656

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.

Read only

amudhans
Explorer
0 Likes
656

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!

Read only

Former Member
0 Likes
656

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.