Application Development 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: 

SAPScript variables

Former Member
0 Kudos

Hi, if I have 3 pages in my SAPScript, how do I know which page is current? Is there a field/variable that I can check?

Any document that shows the other variables?

6 REPLIES 6

former_member181966
Active Contributor
0 Kudos

Yes, just write ..... &PAGE&

Thanks

SK

0 Kudos

Im sorry but that is not what I meant...basically, I have the following PAGE in my SAPSCRIPT:

DTLPG1

DTLPG2

TOTPG1

TOTPG2

There are some windows that are common to each. Therefore, how do I know that SAPScript is currently on a particular page (from the list above). Is there a variable that can be checked?

Former Member
0 Kudos

hi blumtain,

check all these commands

&syst-page& for current page

&syst-jobpages& for total pages

or

use &page&/&syst-page&/&sy-pagno&

or

you can do this way..

&PAGE& of &SAPSCRIPT-JOBPAGES&

or\

you can use following command in sapscript

Page &PAGE& of &SAPSCRIPT-FORMPAGES&

Regards,

Naveen

0 Kudos

Thanks for the input but I am not looking for the page number or the total pages. The "Page" that I am referring to is the element "Page" in sapscript. As stated above, I have 4 Page elements and I am wondering if there is a system variable that can be used to identify this when SAPScript is being executed.

Former Member
0 Kudos

HI

GOOD

TRY THIS OUT

Call function 'OPEN_FORM'

EXPORTING

Form = 'Z_FORM'…

Call function 'START_FORM'. "Default startpage = FIRST

...

[Print all standard form pages]

Call function 'END_FORM'. "Printed everything but T&C

Call function 'START_FORM' "Start a new page

EXPORTING

Startpage = 'LAST'. "Direct access to page LAST

Call function 'WRITE_FORM'

EXPORTING

Window = 'TERMS'. "Final page T&C

Call function 'END_FORM'. "End of printing page LAST

Call function 'CLOSE_FORM'.

-


You can just fill the data in the main

window and SAP will handle the paging based on the NEXT PAGE in the

SAPscript.

THANKS

MRUTYUN

vinod_gunaware2
Active Contributor
0 Kudos

System Symbols


You can use system symbols in all kinds of text. SAPscript supplies the values for system symbols. The names of the system symbols are fixed.

Current Date


&DATE& The current date is displayed. It is formatted according to the specifications found in the user master data. You can adapt this format to your own requirements by specifying a date mask (SET DATE MASK) or by using a country-specific formatting option (SET COUNTRY). The current value for this symbol is taken from the SY-DATUM field. This value is not copied every time that the date is called, but only at the following times:· When printing starts (OPEN_FORM, PRINT_TEXT) · When symbols are replaced in the text editor · When a text is exported in the ASCII or RTF format · When the TEXT_SYMBOL_REPLACE function module is called (optional)

Current Day Number


&DAY& The current day number is printed. The display includes leading zeros.

Current Month Number


&MONTH& The current month number is printed. The display includes leading zeros.

Current Year Number


&YEAR& This symbol is used to print the current year as a four digit number.

Current Day Name (Long Form)


&NAME_OF_DAY& The name of the current day is written out in full. The language used for the output is determined by the appropriate text language or form language. The names of the days are stored in the TTDTG table under the key %%SAPSCRIPT_DDDD_dd, where dd is the day number (01= Monday,.., 07 = Sunday).

Current Month Name (Long Form)


&NAME_OF_MONTH& The name of the current month is written out in full. The language used for the output is determined by the appropriate text language or form language. The names of the months are stored in the TTDTG table under the key %%SAPSCRIPT_MMMM_mm, where mm is the month number (01,.., 12).

Current Time


&TIME& The current time is printed in the form hours:minutes:seconds. Each of the components for hours, minutes, and seconds consists of two digits, using a leading zero if necessary. You can adapt this format to your own requirements by specifying a time mask (SET TIME MASK).The value for the time field is taken from the SY-UZEIT field. This value can be copied over only at particular times (c.f. DATE ).


Hours Component of Current Time


&HOURS& The component of the current time referring to hours is printed. The display includes leading zeros.

Minutes Component of Current Time


&MINUTES& The component of the current time referring to minutes is printed. The display includes leading zeros.

Seconds Component of Current Time


&SECONDS& The component of the current time referring to seconds is printed. The display includes leading zeros.

Current Page Number


&PAGE& You can use this symbol to insert into the text the page number that the current page will have when printed. You can specify the formatting option for the page number in the form for each page type.

Page Number of the Next Page


&NEXTPAGE& This symbol is used to print the number of the following page. The output format is the same as with &PAGE& . Note that on the last page of the output, in each window that is not of type MAIN, &NEXTPAGE& has the value 0.

Selected Device Type


&DEVICE& The &DEVICE& symbol is used to print the type of the output device. This type is passed in the DEVICE parameter when the SAPscript output (OPEN_FORM, PRINT_TEXT) is started, and it specifies the device for which the output should be formatted.Possible values are: PRINTERSCREENTELEXTELEFAXABAP (ABAP list display)

Spaces


&SPACE& You can use this symbol to generate a string of space characters. You must pass the number of space characters required with the symbol. If you leave out the number, then no spaces are printed.

Underline


&ULINE& You can use this symbol to insert a string of underline characters into the output text. You must pass the number of underline characters required with the symbol. If you leave out the number, then just one underline character is printed.

Vertical Line

&VLINE& You can use this symbol to insert a string of vertical line characters into the output text. You must pass the number of vertical line characters required with the symbol. If you leave out the number, then just one vertical line character is printed.

regards

vinod