Removed space in sap script automatically

Hi expert
I have written this code
BOX YPOS '32' CH HEIGHT '0' CH WIDTH '33' CH FRAME 10 TW INTENSITY 5
BOX HEIGHT '3' CH WIDTH '33' CH FRAME 10 TW INTENSITY 5
BOX XPOS '23' CH HEIGHT '32' CH WIDTH '0' CH FRAME 10 TW
1st time it works properly but when i am trying to editing any text of this window ,the space remove for particular portion automatically , I have mentioned it as red bold text .but It's not fix ,basically with in 'CH'  and <any text>  it affects (space becomes removed automatically ).
So all lines and  box are not coming properly....
BOX YPOS '32' CH HEIGHT '0' CH WIDTH '33' CH FRAME 10 TW INTENSITY 5
BOX HEIGHT '3' CH WIDTH '33' CHFRAME 10 TW INTENSITY 5
BOX XPOS '23' CH HEIGHT '32' CHWIDTH '0' CH FRAME 10 TW
So can any one help me about this issue
Thanks & Regards
Rajesh

You need to switch to the 'old' Editor. That is a well known problem of the new Texteditor.
Just go to the menu and switch.
This is the editor you need.
This happens because of a line break but in the texteditor you sometimes can't see it.
~Florian

Similar Messages

  • How to leave half line space in SAP Script

    Actually , I have a doubt regarding half line spacing on SAP Script ..
    I am working on Cheque Printing with  fbz5
    Now the issue in  the date, there are 8 box for the date in cheque .
    i.e  0 2 0 7 2 0 1 4
    Currently the date is comming on the cheque box ..like half up the box and half inside
    IF I give one space in cheque  window of my script with  /   its taking complete 1 space
    and result is ,it going down ..with one space
    I want to leave exact half line space ..so date is  adjusted  in the middle .
    I also tried moving my cheque  window from  upper margin in all format(CH , CM , MM  IN ..) above
    But it is taking exact one space .

    Hi Darshit,
    While creating the tab position, you have a option of line spacing.
    make it to 0.5 lines, to make exact half line.
    And also another way out, you can check by moving the 8 box created for the date up by 0.5 lines.
    Regards,
    Ganesh Lathi.

  • How to give constant space in sap scripts.

    Dear experts,
    In my requirement I am printing invoice line item details. In my program,I am printing 8 columns. How to give the constant space in my output.
    My issue.: here am fetching Internal Excise Document Number (DOCNO) item number (zeile) plant (werks) quantity (menge) storage location (lgort) and so on.
    when i am fetching the values from the table, the values are different from each and every rows. so nothing would be aligned properly into the column. For example, if the  doc no is having 10 char,from item no all the values of the column is getting moved to right side. in my second row doc no is having only 2 chars. in this case every column value is moving left side. its looking like realigned and not good.
    How do i give constant space for each and every column. so if the values are more or less it could not be moved to any side.
    please hellp me to solve this issue.
    <MOVED BY MODERATOR TO THE CORRECT FORUM>
    Thanks in advance.
    Regards,
    Sandy.
    Edited by: Alvaro Tejada Galindo on Sep 28, 2011 3:40 PM

    Hi,
    check out ur tab positioning in paragraph format...any misalignment is their or not.
    second thing you can do is checkout your printer i.e zebra printer or .matrix etc. your using sometimes misalignment happens
    in printer..or print some sample values for verifying the root cause .
    regards,
    KRISHNA

  • SAP Script 'space' check in IF  statement

    Hi,
    I want to check for space in SAP script
    i want to check something like
    /: IF &TS_ITEM-USPOS& EQ SPACE
    ZD ...........
    /: ENDIF
    even if the there is space in uspos field this lines under are not printing.
    your help is appriciated.
    thanks
    surya

    Hi Surya,
    It depends of the type of this field 'USPOS'.
    If it's defined, for eg, like POSNR ( NUMC 6 )so the statement is :
    /: IF &TS_ITEM-USPOS& EQ '000000'
    Hope this helps,
    Erwan

  • How to remove blank page in sap script

    hi ,
    I have a problem in sap script. I copied one std. script and made some changes i.e removing the unwanted pages from the script.
    no where NEW-PAGE kind of command is declared in window but still a new blank page is coming in printing.
    i checked with the posted comments in forum n what i found .. i did that part for my script..but no progress.
    so help needed.
    thnx,
    m

    Hi,
    If there is no any "NEW-PAGE" command in your any window, Pls check following probable causes.
    1. Check your main Window, may be there is blank line at the last of the main window, so check that and remove that,so you won't get the blank page
    2.Please check what have you defined as the NEXT PAGE for your first page. If so change it and make the first page itself as the next page.
    Hope it help you.
    Regrads,
    Lokesh.

  • SAP Scripts for Stock Removal and Stock Placement ?

    Hi All,
      Can you please let me know what are the SAP script names and Transaction codes for  Stock Removal and Stock Placements ?
    Thanks,
    Raj

    Hi
    Tcode is MIGO only (select Goods receipt) and mvt type as
    Putaway (305, 315, and so on)
    Stock removal (303, 313, and so on)
    Transfer posting (301, 311, and so on)
    regards
    Yogesh

  • How to remove the window border in SAP Script

    Hi,
    In my requirement when I create any window in SAP Script, in the output the border around the window should not be displayed.
    Request to suggest how to proceed on this.
    Thanks,
    Naresh

    Hi.
    I assume that in the window's code, there is a "BOX" statement. Just comment it out and you are done. If you are using SMARTFORM, there is a respective checkbox in the windows properties.
    Reward please if it helps.
    Regards,
    George

  • Sap scripts print modes

    What are the print modes available in the sap scripts?

    Hi
    Parent Topic: SAPScript
    HOWTO:Sap script
    Edit this entry - Discuss - Rename - Watch - History - 
    Major contributors: gopang, cmurphy262 | All Contributors
    Your votes have been tallied! See which wiki entry took top honors and find out who is this year's Wiki Ironman.  View the winners. 
    White Papers
    Do You Need a Fax Server? A Special Guide on Fax Servers and SAP Electronic Document Delivery
    Achieving Real-Time Supply Chain Integration
    E-Invoicing for Business Process Efficiency with SAP(R) Systems
    Jobs
    SAP Consultants (Any City) - SD, MM, PP, FI/CO, CS, ABAP (Dice) 
    SAP ABAP LEAD (Dice) 
    SAP ABAP Workflow Developer -Contract (Dice) 
    Community Content
    3 days until GO-LIVE!!! (Blogs)
    RE: RE: RE: RE: RE: Lost connection when using tcode FS00 (Groups)
    SAP SCRIPT
    Table of contents Show TOCHide TOC 
    1. 1 Concepts
    1.1. 1.1 Modifying SAP Forms
    1.2. 1.2 Forms: Concepts
    1.3. 1.3 Client and Language Versioning: Concepts
    2. 2 Componentes
    2.1. 2.1 Header Data
    2.2. 2.2 Paragraph Formats and Attributes
    2.2.1. 2.2.1 Standard Paragraph Attributes
    2.2.2. 2.2.2 Font Attributes for Paragraphs
    2.2.3. 2.2.3 Tabs in Paragraph Formats
    2.2.4. 2.2.4 Paragraph and Heading Numbering
    2.3. 2.3 Character Formats and Attributes
    2.3.1. 2.3.1 Standard Attributes for Character Formats
    2.3.2. 2.3.2 Font Attributes for Character Formats
    2.4. 2.4 Windows
    2.4.1. 2.4.1 Default Paragraph
    2.5. 2.5 Pages
    2.5.1. 2.5.1 Defining Follow-On Pages in Duplex Print Modes
    2.5.2. 2.5.2 Testing Tray Selection and Print Mode Selection
    2.6. 2.6 Page Windows
    2.7. 2.7 Text Elements
    2.7.1. 2.7.1 Default Text Element
    2.8. 2.8 Main Window
    3. 3 Técnicas
    3.1. 3.1 Displaying Versions of Forms
    3.2. 3.2 Including Graphics
    3.2.1. 3.2.1 Using Boxes, Lines, and Shading
    3.2.2. 3.2.2 Supported Printers
    3.2.3. 3.2.3 Boxes, Lines, Shading: BOX, POSITION, SIZE
    3.2.3.1. 3.2.3.1 BOX Command
    3.2.3.2. 3.2.3.2 POSITION Command
    3.2.3.3. 3.2.3.3 SIZE Command
    3.2.4. 3.2.4 Pre-Setting BOX Position Arguments
    3.2.5. 3.2.5 Using the Commands in Texts and Forms
    3.2.6. 3.2.6 Tips and Guidelines
    4. 4 Design Tools
    4.1. 4.1 Form Components
    4.2. 4.2 Processing in Overview
    4.2.1. 4.2.1 Defining Header Data
    4.2.1.1. 4.2.1.1 Completing the Header Data After Defining the Attributes
    4.2.1.2. 4.2.1.2 Passing Data to an External Program
    4.2.2. 4.2.2 Defining Paragraph Formats
    4.2.3. 4.2.3 Defining Character Formats
    4.2.4. 4.2.4 Defining Pages
    4.2.5. 4.2.5 Defining Windows
    4.2.6. 4.2.6 Using Text Elements in Page Windows
    4.2.7. 4.2.7 Defining Page Windows
    4.2.7.1. 4.2.7.1 Filling Page Windows with Text
    4.2.8. 4.2.8 Using Text Elements in Page Windows
    4.2.9. 4.2.9 Defining Main Windows in Page Windows
    4.3. 4.3 Test-Printing a Form
    5. 5 Releasing Forms
    6. 6 SAPscript Control Commands
    6.1. 6.1 Syntax of Control Commands
    6.2. 6.2 Explicit Page Break: NEW-PAGE
    6.3. 6.3 Preventing Page Breaks: PROTECT
    6.4. 6.4 Next Main Window: NEW-WINDOW
    6.5. 6.5 Assigning a Value to a Text Symbol: DEFINE
    6.6. 6.6 Formatting Date Fields: SET DATE MASK
    6.7. 6.7 Formatting Time Fields: SET TIME MASK
    6.8. 6.8 Country-Dependent Formatting: SET COUNTRY
    6.9. 6.9 Position of the Leading Sign: SET SIGN
    6.10. 6.10 Initializing Numbered Paragraphs: RESET
    6.11. 6.11 Including Other Texts: INCLUDE
    6.12. 6.12 Changing the Style: STYLE
    6.13. 6.13 Formatting Addresses: ADDRESS
    6.13.1. 6.13.1 Parameters
    6.14. 6.14 Setting a Footer Text in the Main Window: BOTTOM
    6.15. 6.15 Conditional Text: IF
    6.16. 6.16 Finding a Match: CASE
    6.17. 6.17 Calling ABAP Subroutines: PERFORM
    6.18. 6.18 Inserting Print Controls: PRINT-CONTROL
    6.19. 6.19 Boxes, Lines, Shading: BOX, POSITION, SIZE
    6.20. 6.20 Hexadecimal Data: HEX, ENDHEX
    6.21. 6.21 Summing a Program Symbol: SUMMING
    6.21.1. 6.21.1 Summing and Carrying Forward is Incorrect
    7. 7 SAPscript Symbols
    7.1. 7.1 Syntax of Symbols
    7.2. 7.2 System Symbols
    7.2.1. 7.2.1 Current Date
    7.2.2. 7.2.2 Current Day Number
    7.2.3. 7.2.3 Current Month Number
    7.2.4. 7.2.4 Current Year Number
    7.2.5. 7.2.5 Current Day Name (Long Form)
    7.2.6. 7.2.6 Current Month Name (Long Form)
    7.2.7. 7.2.7 Current Time
    7.2.8. 7.2.8 Hours Component of Current Time
    7.2.9. 7.2.9 Minutes Component of Current Time
    7.2.10. 7.2.10 Seconds Component of Current Time
    7.2.11. 7.2.11 Current Page Number
    7.2.12. 7.2.12 Page Number of the Next Page
    7.2.13. 7.2.13 Selected Device Type
    7.2.14. 7.2.14 Spaces
    7.2.15. 7.2.15 Underline
    7.2.16. 7.2.16 Vertical Line
    7.3. 7.3 Program Symbols
    7.3.1. 7.3.1 SYST: System Fields in the ABAP Programming Environment
    7.3.2. 7.3.2 USR03: User Address Data
    7.3.3. 7.3.3 SAPSCRIPT: General SAPscript Fields
    7.4. 7.4 Standard Symbols
    7.5. 7.5 Text Symbols
    7.6. 7.6 Formatting Options
    7.6.1. 7.6.1 Offset
    7.6.2. 7.6.2 Output Length
    7.6.3. 7.6.3 Omitting the Leading Sign
    7.6.4. 7.6.4 Leading Sign to the Left
    7.6.5. 7.6.5 Leading Sign to the Right
    7.6.6. 7.6.6 Omitting Leading Zeros
    7.6.7. 7.6.7 Space Compression
    7.6.8. 7.6.8 Number of Decimal Places
    7.6.9. 7.6.9 Omitting the Separator for ‘Thousands’
    7.6.10. 7.6.10 Specifying an Exponent for Floating Point Numbers
    7.6.11. 7.6.11 Right-Justified Output
    7.6.12. 7.6.12 Fill Characters
    7.6.13. 7.6.13 Suppressing Output of Initial Values
    7.6.14. 7.6.14 Ignoring Conversion Routines
    7.6.15. 7.6.15 Changing the Value of a Counter
    7.6.16. 7.6.16 Preceding and Subsequent Texts (Pre-Text / Post-Text)
    7.7. 7.7 Country-Dependent Formatting
    7.7.1. 7.7.1 Date Mask
    7.7.2. 7.7.2 Time Mask
    7.8. 7.8 Formatting Conventions
    7.8.1. 7.8.1 Primary Formatting of System Symbols
    7.8.2. 7.8.2 Primary Formatting of Standard Symbols
    7.8.3. 7.8.3 Primary Formatting of Program Symbols
    7.8.4. 7.8.4 Primary Formatting of Text Symbols
    7.8.5. 7.8.5 End Formatting
    1 Concepts Edit section
    1.1 Modifying SAP Forms Edit section
    If you want to modify SAP forms, set up your development environment as follows:
    1. Make sure that no SAP-standard forms are stored as client-specific copies in your development client. Such forms should be held only in client 000, the SAP development and installation client. If you access an SAP-standard form from another client, then the central copy in client 000 is used.
    If you need to remove SAP-standard objects from your development client, see Notes 10388 and 3355 in the SAP Online Service System (OSS). These notes explain the procedure for saving modified forms and then deleting all forms.
    2. To modify SAP standard forms,
    Copy the forms you need from client 000 to your development client.
    Rename the forms using a name from the customer name reserve (names starting with Y or Z).
    Copy the forms to one of your own Y or Z development classes.
    Renaming the SAP standard object makes it possible to manage and transport your changes with the SAP workbench organizer. The organizer is not activated for SAP-standard objects that are modified in clients other than 000.
    3. To put your modifications into effect, you must also modify the ABAP print program used to print documents that use this form. You should rename such print programs and store them in your own Y or Z development classes.
    You can use the SAP Customizing System to replace the SAP print program with your modified print program in the affected applications
    1.2 Forms: Concepts Edit section
    Forms are used to control the page layout and also the text formatting in your documents. Before formatting a document for output to the screen or to a printer, you must assign a form to it. If you do not specify a form for a document, then the SYSTEM form is assigned to the document by default.
    Application-specific forms are used in SAP applications to specify the page layout for such special documents as invoice or checks. These forms specify the structure of the information on the page(s) of such a document. They define, for example, the address header, item lines, the footer, and so on. There are two ways to format texts with forms:
    In the standard SAPscript text processing (Tools &#61614; Word processing &#61614; Standard text), you can select a form for a document. You can then type text into the main window of the form and output the document in the format defined in the form.
    For example, you can select a form for a letter. You can then type the body text of the letter in the main window. When you print the letter, the default text elements in the other windows of the form (heading, footer, and so on) are printed with the body text.
    A document can be generated by a print program in one of the SAP applications. The print program uses a form to generate the document. Most correspondence and document generation in the SAP System are handled by way of print programs.
    A print program selects the text elements that are to be printed in the windows of a form. It may also collect information from the user or ask the user to input text directly, as in some correspondence functions. The print program may also provide data for variables defined in the form.
    Finally, the print program uses the form to format the document for display or printing.
    1.3 Client and Language Versioning: Concepts Edit section
    Forms and styles are client-specific. That is, a form or style other than the SAP standard in client 000 is available only in the client in which it was created.
    Forms and styles are also language-specific. That is, the definitions and texts in a form or style are defined for a particular language. Forms and styles can be translated using the standard SAP translation tools.
    Client 000 Defaulting: SAPscript accords forms and styles in client 000 a special status.
    If a form or style that is used in a document is not available in the client in which the document is being printed, then SAPscript checks for the form or style in client 000. If it is found there, then the client 000 version is used to print the document.
    SAP standard forms and styles are always held in client 000. You can take advantage of the client 000 defaulting as well by storing your Yxxx and Zxxx forms and styles there. That way, if a local version of a form or style is not present in a client, the client 000 version is used instead.
    Language rules: SAPscript uses the following rules to manage versions of forms and styles in different languages:
    The language in which a form or style is created is its "original language." You can translate a form or style into other languages using SAP’s translation tools.
    If a form or style is needed only in its original language and need not be translated, then you can indicate this in the language attributes in the header data. The form or style then does not appear in work lists in the translation tools.
    In versions other than the original language version, changes to a form or style are limited only to translation of texts. No changes to definitions and attributes are permitted.
    2 Componentes Edit section
    2.1 Header Data Edit section
    You can find header data in both form and style maintenance. In style maintenance, it is used primarily to present important information – information designed to make it easier for the end user to select a style. The header data in form maintenance, on the other hand, is used for information and control purposes. For this reason, the header data of a form will be described in more detail.
    Below, the header data is described as it appears in the alphanumeric Form Painter.
    Like the header data of a style, the header data of a form comprises two parts: the data set by the system and the data you are expected to enter. The latter is dealt with separately.
    Device-independent entries.
    Description
    A short explanatory description of the form (also applies to the style), designed to make selection easier for the end user.
    Form class
    You can assign a form to a class to help you organize and search for forms. The default set of classes is the set of program classes in your system.
    Start page
    Tells the print program which page format in a form to use first for printing.
    Default paragraph
    Paragraph set to * in standard text maintenance.
    Tab stop
    A grid set at specified intervals in all windows defined in the form. However, you should note that the tab stops are only valid in paragraphs where you have not defined your own tabs.
    Language, Original language, Translation applic
    Use these fields to record the master language and language of the current version of a form. Marking Translation applic makes the form accessible for translation from the SAP System’s translation tools (transaction SE63).
    Device-dependent entries.
    You can only enter values here that are supported in the R/3 printer definition. If you make other entries, this leads to errors in the check routine.
    Page format
    Determined from the spool administration table with transaction SPAD. Make sure there is a printer assignment – there must be an additional spool format for the printer with the same page format.
    Orientation
    Depends on the page format selected. This can also be determined from the spool administration table. Please note that the formats landscape and portrait are not supported by all printers.
    Lines per inch (LPI)
    Basis for converting the unit of measurement LN in style and form maintenance. The value 6.00 is set by the system, as this value is supported by all printers.
    Characters per inch (CPI)
    Basis for converting the unit of measurement CH in style and form maintenance. The value 10.00 is set by the system, as this value is supported by all printers.
    Font attributes
    With these fields, you can set the default font for a form. The default font applies if other objects do not specify a font. SAPscript suggests a default font, which you can change.
    2.2 Paragraph Formats and Attributes Edit section
    In SAPscript, paragraphs are formatted using formats and their corresponding attributes. Text processing is simplified by the use of different paragraph attribute groups:
    Standard
    Font
    Tabs
    Outline
    There are naming conventions for paragraph tags:
    The paragraph tag can have one or two characters.
    The first character in the paragraph tag must be a letter, the second a letter, number, or blank; special characters are not valid.
    The paragraph format must be identified in the Description field.
    2.2.1 Standard Paragraph Attributes Edit section
    In the Standard attribute group, you find the general attributes that can be defined in paragraph formats:
    Description
    Precise explanation of your paragraph tag, so that the user can immediately identify it.
    Left or right margin
    Amount of space between the paragraph and the left or right border of the form window.
    Indent first line
    Indent of the first line of a paragraph. If the value is positive, it is indented to the right, if it is negative, it is indented to the left.
    If you specify a negative value, then you must place the minus sign after the number: 1- .
    Space before and space after
    Space before and space after control the amount of space between paragraphs. The actual space between paragraphs results from the space after the preceding paragraph and the space before the following paragraph.
    Alignment
    Alignment of a paragraph.
    Left-aligned
    LEFT
    Right-aligned RIGHT
    Centered CENTER
    Justified BLOCK
    Line spacing
    Spacing between the lines. The default value is 1 line; the LPI value (lines per inch) in the header data is used to calculate the line spacing.
    No blank lines
    Suppression of blank lines. You can control whether the blank lines of a paragraph should be suppressed in the printout or not:
    No entry
    blank lines not suppressed
    X blank lines suppressed
    Page protection
    Cohesion of a paragraph. It is possible to determine whether or not a paragraph can be divided by a page break.
    No entry
    no page protection (default)
    X all lines of the paragraph are on one page
    Next paragraph same page
    Cohesion of two adjacent paragraphs. Here you can define whether the subsequent paragraph should begin on the same page (that is, at least the first line of the subsequent paragraph must be on the same page).
    No entry
    subsequent paragraph is output on the same page or the next page, depending on the amount of space (default)
    X subsequent paragraph begins on the same page
    2.2.2 Font Attributes for Paragraphs Edit section
    You can specify font attributes for paragraph formats. They control the font used in the text. You can specify these attributes both for the default font in the header and for particular paragraph formats:
    Font family
    Enter a font supported in the SAPscript font maintenance.
    Font size
    Enter the size of a character font. It is measured in 1/10 point.
    Bold/Italic
    Specify whether to use bold-face printing or italics.
    Underlined
    Mark this attribute to underline entire blocks of text.
    When defining a paragraph format, use More to specify these underline attributes:
    Spacing between the base line and the underline
    Thickness
    Intensity
    Intensity is expressed in percent: 0 % is a black underline; 100 % is no underline.
    If you defined default underlining in the header, then the fields for underline attributes are already displayed on the screen.
    The following selection criteria apply to the font attributes bold, italics, and underlined:
    Off attribute is not set
    Retain inherited
    On attribute is set
    The combination of font family, font size, bold type attribute and italics attribute is referred to as a system font or SAP font. To use the SAPscript font maintenance, choose Tools &#61614; Word processing &#61614; Font.
    2.2.3 Tabs in Paragraph Formats Edit section
    You can define as many tab positions as you require for each paragraph format. The text can be aligned in different ways:
    Left-aligned with LEFT
    Right-aligned with RIGHT
    Centered with CENTER
    At the sign with SIGN
    At the comma or decimal point with DECIMAL
    You can control the tab feed in a paragraph with tab positions. The tab stops you define in the paragraph format replace the tab spacing you defined in the header data of the form. However, this depends on the extent to which you have defined tab stops in the paragraph format. If there are fewer tabs in the paragraph formats than in the header data, the tab stops of the header data are used for the rest of the line. The tab stops are represented as, , in the text editor.
    You can use different units of measurement to define a tab position:
    CH Characters
    CM Centimeters
    MM Millimeters
    PT Points
    TW Twips (1/20 point)
    The unit of measurement CH is converted to an absolute unit of measurement using the CPI value (characters per inch) from the header data of the form.
    2.2.4 Paragraph and Heading Numbering Edit section
    The paragraph numbering and marking attributes are used to structure texts into chapters, subchapters, and sections. Numbering is carried out automatically by SAPscript.
    You can create an outline with the entry options available:
    Outline
    Enter the name of the highest-level paragraph in an outline hierarchy here. The outline hierarchy is created by assigning this paragraph to all outline paragraphs.
    Outline level
    Enter the level in the outline hierarchy. The outline levels of the paragraphs are numbered upwards from 1; the highest outline level therefore has the outline number 1.
    Number margin
    Specify the space between numbering and window border. Note that your numbering may extend into the text area of the paragraph if the difference between the left margin and the number margin is not great enough to hold the numbering characters.
    Left/right delimiter
    Specify the character that precedes or follows the numbering.
    Number chaining
    Specify whether you want the paragraph numbering of the paragraph to be preceded by the numbering of all higher paragraphs in the hierarchy.
    Example for number chaining
    with   without
    3.     3.
    3.1     1.
    3.2     2.
    3.2.1     1.
    Character string
    Specify the numbering format. The numbering can be assigned a different font or character format to the rest of the paragraph.
    Numbering type
    ARABIC
    Arabic numerals: 1, 2, 3.
    CHAR Fixed character: letter or numeral, entered in the field
    LETTER Letters: A-Z
    ROMAN Roman numerals: I, II, III, IV
    Depending upon the numbering type that you select, the following attributes may also apply:
    Fixed character
    Define the fixed character to be used for numbering. You should only make an entry in the field Fixed character if you have specified CHAR as the numbering type. Fixed characters include + - and o .
    Output length
    Enter the number of characters for Arabic numerals.
    Upper case
    Specify for letters or Roman numerals.
    2.3 Character Formats and Attributes Edit section
    Character formats, as opposed to paragraph attributes, allow you to format entire blocks of text within a paragraph.
    Character attribute groups can be:
    Standard
    Font
    When you define character formats, observe the following naming conventions:
    The character format can have one or two characters.
    The first character must be a letter, the second a letter, number, or blank; special characters are not valid.
    Enter a simple explanation in the field Description. It is intended to help the user make a selection.
    2.3.1 Standard Attributes for Character Formats Edit section
    Marker
    Links a search key to the selected character string when the end user uses this character format. Examples include glossary, hypertext, and data element links. Here, selected character strings are assigned the appropriate key.
    Bar code
    Bar code that is required for certain variables and is known to the printer, for example EAN8. The character string is printed as a bar code if the character string concerned is selected.
    Bar code names, such as EAN8, refer to system bar codes. These are defined in the SAPscript font maintenance (Tools &#61614; Word processing &#61614; Font).
    Protected
    The character string is not split by a line break, but printed together on the next line.
    Hidden
    The character string is not printed. The text is only visible in the text editor.
    Superscript/subscript
    The character string is printed half a line higher or lower.
    The following options are available for defining these attribute types:
    Off
    Attribute is not set
    Retain Attribute is inherited
    On Attribute is set
    2.3.2 Font Attributes for Character Formats Edit section
    Font attributes can be specified for character formats as well as for paragraph formats. You have the same options as for defining font attributes for paragraph formats.
    2.4 Windows Edit section
    Windows are defined in form maintenance. They represent areas that are positioned on pages – as page windows – and in which at a later time text is printed. You must define at least one window for each form. Otherwise, SAPscript cannot format the text.
    You can assign window names and window types. However, note that you can define only one main window per form.
    Use one of these window types:
    MAIN
    Main window in which continuous text is printed. This is the window used by dialog users of a print program and form. For example, the body text of a letter would be entered in MAIN.
    The text in the main window can extend over several pages. If the text fills one page, output continues in the window of the next and subsequent pages, as long as MAIN has been defined for these pages.
    VAR
    Window with variable contents. The text can vary on each page in which the window is positioned. Variable windows are formatted for each page.
    To every window you can assign text, which is printed in the corresponding window when the form is formatted. To assign text, use text elements, which are stored with the form.
    To create and maintain text elements with the SAPscript Editor, choose Text elements. Should the text selected for the window exceed the window size, then the text is cut off.
    CONST
    Window with constant contents that is formatted only once.
    Currently, CONST windows are processed in the same way as VAR windows. You should only use windows of type VAR.
    2.4.1 Default Paragraph Edit section
    For a particular window, you can override the default paragraph format that is set in the form header. Enter the default format that should apply in the window in the Default paragraph field in the window definition screen.
    2.5 Pages Edit section
    You must define at least one page for every form. And you must designate a "first" page in the form header. Otherwise text formatting is not possible. In addition, you should inform the system which page is to be used after reaching the end of the first page. If you do not specify a next page, the output of your text ends at the end of the current page.
    To define a page, give it a name and specify attributes for it:
    Name of the next page
    Page counter mode
    INC Increases the counter by 1
    HOLD Counter remains unchanged
    START Sets the counter to 1
    You can display the contents of the page counter with the system symbol&PAGE&.
    Numbering type of the page counter
    ARABIC Arabic numerals
    LETTER Letters
    ROMAN Roman numerals
    Although CHAR is displayed as an entry option for the numbering type of the page counter, internally CHAR is converted to ARABIC.
    Output length for page numbering with numerals
    Upper or lower case for numbering with Roman numerals or letters
    Resource name
    With Resource name, you specify that the paper for this page should be taken from a particular paper tray at the printer.
    In Resource name, enter the print control that has been defined for switching to the paper tray you want to use. In printer types pre-defined by SAP, these print controls are generally as follows:
    TRY01 Select first paper tray
    TRY02 Select second paper tray (if available at the printer)
    TRY03 Select third paper tray (if available at the printer)
    TRYEN Print envelopes (if available at the printer)
    TRYMN Switch the printer to manual paper feed (if available at the printer). The printer pauses until you feed a sheet of paper into it.
    TRYME Switch the printer to manual envelope feed (if available at the printer). The printer pauses until you feed an envelope into it.
    You can use all tray selection print controls except TRY03 with suitably equipped printers that are defined with the following SAP device types: HPLJSTND, HPLJ_II, HPLJIIID, HPLJ4, LX4039, and SNI20XX8.
    You can use TRY01, TRY02, TRY03, and TRYMN on suitably equipped printers that are defined with these device types: KYOF1000, KYOF1200, KYOFS1500.
    See the spool system (transaction SPAD) to check on how your printers are defined.
    Print mode
    With Print mode, you can specify single- or double-sided printing for a page. You can choose from the following values:
    ' ' Currently active printing mode continues unchanged.
    S The page is printed in simplex mode. That is, the printer should print on only one side of the paper. If another mode was previously active, then the printer is switched to simplex mode with the start of the page.
    D The page is printed on the first side of a sheet in duplex mode. If another mode was previously active, then the printer is switched to duplex mode with the start of the pageand continues in this mode.
    T The page is printed on the first side of a sheet in tumble duplex mode. That is, the printer prints on both sides. The page on the second side is always inverted, so that the footer of the second page is printed opposite the header of the first page.
    If another mode was previously active, then the printer is switched to tumble duplex mode with the start of the page and continues printing in this mode.
    Print modes are currently supported for printers that use the PCL-5 language. These are printers that are defined with the following SAP device types: HPLJ_II, HPLJIIID, HPLJ4, LX4039, SNI20XX8.
    See the spool system (transaction SPAD) to check on how your printers are defined.
    The print controls for these functions are SPMSI (begin simplex printing); SPMDU (begin duplex printing); SPMTU (begin tumble duplex printing); SPMFS (print on first side of sheet in duplex or tumble duplex mode); and SPMBS (print on second side of sheet in duplex or tumble duplex mode).
    2.5.1 Defining Follow-On Pages in Duplex Print Modes Edit section
    You switch to duplex or tumble duplex mode with a form page for which one of these modes is specified. To continue printing in the current mode, for follow-on pages you must define another page in which the Print mode field is empty. Otherwise, the following pages after the mode switch will continue to be printed only on the front sides of new sheets of paper.
    The reason: When SAPscript sends a page with Print mode D or T to the printer, it not only sets the print mode accordingly. To ensure that the first page in the new mode is correctly output, SAPscript also instructs the printer to output the page on the front side of a sheet. If SAPscript sends a sequence of D or T pages to the printer, the output is printed only on the front side of each sheet.
    You define a first page named FIRST for a form to be printed in duplex mode. You therefore set the Print mode in FIRST to D.
    To make the duplex printing work correctly, you must define a second page FOLLOWER in which Print mode is left empty. In the form definition, you specify FOLLOWER as the follow-on page for FIRST and for itself as well.
    Your text is then printed in duplex mode. FIRST switches the printer to duplex mode and forces printing of the first page on the front side of a new sheet. FOLLOWER accepts the duplex mode and sends no further mode print controls to the printer. The printer therefore alternately prints FOLLOWER pages on the fronts and backs of sheets.
    2.5.2 Testing Tray Selection and Print Mode Selection Edit section
    SAP provides predefined SAPscript documents with which you can test whether tray selection and print mode selection are working properly on your printers.
    For tray selection, print the SAPscript document SAPSCRIPT-TRAYTEST, ID ST, Language D or E.
    For print mode selection, print the SAPscript document SAPSCRIPT-PRINTMODETEST, ID ST, Language D or E.
    2.6 Page Windows Edit section
    When you define page windows, the window names are linked to page names. You must specify the position and size of the window on the assigned page.
    Define the position of a window by specifying the left margin and upper margin and the size of a window by specifying its width and height.
    Left margin
    Space between the window and left margin of the page
    Upper margin Space between the window and upper margin of the page
    Window width Width of the window depending on the page format selected
    Window height Height of the window depending on the page format selected
    Note that the width of the main window must be the same on all pages. All other window types can have different sizes and positions on different pages.
    To print multiple columns, define several main windows on a page. As text entry is continuous, once the first main window has been filled, output continues in the second main window.
    Rewards if helpfull
    Regards
    Pavan

  • Sap Script To OTF

    Hi Experts,
    I am trying to convert a script to pdf data.
    In the open_form I set getotf = 'X' and in the close form , i get the OTf data.
    I convert this otf to pdf data.
    In the pdf output, I only have the static fields and no data.Though the number of pages generated are same in the PDF output and the script.
    Please help me to figure it out

    try this
    Here is some sample code for achieving manual conversion to the OTF format.
    In case of more than 10 pages:
    - Check the spool request
    - Click Edit -> OTF display -> No. of OTF pages
    Convert SAP Script to text:
    - Display the spool request
    - Then click Goto -> List display
    Automatic conversion to the OTF format:
    tables: tline.
    data:   begin of int_tline1 occurs 100.
                 include structure tline.
    data:   end of int_tline1.
    call function 'OPEN_FORM'
                     device         = 'OTF_MEM'
    after CLOSE_FORM
    call function 'CONVERT_OTF_MEMORY'
         exporting
              format                = 'ASCII'
              max_linewidth         = 132
         tables
               lines                 = int_tline1
         exceptions
              err_max_linewidth        = 1
              err_format                    = 2
              err_conv_not_possible = 3
              others                          = 4.
    write the text file to spool
    loop at int_tline1.
       if int_tline1-tdline = space.
          skip.
       else.
          write:/ int_tline1-tdline.
       endif.
    endloop.
    regards,
    srinivas
    <b>*reward for useful answers*</b>

  • How To trigger last page in sap script of customer account statement

    Hello all,
    I am working on customer account statement.
    It has it's own standard script(F140_CUS_STAT_02). But my client's requirement was completly diffrent,so i copied that to z script and made some changes like delete some window and some another window.
    Now on first page , i have following windows,
    1) Header
    2) address
    3) main
    4) Account
    5) Footer.
    Next Page having following windows,
    1) Header
    2) Main
    3) account
    4) footer
    Now i want to print account window on lsat page, so i put the condition nextpage = 0.
    and it is working fine , but as account window is physically present after Main window , so that much blak sapge is getting creted after main window on every page.
    To remove that blank space i am thinking of creting one more page and everytime i want display account window on that page.
    I have creted the last page also. but in my output it not detecting that last page.
    For First page - next page is next.
    For Next page - next page is next.
    for Last page- next page is last.
    Also i have added following code at last in  main window.
    /: NEXT-PAGE LAST.
    But i think i am placing this code at incorrect position in main window.
    I am not able to find out the correct podition to put the above code,but main window of that script conataing so namy text element, and that text element are getting handled from driver program based on some conditions.
    I have added my code in main window but not changed the original code.
    Plz let me know where to write /: NEXT-PAGE LAST. in main window.
    Or provide me some another solution to trigger thet last page in sap script.
    Regards,
    Anuja Dhondge

    Hi ,
    actually in account window i have used tha box command to print account statement.
    Previously i was printing this account statement in main window itself but without using bottom and end bottom command.
    So , as i made some changes or add some code in main window then lines of this account statement  were getting dismental.
    So my question is using bottom and end-bottom command this will happen or not????

  • Problem in Sap Script while printing

    HI,
    This report calling when I print billing document .this report getting data and call some sap script form but it prints 20 pages in place of only one page. Please
    Guide me to finding the exact problem.the code is below..
    REPORT zsd_excinv LINE-SIZE 110 LINE-COUNT 100 MESSAGE-ID vn.
    TABLES: vbco3,           "Keyfelder Vertriebsbeleg: Dokumentendruck
            tvko,            "Verkaufsorganisation
            sadr,            "Adressen
            komk,            "Communicationarea for conditions
            komp,            "Communicationarea for conditions
            komvd,           "Communicationarea for conditions
            vbdkr,           "Druck Rechnung: Kopfdaten
            vbdpr,           "Druck Rechnung: Positionsdaten
            conf_out,        "Configuration data
            vbpla,           "Druck Packliste   : allgemeine Daten
            vbplk,           "Druck Packliste   : Versandelementkopfdaten
            vbplp,           "Druck Packliste   : Versandelementinhaltsdaten
            vbpls.           "Druck Packliste   : Summendaten Verpackung
    TABLES : j_1iexchdr, j_1iexcdtl, vbrk,eikp,j_1imocust,likp,
             j_1iregset, itcpp,kna1, t001w.
    *PARAMETER : p_grp LIKE j_1iexchdr-exgrp.
    *SELECT-OPTIONS : so_num FOR j_1iexchdr-exnum.
    *PARAMETERS : p_num LIKE j_1iexchdr-exnum.
    DATA : wa_j_1iexchdr TYPE j_1iexchdr,
           it_j_1iexchdr TYPE TABLE OF j_1iexchdr.
    DATA : wa_j_1iexcdtl TYPE j_1iexcdtl,
           it_j_1iexcdtl TYPE TABLE OF j_1iexcdtl.
    DATA : wa_vbrk TYPE vbrk,
           wa_vbrp TYPE vbrp,
           wa_lips TYPE lips,
           wa_j_1iregset TYPE j_1iregset,
           wa_j_1iwrkcus TYPE j_1iwrkcus,
           wa_j_cust TYPE j_1imocust,
           it_vbrp TYPE TABLE OF vbrp.
    DATA : BEGIN OF wa_header,
             exnum TYPE j_1iexchdr-exnum ,
             exdat TYPE j_1iexchdr-exdat ,
             exccd TYPE j_1iregset-j_1iexccd,
             excrg TYPE j_1iregset-j_1iexcrg,
             excd1 TYPE j_1iregset-j_1iexcdi,
             bstnk_vf TYPE vbrk-bstnk_vf,
             zterm TYPE vbrk-zterm,
             iever TYPE eikp-iever,
             btgew TYPE likp-btgew,
             chapid TYPE j_1iexcdtl-chapid,
             traid TYPE likp-traid,
             rdoc TYPE j_1iexchdr-rdoc,
             maktx TYPE j_1iexcdtl-maktx,
             meins  TYPE likp-gewei,
          END OF wa_header.
    *DATA : BEGIN OF wa_header,
            exnum TYPE j_1iexchdr-exnum ,
            exdat TYPE j_1iexchdr-exdat ,
            exccd TYPE j_1iregset-j_1iexccd,
            excrg TYPE j_1iregset-j_1iexcrg,
            excd1 TYPE j_1iregset-j_1iexcdi,
            bstnk_vf TYPE vbrk-bstnk_vf,
            zterm TYPE vbrk-zterm,
            iever TYPE eikp-iever,
            btgew TYPE likp-btgew,
            ntgew TYPE likp-ntgew,
            chapid TYPE j_1iexcdtl-chapid,
            traid TYPE likp-traid,
            rdoc TYPE j_1iexchdr-rdoc,
            maktx TYPE j_1iexcdtl-maktx,
            meins  TYPE likp-gewei,
         END OF wa_header.
    *DATA : BEGIN OF wa_detail,
           zeile TYPE j_1iexcdtl-zeile,
           matnr TYPE j_1iexcdtl-matnr,
           maktx TYPE j_1iexcdtl-maktx,
           menge TYPE j_1iexcdtl-menge,
           rate TYPE konv-kbetr,
           amount TYPE konv-kwert,
           fob TYPE konv-kwert,
            meins  TYPE j_1iexcdtl-meins,
    *END OF wa_detail.
    *DATA : BEGIN OF wa_duties,
          zpr0 TYPE konv-kbetr,
          jadc TYPE konv-kbetr,
          st1 TYPE konv-kwert,
          jexp TYPE konv-kbetr,
          jecs TYPE konv-kbetr,
          st2 TYPE konv-kwert,
          jetc TYPE konv-kbetr,
          st3 TYPE konv-kwert,
          jsad TYPE konv-kbetr,
          st4 TYPE konv-kwert,
          st5 TYPE konv-kwert,
          vat TYPE konv-kbetr,
          st6 TYPE konv-kwert,
          zint TYPE konv-kbetr,
          jead TYPE konv-kbetr,
          zect TYPE konv-kbetr,
          zsad TYPE konv-kbetr,
          vat_per TYPE konv-kbetr,
          vat_val TYPE konv-kwert,
          total TYPE konv-kwert,
          remtime TYPE j_1iexchdr-remtime,
          exdat TYPE j_1iexchdr-exdat,
    *END OF wa_duties.
    *DATA : wa_t618t TYPE t618t.
    *DATA : in_words  TYPE spell,
          word TYPE spell-word,
          decword TYPE spell-decword,
          gv_plant_adrnr TYPE t001w-adrnr,
          lv_iever TYPE eikp-iever,
          lv_btgew TYPE likp-btgew,
          lv_ntgew TYPE likp-ntgew,
          lv_traid TYPE likp-traid,
          lv_regid TYPE j_1iregset-j_1iregid,
          gv_cust_adrnr TYPE kna1-adrnr,
          gv_ecsduty TYPE konv-kbetr,
          gv_tot_cen_amt TYPE konv-kwert,
          gv_zterm TYPE tvzbt-vtext,
          gv_tot_amt TYPE konv-kwert,
          lv_ins TYPE konv-kbetr,
          lv_fre TYPE konv-kbetr.
    *CONSTANTS : c_ecs TYPE j_1iexcdtl-ecsrate VALUE '0.368'.
    *SELECT-OPTIONS : so_num FOR j_1iexchdr-exnum.
    DATA : BEGIN OF wa_detail,
            zeile TYPE j_1iexcdtl-zeile,
            matnr TYPE j_1iexcdtl-matnr,
            maktx TYPE j_1iexcdtl-maktx,
            menge TYPE j_1iexcdtl-menge,
            rate TYPE konv-kbetr,
            amount TYPE konv-kwert,
            fob TYPE konv-kwert,
            meins  TYPE j_1iexcdtl-meins,
    END OF wa_detail.
    DATA : BEGIN OF wa_duties,
           zpr0 TYPE konv-kwert,
           jadc TYPE konv-kwert,
           st1 TYPE konv-kwert,
           jexp TYPE konv-kwert,
           jecs TYPE konv-kwert,
           st2 TYPE konv-kwert,
           jetc TYPE konv-kwert,
           st3 TYPE konv-kwert,
           jsad TYPE konv-kwert,
           st4 TYPE konv-kwert,
           st5 TYPE konv-kwert,
           vat TYPE konv-kwert,
           st6 TYPE konv-kwert,
           zint TYPE konv-kwert,
           jead TYPE konv-kwert,
           jeap TYPE konv-kwert,
           jeap_per TYPE konv-kbetr,
           zect TYPE konv-kwert,
           zect_per TYPE konv-kbetr,
           zecs TYPE konv-kwert,
           zsad TYPE konv-kwert,
           vat_per TYPE konv-kwert,
           vat_val TYPE konv-kwert,
           zlst_per TYPE konv-kwert,
           zlst_val TYPE konv-kwert,
           zcst_per TYPE konv-kwert,
           zcst_val TYPE konv-kwert,
           zeap TYPE konv-kwert,
           zeap_per TYPE konv-kbetr,
           total TYPE konv-kwert,
           remtime TYPE j_1iexchdr-remtime,
           exdat TYPE j_1iexchdr-exdat,
    END OF wa_duties.
    DATA : wa_t618t TYPE t618t.
    DATA : temp    TYPE konv-kwert VALUE 0,
           cen_amt TYPE konv-kbetr VALUE 0.
    DATA : in_words  TYPE spell,
           word TYPE spell-word,
           decword TYPE spell-decword,
           gv_plant_adrnr TYPE t001w-adrnr,
           lv_iever TYPE eikp-iever,
           lv_btgew TYPE likp-btgew,
           lv_traid TYPE likp-traid,
           lv_regid TYPE j_1iregset-j_1iregid,
           gv_cust_adrnr TYPE kna1-adrnr,
           gv_ecsduty TYPE konv-kbetr,
           gv_tot_cen_amt TYPE konv-kwert,
           gv_zterm TYPE tvzbt-vtext,
           gv_tot_amt TYPE konv-kwert,
           gv_amount TYPE konv-kwert,
           lv_ins TYPE konv-kbetr,
           lv_fre TYPE konv-kbetr.
    CONSTANTS : c_ecs TYPE j_1iexcdtl-ecsrate VALUE '0.368',
                rdocyr TYPE j_1iexchdr-docyr VALUE 2006.
    DATA : wa_t685t TYPE t685t.
    DATA : gv_zint TYPE t685t-vtext,
           gv_vat TYPE t685t-vtext,
           gv_zect TYPE t685t-vtext,
           gv_jetc TYPE t685t-vtext,
           gv_jeap TYPE t685t-vtext,
           gv_jecs TYPE t685t-vtext,
           gv_zlst TYPE t685t-vtext,
           gv_zcst TYPE t685t-vtext,
           gv_zeap TYPE t685t-vtext,
           gv_jadc TYPE t685t-vtext.
    INCLUDE rvadtabl.
    DATA: BEGIN OF lvbplk OCCURS 0.
            INCLUDE STRUCTURE vbplk.   "Packlistenkopf
    DATA: END OF lvbplk.
    DATA: BEGIN OF lvbplp OCCURS 0.
            INCLUDE STRUCTURE vbplp.   "Packlistenposition
    DATA: END OF lvbplp.
    DATA: BEGIN OF lvbpls OCCURS 0.
            INCLUDE STRUCTURE vbpls.   "Packlistenstruktur
    DATA: END OF lvbpls.
    DATA: BEGIN OF tvbdpr OCCURS 0.        "Rechnungspositionen
            INCLUDE STRUCTURE vbdpr.
    DATA: END OF tvbdpr.
    DATA: BEGIN OF tvbplp OCCURS 10.       "Packlistenposition
            INCLUDE STRUCTURE vbplp.
    DATA: END OF tvbplp.
    DATA: BEGIN OF tkomv OCCURS 50.
            INCLUDE STRUCTURE komv.        "Kommunikation
    DATA: END OF tkomv.
    DATA: BEGIN OF tkomvd OCCURS 50.
            INCLUDE STRUCTURE komvd.       "Kommunikation
    DATA: END OF tkomvd.
    DATA: BEGIN OF *tkomvd OCCURS 50.
            INCLUDE STRUCTURE komvd.
    DATA: END OF *tkomvd.
    DATA: BEGIN OF hkomvd OCCURS 50.
            INCLUDE STRUCTURE komvd.
    DATA: END OF hkomvd.
    DATA: BEGIN OF tkomcon OCCURS 50.
            INCLUDE STRUCTURE conf_out.
    DATA: END   OF tkomcon.
    DATA: retcode   LIKE sy-subrc.         "Returncode
    DATA: repeat(1) TYPE c.
    DATA: xscreen(1) TYPE c.               "Output on printer or screen
    DATA: pr_kappl(01)   TYPE c VALUE 'V'. "Application für Preisfindung
    DATA: print_mwskz.                     "Mehrwertsteuer-Kz drucken
    data for access to central address maintenance
    INCLUDE sdzavdat.
          FORM ENTRY                                                    *
          Einstieg für Nachrichtensteuerung                             *
    -->  RETURN_CODE                                                   *
    -->  US_SCREEN                                                     *
    FORM entry USING return_code us_screen.
      CLEAR retcode.
      xscreen = us_screen.
    Formular öffnen, aufbereiten und schließen
      PERFORM formular_invoice USING us_screen.
      CASE retcode.
        WHEN 0.
          return_code = 0.
        WHEN 3.
          return_code = 3.
        WHEN OTHERS.
          return_code = 1.
      ENDCASE.
    ENDFORM.                    "ENTRY
          FORM FORMULAR_INVOICE                                         *
          Formular abarbeiten                                           *
    FORM formular_invoice USING proc_screen.
    Werte aufbauen
      PERFORM get_data.
    Beleg unvollständig
      IF vbdkr-uvall NE space OR
         vbdkr-uvals NE space OR
         vbdkr-uvprs NE space.
        IF proc_screen = space.
          retcode = 3.
          IF vbdkr-uvall NE space OR vbdkr-uvals NE space.
            syst-msgno = '201'.
            syst-msgid = 'VN'.
            syst-msgty = 'I'.
            PERFORM protocol_update.
          ENDIF.
          IF vbdkr-uvprs NE space.
            syst-msgno = '200'.
            syst-msgid = 'VN'.
            syst-msgty = 'I'.
            PERFORM protocol_update.
          ENDIF.
        ELSE.
          IF vbdkr-uvall NE space OR vbdkr-uvals NE space.
            MESSAGE i201.
          ENDIF.
          IF vbdkr-uvprs NE space.
            MESSAGE i200.
          ENDIF.
        ENDIF.
      ENDIF.
      CHECK retcode = 0.
    SAP-SCRIPT STEUERUNG festlegen
      PERFORM form_open USING proc_screen vbdkr-land1.
      CHECK retcode = 0.
    Formular aufbereiten
      PERFORM sd_invoice_suppl.
      CHECK retcode = 0.
    Formular schließen
      PERFORM form_close.
      CHECK retcode = 0.
    ENDFORM.                    "FORMULAR_INVOICE
          FORM GET_DATA                                                 *
          Daten besorgen                                                *
    FORM get_data.
    PERFORM vbdkr_data.    "Rechnungskopf und -liste
    PERFORM vbpla_data.    "Packliste
    ENDFORM.                    "GET_DATA
          FORM FORM_OPEN                                                *
          Formular öffnen                                               *
    -->  US_SCREEN  Output on screen                                   *
                     ' ' = printer                                      *
                     'X' = screen                                       *
    -->  US_COUNTRY County for telecommunication and SET COUNTRY       *
    FORM form_open USING us_screen us_country.
      DATA: xdevice(8) TYPE c.
      SET LANGUAGE nast-spras.
      CLEAR itcpo.
      MOVE-CORRESPONDING nast TO itcpo.
      itcpo-tdcover   = nast-tdocover.
      itcpo-tddest    = nast-ldest.
      itcpo-tddataset = nast-dsnam.
      itcpo-tdsuffix1 = nast-dsuf1.
      itcpo-tdsuffix2 = nast-dsuf2.
      itcpo-tdimmed   = nast-dimme.
      itcpo-tddelete  = nast-delet.
      itcpo-tdcopies  = nast-anzal.
      itcpo-tdprogram = sy-repid.
      itcpo-tdteleland = us_country.
      itcpo-tdsenddate = nast-vsdat.
      itcpo-tdsendtime = nast-vsura.
      IF us_screen NE space.
        itcpo-tdpreview = 'X'.
        itcpo-tdnoprint = 'X'.
      ENDIF.
      IF sy-tcode EQ 'J1IP'.
        itcpo-tdpreview = 'X'.
      ENDIF.
      CASE nast-nacha.
        WHEN '1'.
          xdevice = 'PRINTER'.
        WHEN '2'.
          xdevice = 'TELEFAX'.
          itcpo-tdtelenum = nast-telfx.
          IF nast-tland IS INITIAL.
            itcpo-tdteleland = us_country.
          ELSE.
            itcpo-tdteleland = nast-tland.
          ENDIF.
        WHEN '3'.
          xdevice = 'TELETEX'.
          itcpo-tdtelenum = nast-teltx.
          IF nast-tland IS INITIAL.
            itcpo-tdteleland = us_country.
          ELSE.
            itcpo-tdteleland = nast-tland.
          ENDIF.
        WHEN '4'.
          xdevice = 'TELEX'.
          itcpo-tdtelenum = nast-telx1.
          IF nast-tland IS INITIAL.
            itcpo-tdteleland = us_country.
          ELSE.
            itcpo-tdteleland = nast-tland.
          ENDIF.
        WHEN OTHERS.
          xdevice = 'PRINTER'.
      ENDCASE.
      CALL FUNCTION 'OPEN_FORM'
        EXPORTING
          form           = tnapr-fonam
          language       = nast-spras
          OPTIONS        = itcpo
          archive_index  = toa_dara
          archive_params = arc_params
          device         = xdevice
          dialog         = ' '
        EXCEPTIONS
          OTHERS         = 1.
      IF sy-subrc NE 0.
        retcode = sy-subrc.
        PERFORM protocol_update.
      ENDIF.
      SET COUNTRY us_country.
    ENDFORM.                    "FORM_OPEN
          FORM FORM_CLOSE                                               *
          Formular schließen                                            *
    FORM form_close.
      CALL FUNCTION 'CLOSE_FORM'           "...Ende Formulardruck
           EXCEPTIONS OTHERS = 1.
      IF sy-subrc NE 0.
        retcode = 1.
        PERFORM protocol_update.
      ENDIF.
      SET COUNTRY space.
      SET LANGUAGE space.
    ENDFORM.                    "FORM_CLOSE
          FORM SD_INVOICE_SUPPL                                         *
          Rechnung aufbereiten                                          *
    FORM sd_invoice_suppl.
      CLEAR : wa_j_1iexchdr, wa_j_1iexcdtl, wa_lips,  wa_duties,
              gv_tot_amt.
    get data from excise header
      SELECT * FROM j_1iexchdr INTO TABLE it_j_1iexchdr
      WHERE exgrp = '31'
      AND rdoc = nast-objky
      AND trntyp = 'DLFC'
      AND lifnr = space
      AND docyr = rdocyr.
    AND exdat IN so_dat.
      SORT it_j_1iexchdr BY exdat exnum.
      READ TABLE it_j_1iexchdr INTO wa_j_1iexchdr INDEX 1.
      SELECT * FROM j_1iexcdtl INTO TABLE it_j_1iexcdtl
      FOR ALL ENTRIES IN it_j_1iexchdr
      WHERE exnum = it_j_1iexchdr-exnum
      AND trntyp = 'DLFC'
      AND docno = it_j_1iexchdr-docno.
      SORT it_j_1iexcdtl BY exdat exnum.
    LOOP AT it_j_1iexchdr INTO wa_j_1iexchdr.
    *open form
    PERFORM open_form USING  'ZSD_EXCINV' 1
                              'printer'  'X'.
      MOVE : wa_j_1iexchdr-exnum TO wa_header-exnum,
            wa_j_1iexchdr-exdat TO wa_header-exdat,
            wa_j_1iexchdr-rdoc TO wa_header-rdoc.
    get plant details
      SELECT SINGLE * FROM j_1iwrkcus INTO wa_j_1iwrkcus
      WHERE j_1iwerks = wa_j_1iexchdr-werks.
      SELECT SINGLE * FROM j_1iregset INTO wa_j_1iregset
      WHERE j_1iregid = wa_j_1iwrkcus-j_1iregid.
      SELECT adrnr INTO gv_plant_adrnr FROM t001w
      WHERE werks = wa_j_1iexchdr-werks.
      ENDSELECT.
      MOVE : wa_j_1iregset-j_1iexccd TO wa_header-exccd,
             wa_j_1iregset-j_1iexcrg TO wa_header-excrg,
             wa_j_1iregset-j_1iexcdi TO wa_header-excd1.
    get order no. from vbrk
      SELECT * INTO wa_vbrk FROM vbrk
      WHERE vbeln = wa_j_1iexchdr-rdoc.
      ENDSELECT .
      MOVE : wa_vbrk-bstnk_vf TO wa_header-bstnk_vf,
       wa_vbrk-zterm TO wa_header-zterm.
      SELECT vtext FROM tvzbt INTO gv_zterm
       WHERE zterm = wa_vbrk-zterm
       AND   spras = 'EN'.
      ENDSELECT.
    get nature of removal
      SELECT iever INTO lv_iever FROM eikp
      WHERE refnr = wa_vbrk-vbeln.
      ENDSELECT.
      SELECT SINGLE * FROM t618t INTO wa_t618t
      WHERE expvz = lv_iever
      AND   spras = 'E'.
       MOVE : lv_iever TO wa_header-iever.
    *get consignment weight.
      SELECT SINGLE * FROM vbrp INTO wa_vbrp
      WHERE vbeln = wa_vbrk-vbeln.
      READ TABLE it_j_1iexcdtl INDEX 1 INTO wa_j_1iexcdtl.
      SELECT btgew traid gewei INTO (lv_btgew, lv_traid, wa_header-meins) FROM likp
      WHERE vbeln = wa_j_1iexcdtl-rdoc1.
      ENDSELECT.
      MOVE : lv_btgew TO wa_header-btgew,
             lv_traid TO wa_header-traid.
              lv_weight to wa_header-meins.
    *get chapter id
      READ TABLE it_j_1iexcdtl INTO wa_j_1iexcdtl WITH KEY exnum = wa_j_1iexchdr-exnum .
      IF sy-subrc = 0.
        MOVE : wa_j_1iexcdtl-chapid TO wa_header-chapid,
               wa_j_1iexcdtl-maktx TO wa_header-maktx.
      ENDIF.
    *get customer details.
      SELECT adrnr FROM kna1 INTO gv_cust_adrnr
      WHERE kunnr = wa_j_1iexchdr-kunag.
      ENDSELECT.
      SELECT SINGLE * FROM j_1imocust INTO wa_j_cust
      WHERE kunnr = wa_j_1iexchdr-kunag.
    *write invoice header details
      PERFORM write_form  USING '' 'APPEND' 'BODY' 'LOCCODE' .
    *get data from excise details.
      LOOP AT it_j_1iexcdtl INTO wa_j_1iexcdtl.
        MOVE : wa_j_1iexcdtl-zeile TO wa_detail-zeile,
               wa_j_1iexcdtl-matnr TO wa_detail-matnr,
               wa_j_1iexcdtl-maktx TO wa_detail-maktx,
               wa_j_1iexcdtl-menge TO wa_detail-menge,
               wa_j_1iexcdtl-meins TO wa_detail-meins.
        SELECT  SINGLE * FROM vbrp INTO  wa_vbrp
            WHERE vbeln = wa_vbrk-vbeln
            AND   matnr = wa_j_1iexcdtl-matnr.
        SELECT kbetr kwert  FROM konv
        INTO (wa_detail-rate, wa_detail-amount)
        WHERE knumv = wa_vbrk-knumv
        AND   kposn = wa_vbrp-posnr
        AND  kschl  = 'ZPR0'.
        ENDSELECT.
        SELECT kwert  FROM konv
        INTO lv_ins
        WHERE knumv = wa_vbrk-knumv
        AND   kposn = wa_vbrp-posnr
        AND  kschl  = 'ZINS'.
        ENDSELECT.
        SELECT kwert  FROM konv
        INTO lv_fre
        WHERE knumv = wa_vbrk-knumv
        AND   kposn = wa_vbrp-posnr
        AND  kschl  = 'ZFRE'.
        ENDSELECT.
         wa_detail-fob = wa_detail-amount + lv_ins + lv_fre.
        gv_tot_amt = gv_tot_amt + wa_detail-amount.
       gv_amount  =   gv_amount + wa_detail-amount.
    write item details
        PERFORM write_form  USING 'LINE_ITEMS' 'SET' 'BODY' 'MAIN' .
      ENDLOOP.
    **get insurance .
    SELECT kwert INTO lv_ins FROM konv
    WHERE knumv = wa_vbrk-knumv
    AND  kschl = 'ZINS'.
    ENDSELECT.
    **get freight .
    SELECT kwert INTO lv_fre FROM konv
    WHERE knumv = wa_vbrk-knumv
    AND  kschl = 'ZFRE'.
    ENDSELECT.
    **get net value .
       MOVE wa_vbrk-netwr TO wa_costs-grandtot.
    **calculate netvalue(fobvalue)
       wa_costs-fobval = wa_costs-grandtot + wa_costs-insurance + wa_costs-freight.
    gv_tot_amt = gv_tot_amt + lv_ins + lv_fre.
    *get values for different condition types.
    SELECT kbetr INTO wa_duties-zpr0  FROM konv
    WHERE knumv = wa_vbrk-knumv
    AND   kposn = wa_vbrp-posnr
    AND  kschl  = 'ZPR0'.
    ENDSELECT.
      SELECT kwert  INTO wa_duties-jadc FROM konv
      WHERE knumv = wa_vbrk-knumv
       AND   kposn = wa_vbrp-posnr
      AND  kschl  = 'JADC'.
        temp = temp + wa_duties-jadc.
        CLEAR : wa_duties-jadc.
      ENDSELECT.
      MOVE  : temp TO wa_duties-jadc.
      CLEAR : temp.
       wa_duties-st1 = wa_duties-zpr0 + wa_duties-jadc.
      SELECT kwert  INTO wa_duties-jexp FROM konv
       WHERE knumv = wa_vbrk-knumv
        AND   kposn = wa_vbrp-posnr
       AND  kschl  = 'JEXP'.
        temp = temp + wa_duties-jexp.
        CLEAR : wa_duties-jexp.
      ENDSELECT.
      MOVE  : temp TO wa_duties-jexp.
      CLEAR : temp.
      SELECT kwert  INTO wa_duties-jecs FROM konv
        WHERE knumv = wa_vbrk-knumv
       AND   kposn = wa_vbrp-posnr
        AND  kschl  = 'JECS'.
        temp = temp + wa_duties-jecs.
        CLEAR : wa_duties-jecs.
      ENDSELECT.
      MOVE  : temp TO wa_duties-jecs.
      CLEAR : temp.
      wa_duties-st3 =  gv_tot_amt + wa_j_1iexchdr-exbed + wa_j_1iexchdr-ecs.
      SELECT kwert  INTO wa_duties-jetc FROM konv
            WHERE knumv = wa_vbrk-knumv
             AND   kposn = wa_vbrp-posnr
            AND  kschl  = 'JETC'.
        temp = temp + wa_duties-jetc.
        CLEAR : wa_duties-jetc.
      ENDSELECT.
      MOVE  : temp TO wa_duties-jetc.
      CLEAR : temp.
       wa_duties-st3 =  wa_duties-zpr0 + wa_duties-st2 + wa_duties-jetc.
      SELECT kwert  INTO wa_duties-jsad FROM konv
      WHERE knumv = wa_vbrk-knumv
       AND   kposn = wa_vbrp-posnr
      AND  kschl  = 'JSAD'.
        temp = temp + wa_duties-jsad.
        CLEAR : wa_duties-jsad.
      ENDSELECT.
      MOVE  : temp TO wa_duties-jsad.
      CLEAR : temp.
      SELECT kbetr kwert  INTO (wa_duties-jeap_per, wa_duties-jeap) FROM konv
      WHERE knumv = wa_vbrk-knumv
       AND   kposn = wa_vbrp-posnr
      AND  kschl  = 'JEAP'.
        temp = temp + wa_duties-jeap.
        CLEAR : wa_duties-jeap.
      ENDSELECT.
      MOVE  : temp TO wa_duties-jeap.
      CLEAR : temp.
      wa_duties-jeap_per = wa_duties-jeap_per / 10.
      SELECT kbetr kwert INTO (wa_duties-zeap_per, wa_duties-zeap) FROM konv
      WHERE knumv = wa_vbrk-knumv
       AND   kposn = wa_vbrp-posnr
      AND  kschl  = 'ZEAP'.
        temp = temp + wa_duties-zeap.
        CLEAR : wa_duties-zeap.
      ENDSELECT.
      MOVE  : temp TO wa_duties-zeap.
      CLEAR : temp.
      wa_duties-zeap_per = wa_duties-zeap_per / 10.
             (st2jetcjsad)
       wa_duties-st4 =   wa_duties-st2 + wa_duties-jetc + wa_duties-jsad.
             (zpr0+st4)
       wa_duties-st5 =   wa_duties-zpr0 + wa_duties-st4 .
       SELECT kbetr  INTO wa_duties-vat FROM konv
             WHERE knumv = wa_vbrk-knumv
             AND   kposn = wa_vbrp-posnr
             AND  kschl  = 'VAT'.
       ENDSELECT.
      SELECT kbetr kwert INTO (wa_duties-vat_per, wa_duties-vat_val) FROM konv
            WHERE knumv = wa_vbrk-knumv
           AND   kposn = wa_vbrp-posnr
            AND  kschl  = 'ZVAT'.
        temp = temp + wa_duties-vat_val.
        CLEAR : wa_duties-vat_val.
      ENDSELECT.
      MOVE  : temp TO wa_duties-vat_val.
      CLEAR : temp.
      wa_duties-vat_per = wa_duties-vat_per / 10.
      SELECT kbetr kwert INTO (wa_duties-zcst_per, wa_duties-zcst_val) FROM konv
           WHERE knumv = wa_vbrk-knumv
           AND   kposn = wa_vbrp-posnr
           AND  kschl  = 'ZCST'.
        temp = temp + wa_duties-zcst_val.
        CLEAR : wa_duties-zcst_val.
      ENDSELECT.
      MOVE  : temp TO wa_duties-zcst_val.
      CLEAR : temp.
      wa_duties-zcst_per = wa_duties-zcst_per / 10.
      SELECT kbetr kwert INTO (wa_duties-zlst_per, wa_duties-zlst_val) FROM konv
            WHERE knumv = wa_vbrk-knumv
           AND   kposn = wa_vbrp-posnr
            AND  kschl  = 'ZLST'.
        temp = temp + wa_duties-zlst_val.
        CLEAR : wa_duties-zlst_val.
      ENDSELECT.
      MOVE  : temp TO wa_duties-zlst_val.
      CLEAR : temp.
      wa_duties-zlst_per = wa_duties-zlst_per / 10.
             (st5+vat)
       wa_duties-st6 =   wa_duties-vat_val + wa_duties-st5 .
      SELECT kwert  INTO wa_duties-zint FROM konv
            WHERE knumv = wa_vbrk-knumv
             AND   kposn = wa_vbrp-posnr
            AND  kschl  = 'ZINT'.
        temp = temp + wa_duties-zint.
        CLEAR : wa_duties-zint.
      ENDSELECT.
      MOVE  : temp TO wa_duties-zint.
      CLEAR : temp.
      SELECT kwert  INTO wa_duties-jead FROM konv
               WHERE knumv = wa_vbrk-knumv
               AND   kposn = wa_vbrp-posnr
               AND  kschl  = 'JEAD'.
        temp = temp + wa_duties-jead.
        CLEAR : wa_duties-jead.
      ENDSELECT.
      MOVE  : temp TO wa_duties-jead.
      CLEAR : temp.
      SELECT kbetr kwert  INTO (wa_duties-zect_per, wa_duties-zect) FROM konv
            WHERE knumv = wa_vbrk-knumv
             AND   kposn = wa_vbrp-posnr
            AND  kschl  = 'ZECT'.
        temp = temp + wa_duties-zect.
        CLEAR : wa_duties-zect.
      ENDSELECT.
      MOVE  : temp TO wa_duties-zect.
      CLEAR : temp.
      wa_duties-zect_per = wa_duties-zect_per / 10.
      SELECT kwert  INTO wa_duties-zsad FROM konv
        WHERE knumv = wa_vbrk-knumv
         AND   kposn = wa_vbrp-posnr
        AND  kschl  = 'ZSAD'.
        temp = temp + wa_duties-zsad.
        CLEAR : wa_duties-zsad.
      ENDSELECT.
      MOVE  : temp TO wa_duties-zsad.
      CLEAR : temp.
      IF wa_vbrk-kalsm = 'ZINSCR'.
        wa_duties-total = gv_tot_amt
                       + wa_duties-jexp
                       + wa_duties-jecs
                       + wa_duties-zlst_val
                       + wa_duties-zint
                     + wa_duties-jead
                       + wa_duties-vat_val
                       + wa_duties-zcst_val.
                     + wa_duties-jecs
                     + wa_duties-zeap
                     + wa_duties-zecs
                     + wa_duties-zsad
                     + wa_duties-jadc.
      ELSEIF wa_vbrk-kalsm = 'ZINFAC'.
        wa_duties-total = gv_tot_amt
                       + wa_duties-jexp
                       + wa_duties-jecs
                       + wa_duties-zlst_val
                       + wa_duties-zint
                       + wa_duties-jeap
                       + wa_duties-vat_val
                       + wa_duties-zcst_val
                     + wa_duties-jecs
                       + wa_duties-zeap
                       + wa_duties-zect.
                     + wa_duties-zsad
                     + wa_duties-jadc.
      ENDIF.
    Get Condition descriptions.
      SELECT SINGLE * FROM t685t INTO wa_t685t
      WHERE kschl = 'ZVAT' AND spras = 'EN'.
      MOVE wa_t685t-vtext TO gv_vat.
      CLEAR wa_t685t.
      SELECT SINGLE * FROM t685t INTO wa_t685t
      WHERE kschl = 'ZVAT' AND spras = 'EN'.
      MOVE wa_t685t-vtext TO gv_vat.
      CLEAR wa_t685t.
      SELECT SINGLE * FROM t685t INTO wa_t685t
      WHERE kschl = 'ZLST' AND spras = 'EN'.
      MOVE wa_t685t-vtext TO gv_zlst.
      CLEAR wa_t685t.
      SELECT SINGLE * FROM t685t INTO wa_t685t
      WHERE kschl = 'ZCST' AND spras = 'EN'.
      MOVE wa_t685t-vtext TO gv_zcst.
      CLEAR wa_t685t.
      SELECT SINGLE * FROM t685t INTO wa_t685t
      WHERE kschl = 'ZECT' AND spras = 'EN'.
      MOVE wa_t685t-vtext TO gv_zect.
      CLEAR wa_t685t.
      SELECT SINGLE * FROM t685t INTO wa_t685t
      WHERE kschl = 'ZEAP' AND spras = 'EN'.
      MOVE wa_t685t-vtext TO gv_zeap.
      CLEAR wa_t685t.
      SELECT SINGLE * FROM t685t INTO wa_t685t
      WHERE kschl = 'JETC' AND spras = 'EN'.
      MOVE wa_t685t-vtext TO gv_jetc.
      CLEAR wa_t685t.
      SELECT SINGLE * FROM t685t INTO wa_t685t
      WHERE kschl = 'JEAP' AND spras = 'EN'.
      MOVE wa_t685t-vtext TO gv_jeap.
      CLEAR wa_t685t.
      SELECT SINGLE * FROM t685t INTO wa_t685t
      WHERE kschl = 'JECS' AND spras = 'EN'.
      MOVE wa_t685t-vtext TO gv_jecs.
      CLEAR wa_t685t.
      SELECT SINGLE * FROM t685t INTO wa_t685t
      WHERE kschl = 'JADC' AND spras = 'EN'.
      MOVE wa_t685t-vtext TO gv_jadc.
      CLEAR wa_t685t.
       gv_ecsduty = wa_j_1iexchdr-exbed * ( c_ecs / 100 ).
      cen_amt = wa_duties-jexp + wa_duties-jeap.
      gv_tot_cen_amt = cen_amt + wa_duties-jecs.
      MOVE wa_j_1iexchdr-remtime TO wa_duties-remtime.
      MOVE wa_j_1iexchdr-exdat TO wa_duties-exdat.
    Convert amount to words.
      CALL FUNCTION 'SPELL_AMOUNT'
        EXPORTING
          amount    = wa_duties-total
          currency  = 'INR '
          filler    = space
          language  = sy-langu
        IMPORTING
          in_words  = in_words
        EXCEPTIONS
          not_found = 1
          too_large = 2
          OTHERS    = 3.
      IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
      MOVE : in_words-word TO word,
           in_words-decword TO decword.
    write  duty details
      IF wa_vbrk-kalsm = 'ZINSCR'.
        PERFORM write_form USING 'ZINSCR' 'APPEND' 'BODY' 'GRANDTOT' .
      ELSEIF  wa_vbrk-kalsm = 'ZINFAC'.
        PERFORM write_form USING 'ZINFAC' 'APPEND' 'BODY' 'GRANDTOT' .
      ENDIF.
    *close form
       PERFORM close_form.
    ENDLOOP.
    ENDFORM.                    "SD_INVOICE_SUPPL
          FORM FORM_TITLE_PRINT                                         *
          Formulartitel entsprenchend des Feldes VBTYP drucken          *
    FORM form_title_print.
      CASE vbdkr-vbtyp.
        WHEN 'M'.
          CALL FUNCTION 'WRITE_FORM'
            EXPORTING
             element = 'TITLE_M'
              window  = 'HEADER'
            EXCEPTIONS
              element = 1
              window  = 2.
          IF sy-subrc NE 0.
            PERFORM protocol_update.
          ENDIF.
        WHEN 'N'.
          CALL FUNCTION 'WRITE_FORM'
            EXPORTING
              element = 'TITLE_N'
              window  = 'TITLE'
            EXCEPTIONS
              element = 1
              window  = 2.
          IF sy-subrc NE 0.
            PERFORM protocol_update.
          ENDIF.
        WHEN 'O'.
          CALL FUNCTION 'WRITE_FORM'
            EXPORTING
              element = 'TITLE_O'
              window  = 'TITLE'
            EXCEPTIONS
              element = 1
              window  = 2.
          IF sy-subrc NE 0.
            PERFORM protocol_update.
          ENDIF.
        WHEN 'P'.
          CALL FUNCTION 'WRITE_FORM'
            EXPORTING
              element = 'TITLE_P'
              window  = 'TITLE'
            EXCEPTIONS
              element = 1
              window  = 2.
          IF sy-subrc NE 0.
            PERFORM protocol_update.
          ENDIF.
        WHEN 'S'.
          CALL FUNCTION 'WRITE_FORM'
            EXPORTING
              element = 'TITLE_S'
              window  = 'TITLE'
            EXCEPTIONS
              element = 1
              window  = 2.
          IF sy-subrc NE 0.
            PERFORM protocol_update.
          ENDIF.
        WHEN 'U'.
          CALL FUNCTION 'WRITE_FORM'
            EXPORTING
              element = 'TITLE_U'
              window  = 'TITLE'
            EXCEPTIONS
              element = 1
              window  = 2.
          IF sy-subrc NE 0.
            PERFORM protocol_update.
          ENDIF.
        WHEN OTHERS.
          CALL FUNCTION 'WRITE_FORM'
            EXPORTING
              element = 'TITLE_M'
              window  = 'TITLE'
            EXCEPTIONS
              element = 1
              window  = 2.
          IF sy-subrc NE 0.
            PERFORM protocol_update.
          ENDIF.
      ENDCASE.
      IF repeat NE space.
        CALL FUNCTION 'WRITE_FORM'
          EXPORTING
            element = 'REPEAT'
            window  = 'REPEAT'
          EXCEPTIONS
            element = 1
            window  = 2.
        IF sy-subrc NE 0.
          PERFORM protocol_update.
        ENDIF.
      ENDIF.
    ENDFORM.                    "FORM_TITLE_PRINT
          FORM REFERENCE_NUMBER                                         *
          Referenznummer ausgeben                                       *
    FORM reference_number.
      CHECK vbdkr-vbtyp CA 'MUN'.
      CALL FUNCTION 'WRITE_FORM'
        EXPORTING
          window = 'INVOICE'
        EXCEPTIONS
          window = 2.
      IF sy-subrc NE 0.
        PERFORM protocol_update.
      ENDIF.
    ENDFORM.                    "REFERENCE_NUMBER
          FORM HEADER_TEXT_PRINT                                        *
          Kopftexte ausgeben                                            *
    FORM header_text_print.
      CALL FUNCTION 'WRITE_FORM'
        EXPORTING
          element = 'HEADER_TEXT'
        EXCEPTIONS
          element = 1
          window  = 2.
      IF sy-subrc NE 0.
        PERFORM protocol_update.
      ENDIF.
    ENDFORM.                    "HEADER_TEXT_PRINT
          FORM ITEM_PRINT                                               *
          Rechnungsposition ausgeben                                    *
    FORM item_print.
    Kopieren LVBPLP für direkt Zugriff
      LOOP AT lvbplp.
        MOVE-CORRESPONDING lvbplp TO tvbplp.
        APPEND tvbplp.
      ENDLOOP.
      LOOP AT tvbdpr.
        vbdpr = tvbdpr.
        IF tvbdpr-charg IS INITIAL.
          PERFORM get_item_prices.
          PERFORM get_item_characteristics.
          CALL FUNCTION 'CONTROL_FORM'
            EXPORTING
              command = 'PROTECT'.
          CALL FUNCTION 'WRITE_FORM'
            EXPORTING
              element = 'ITEM_LINE'.
          PERFORM item_price_print.
          PERFORM item_characteristics_print.
          CALL FUNCTION 'CONTROL_FORM'
            EXPORTING
              command = 'ENDPROTECT'.
          PERFORM different_consignee.
          PERFORM different_order_no.
          PERFORM different_delivery_no.
          PERFORM different_extern_no.
          PERFORM different_purchase_order_no.
          PERFORM item_packing_print.
        ELSE.
          IF NOT tvbdpr-fkimg IS INITIAL.
            PERFORM get_item_prices.
            PERFORM item_price_print.
          ENDIF.
        ENDIF.
      ENDLOOP.
    ENDFORM.                    "ITEM_PRINT
          FORM ITEM_PACKING_PRINT                                       *
          Verpackung zu einer Position ausgeben                         *
    FORM item_packing_print.
      DATA: count LIKE sy-index.
      DATA: BEGIN OF hvbplp OCCURS 0,
              stufe     TYPE i.
              INCLUDE STRUCTURE vbplp.
      DATA: END OF hvbplp.
      DATA: vs_element LIKE vbplp-venum.
      CLEAR   hvbplp.
      REFRESH hvbplp.
    Aufbau Versandelementstruktur für Ausgabe
      LOOP AT tvbplp WHERE vbeln = vbdkr-vbeln AND posnr = tvbdpr-posnr.
        hvbplp-stufe = 1.
        MOVE-CORRESPONDING tvbplp  TO hvbplp.
        APPEND hvbplp.
        vs_element = tvbplp-venum.
        IF vs_element EQ ' '. EXIT. ENDIF.         "unverpackt
        CLEAR lvbplk.
        WHILE lvbplk-kzobe NE 'X'.       "nicht oberstes VS-Ele
          suchen übergeordnetes Versandelement
          LOOP AT lvbplp WHERE unvel = vs_element.
            hvbplp-stufe = hvbplp-stufe + 1.
            MOVE-CORRESPONDING lvbplp  TO hvbplp.
            APPEND hvbplp.
            EXIT.
          ENDLOOP.
          vs_element = lvbplp-venum.
          lesen übergeordnetes Versandelement
          READ TABLE lvbplk WITH KEY vs_element.
          IF sy-subrc NE 0.
            EXIT.
          ENDIF.
        ENDWHILE.
      ENDLOOP.
      SORT hvbplp BY stufe venum.
      CLEAR vbplp.
      LOOP AT hvbplp.
        lesen Versandelement
        CLEAR vbplk.
        CLEAR vbpls.
        IF hvbplp-venum EQ ' '.

    Hi,
    SAPScript addresses are formated by postal standards...irrespective of the data populated....
    In line
    /: ADDRESS PARAGRAPH LZ
    change to
    /: ADDRESS DELIVERY PARAGRAPH LZ
    that should bring the street into the address
    Regards
    Stu

  • How to print a Barcode VERTICALLY in a SAP Script ?

    Dear Experts..
    I have to print a Barcode <b>vertically</b> in a SAP Script.
    Could you please help me regarding this.
    Thanks in advance.

    Hey SR,
    follow these steps :
    Bar code  in Smartform :
    General definition of Bar code:
    Bar codes are standardized characters of a symbol made up of a group of lines and spaces that can be recognized by an optical scanner. Bar codes uniquely identify article data, production numbers or transport units, for example. They can also contain additional information such as batch number, expiration date or weight.
    Example
    In the Logistics Execution System (LES), certain field entries can be represented by bar codes and printed on the transfer documents. This simplifies certain data entry processes such as order confirmation.
    Type of bar code:
    Bar codes are based on a binary principle and consist of a series of stripes/gaps of different widths. The sequence of the stripes or gaps results in an (alpha) numeric statement. Bar codes are read optically. Due to varying requirements, bar codes may differ with regard to the following aspects:
    •     printer tolerance
    •     decoding tolerance
    •     character width
    •     automatic check
    •     number of characters
    Steps to implement bar code in the smartform:
    •     Use the transaction code smartstyle. Give a suitable name .Choose create.
    •     In change mode of the Smart Style select the Character formats node and choose Create.
    •     In the Character format field enter a two-character character key.
    •     Select the desired attributes of the Bar Code on the tab Standard Settings.
    •     Choose Activate.
    •     Assign the character format to the field or character string in the smartform.
    •     Activate the smartform.
    •     Test the same.
    Regards,
    Kunal.

  • Remove spaces and special characters from a form field

    Hi,
    I am tragically new to all of this, but am trying to create a form in Adobe Acrobat 9.  I am trying to use a Custom Format script to take inputs in a form field and automatically remove spaces and special characters (hyphens specifically).  For example, if a user inputs "RAN-99 06" I would like it to change to "RAN9906."  I found this script that will not let users input special characters
    if (!event.willCommit) {
        event.change = event.change.replace(/[\$#~%\*\*\^\-\(\)\+=\[\]\{\};\"\<\>\?\|\\\!]/g, "");
    And that's okay, but I can't figure out how to disallow spaces.  Also, the perference would be for a script to allow users to input the data as they like, but to clean it up after they leave the text field.
    Thanks in advance!

    From the description, I assume that the script is currently in the Keystroke event. In fact, that would be a most logical way to have it; simply ignore anything unwanted when entered.
    If you want to allow the user to enter anything, but "clean it up" when done, you would place your code in the Validate event. You will have to adjust your Regular Expression so that it works globally, but that's the whole difference. This will change the value.
    Note that you can also enter the code into the Format event. However, that would only change the visual representation of the value, but internally, the value would remain as entered.
    Hope this can help.
    Max Wyss.

  • Subroutine call from SAP Script

    Hi,
    I need to calculate required/outstanding qty. hence am passing existing values of reservation#/item# and issued qty.
    both req/out qty are returned blank by the code. please help.
    Following is my code segment for a external routine call from SAP Script.
    /:   PERFORM P_GET_QTY IN PROGRAM ZTEST
    /:   USING &MSEG-RSNUM&                     
    /:   USING &MSEG-RSPOS&                     
    /:   CHANGING &REQ_QTY&                     
    /:   CHANGING &MSEG-MENGE&                  
    /:   CHANGING &OUT_QTY&                     
    /:   ENDPERFORM
    REPORT ztest .
    TABLES resb.
    DATA: wa_resb TYPE resb,
          req_qty TYPE resb-bdmng,
          isd_qty TYPE mseg-menge,
          out_qty TYPE resb-bdmng.
    FORM p_get_qty TABLES input  STRUCTURE itcsy
                          output STRUCTURE itcsy.
      DATA: avlbl TYPE resb-bdmng.
      READ TABLE input WITH KEY 'MSEG-RSNUM'.
      CHECK sy-subrc = 0.
      wa_resb-rsnum = input-value.
      READ TABLE input WITH KEY 'MSEG-RSPOS'.
      CHECK sy-subrc = 0.
      wa_resb-rspos = input-value.
      READ TABLE input WITH KEY 'REQ_QTY'.
      CHECK sy-subrc = 0.
      req_qty = input-value.
      READ TABLE input WITH KEY 'MSEG-MENGE'.
      CHECK sy-subrc = 0.
      isd_qty = input-value.
      SELECT SINGLE * INTO wa_resb
                      FROM resb
                      WHERE rsnum = wa_resb-rsnum
                      AND   rspos = wa_resb-rspos.
      CHECK sy-subrc = 0.
      avlbl   = wa_resb-bdmng - wa_resb-enmng.
      req_qty = avlbl - out_qty.
      out_qty = req_qty - isd_qty.
      output-name = 'REQ_QTY'.
      output-value = req_qty.
    MODIFY output TRANSPORTING name value WHERE name = 'REQ_QTY'.
      APPEND output.
      output-name = 'OUT_QTY'.
      output-value = out_qty.
    MODIFY output TRANSPORTING name value WHERE name = 'OUT_QTY'.
      APPEND output.
    ENDFORM.
    Thanks,
    Ram.

    Hi Ram,
    I think you have to use MODIFY instead of append for the OUTPUT table.
    MOdify the table with KEY. This should resolve the problem.
    Ram, you can check this code and see how the MODIFY is to be used.
    REPORT YLSD999A.
    DATA  W_LENGTH TYPE I.
    *   GENERAL PURPOSE SUBROUTINES FOR CALLING FROM SAPSCRIPTS
    FORM DISPLAY_POUND TABLES IN_TAB STRUCTURE ITCSY
                              OUT_TAB STRUCTURE ITCSY.
      DATA: COUNT TYPE P VALUE 16.
      DATA: W_VALUE(17) TYPE C.        "defined as 7 chars to remove pence
      DATA: W_CHAR TYPE C.
      DATA: W_DUMMY TYPE C.
      DATA: W_CURR(3) TYPE C.
    *    Get first  parameter in input table.
      READ TABLE IN_TAB INDEX 1.
      WRITE IN_TAB-VALUE TO W_VALUE .
    * get second parameter in input table
      READ TABLE IN_TAB INDEX 2.
      MOVE IN_TAB-VALUE TO W_CURR.
      IF W_CURR = 'GBP'.
        W_CURR = '£'.
      ENDIF.
      W_LENGTH = STRLEN( W_CURR ).
    *    look for first space starting at right.
      WHILE COUNT > -1.
        W_CHAR = W_VALUE+COUNT(1).
    *  W_CHAR = IN_TAB-VALUE+COUNT(1).
        IF W_CHAR = ' '.
          COUNT = COUNT - W_LENGTH + 1.
          W_VALUE+COUNT(W_LENGTH) = W_CURR.
          COUNT = -1.
        ELSE.
    *     W_VALUE+COUNT(1) = W_CHAR.
          COUNT = COUNT - 1.
        ENDIF.
      ENDWHILE.
    * read only parameter in output table
      READ TABLE OUT_TAB INDEX 1.
      OUT_TAB-VALUE = W_VALUE.
      MODIFY OUT_TAB INDEX SY-TABIX.
    ENDFORM.
    Cheers
    VJ

  • Conversion of QC21 sap script to pdf

    Hello Experts
    I was working on QC21 sap script layout,got guidance from u guys & i managed to finish.
    now can anyone tell me how to convert the sap script to pdf format?
    Kash

    Hi,
    if u wish to automate the process, then u can write the following code...
    DATA: V_PRINT_PARMS LIKE PRI_PARAMS.
    DATA: V_PDFSPOOLID TYPE TSP01-RQIDENT,
              V_RQIDENT TYPE TSP01-RQIDENT.
    DATA: V_RQ2NAME TYPE STRING.
    DATA: T_PDF LIKE TLINE OCCURS 0 WITH HEADER LINE.
    DATA: T_RSPAR TYPE STANDARD TABLE OF RSPARAMS.
    To Setup The Print Parameters
    CALL FUNCTION 'GET_PRINT_PARAMETERS'
      EXPORTING
        AUTHORITY   = SPACE
        COPIES    = '1'
        COVER_PAGE    = SPACE
        DATA_SET     = SPACE
        DEPARTMENT      = SPACE
        DESTINATION    = SPACE
        EXPIRATION     = '1'
        IMMEDIATELY     = SPACE
        LAYOUT     = SPACE
        MODE       = SPACE
        NEW_LIST_ID    = 'X'
        NO_DIALOG      = 'X'
        USER     = SY-UNAME
      IMPORTING
        OUT_PARAMETERS     = V_PRINT_PARMS.
    IF SY-SUBRC EQ 0.
    Submit Program & Store Spool ID Into Memory
    CALL FUNCTION 'RS_REFRESH_FROM_SELECTOPTIONS'
        EXPORTING
          CURR_REPORT     = 'RQCAAP01'
        TABLES
          SELECTION_TABLE = T_RSPAR.
    ENDIF.
    SUBMIT RQCAAP01 VIA SELECTION-SCREEN TO SAP-SPOOL WITHOUT SPOOL DYNPRO
               SPOOL PARAMETERS V_PRINT_PARMS
               WITH SELECTION-TABLE T_RSPAR
               AND RETURN.
    Retrieving Spool ID From TSP01 Table
    CONCATENATE V_RQ2NAME SY-UNAME INTO V_RQ2NAME.
    SELECT * FROM TSP01
    WHERE RQ2NAME EQ V_RQ2NAME ORDER BY RQCRETIME DESCENDING.
      V_RQIDENT = TSP01-RQIDENT.
      EXIT.
    ENDSELECT.
    IF SY-SUBRC NE 0.
      CLEAR V_RQIDENT.
    ENDIF.
    To Convert Spool ID To PDF Format
    CALL FUNCTION 'CONVERT_OTFSPOOLJOB_2_PDF'
      EXPORTING
        SRC_SPOOLID              = V_RQIDENT
      TABLES
        PDF                      = T_PDF.
    IF SY-SUBRC EQ 0.
    To Download The File In PDF Format
    to get file name and location for saving
    CALL METHOD CL_GUI_FRONTEND_SERVICES=>FILE_SAVE_DIALOG
        EXPORTING
          WINDOW_TITLE         = 'Select The Path Where The PDF Should Be Saved'
          DEFAULT_FILE_NAME    = 'Certificate Of Analysis.PDF'
        CHANGING
          FILENAME             = v_filename
          PATH                 = v_filepath
          FULLPATH             = v_fullpath.
    To download the PDF file
      CALL FUNCTION 'GUI_DOWNLOAD'
        EXPORTING
          FILENAME                = v_fullpath
          FILETYPE                = 'BIN'
        TABLES
          DATA_TAB                = T_PDF.
    ENDIF.
    I hope this resolves ur issue...
    Regards,
    Radhika

Maybe you are looking for