Show TOC

SAPSCRIPT: General SAPscript FieldsLocate this document in the navigation structure

Use

You can print the following fields of structure SAPSCRIPT as program symbols in SAPscript forms:

  • &SAPSCRIPT-SUBRC&:

    Receives a value after executing an INCLUDE statement. The value shows whether the INCLUDE was found (that is, the INCLUDE text exists) or not. You can query this value in an IF statement.

    • INCLUDE was found: &SAPSCRIPT-SUBRC& = 0

    • INCLUDE was not found: &SAPSCRIPT-SUBRC& = 4

  • &SAPSCRIPT-DRIVER&:

    SAPscript formats a text for a specific output device. The initial formatting is independent of the specific language of this device. SAPscript then calls a driver to convert the device-independent format to device-specific control commands. This field contains the name of the driver.

    Example
    • POST: PostScript driver

    • HPL2: HP LaserJet driver for the PCL4/PCL5 languages

    • PRES: driver for output devices using the PRESCRIBE language

    • The available drivers are stored in table TSP09.

  • &SAPSCRIPT-FORMPAGES&:

    This field contains a number representing the total number of pages of the currently formatted form (any output between START_FORM and END_FORM). The page counter mode (START, INC, HOLD) of the individual pages is ignored. You can use this symbol to formulate information such as:

    "Page x of y" for your output.

    Note

    You cannot display the &SAPSCRIPT-FORMPAGES& value in a bar code. Do not use &SAPSCRIPT-FORMPAGES& in a control command. The symbol is replaced once the entire form has been processed (as only then is the total number of pages fixed). However, a control command is processed immediately by the composer, which means that the value "zero" is displayed. This also applies to the symbol &SAPSCRIPT-JOBPAGES&.

  • &SAPSCRIPT-JOBPAGES&:

    This field contains a number representing the total number of pages of all forms contained in the currently formatted print request, in other words, of all forms created using the OPEN_FORM, START_FORM .. ENDFORM, START_FORM .. END_FORM, ..., CLOSE_FORM function modules.

    Caution

    When you use the SAPSCRIPT-FORMPAGES or SAPSCRIPT-JOBPAGES symbols, SAPscript leads all output pages of the current form or current print request into main memory to replace the symbol by the appropriate value. For large output jobs, this can mean a very large amount of memory.

  • &SAPSCRIPT-COUNTER_x& (x = 0 .. 9):

    These fields represent ten counter variables that you can use in your text and forms for any counting purposes. You can use the "+" and "- " formatting options to increment or decrement a counter before its value is printed. You can use the DEFINE control command to assign any specific value to a counter.

  • &SAPSCRIPT-TELELAND&:

    This field contains the country key of the fax target address when using fax output via SAPscript (field ITCPO-TDTELELAND of parameter OPTIONS of function module OPEN_FORM).

  • &SAPSCRIPT-TELENUM&:

    This field contains the local fax number of the fax target address when using fax output via SAPscript (field ITCPO-TDTELENUM of parameter OPTIONS of function module OPEN_FORM).

  • &SAPSCRIPT-TELENUME&:

    This field contains the complete fax number of the fax target address when using fax output via SAPscript (field ITCPO-TDTELENUME of parameter OPTIONS of the function module OPEN_FORM).