A longtext or text is a bit of a special field when projected against a database. Normally, fields have a predefined type and length, text fields however have no length...
which is more than a bit awkward for a database. Hence SAP uses a text pool for all texts in the system, whether they apply to the documentation of a program, or as item text on a Purchase Order. This issue is about the setup of text fields, how to find them, manipulate them and understand the setup.
Looking for a text on a requisition ? Need the longtext of a material ? Standard SAP documents store their longtexts in the same tables..
If you want to fetch the longtext of a purchase order (header) you will find that the text-pool principle is used in standard applications as well. Now starting from the end user request, how do you find that long text !? To find it you will need the ID, Language, Object and Name (all 2b found in structure THEAD
. These values are available to you in table STXH
"SAPscript text file header".
Texts are stored on the database much like any other field. However - since text fields have no length, texts are not stored in a single table but a simple data model (of 2 tables). The typical characteristics of text fields listed:
What you should do and not do when implementing long texts
- Do Make use of the texts concept - even for your own developments.
- Don't Use text fields to store a field value you may need. Field values belong elsewhere.
- Do Use the concept of including texts. When texts are used inefficiently, a given text will be stored on the system many many times.
OTR texts or Online Text Repository texts are longtexts which are held in a centrally available storage location, accessible from SAP but also for e.g. BSP (Business Server Pages - the web) applications. OTS is about editing, maintenance and usage of these texts. Texts are cross-client workbench objects.
SAP's wide support for long texts is not reserved for SAP programs only. If you are planning to store long texts with your tables, you should do this exactly the same way SAP does... By using the ID, Language, Object and Name, you can identify your own texts and incorporate them in SAP's textpool. The ID can probably be reused from one of SAP's ID's. Use LTXT
for example. The Object should be created (as new), just to ensure you are not mixing up any other texts (and thus other applications).
An overview of functions that can be used to read, change, rename, create and delete texts...
Texts can be stored in a textpool (or textpools) in SAP. Several transactions can use the same way of storage when texts are involved. A series of function building blocks can be found in the function group STXD
.
An overview of function modules in text manupilation:
Standard texts are not put on a transport by default, probably because these texts can be changed on any system. So should you enter them in every system ? It's up to you - but I can tell you my preference: use transports ! Just to get the initial version of your texts across all systems anyway. How to transport: the same way it was done in the middle-ages: run an unfancy little report called RSTXTRAN
and select your text (or texts). Follow it through and your transport will be created.
This article describes how to retrieve program documentation as text.
Program documentation can be maintained for each ABAP via the transaction SM38
, "program development". This text can be reproduced on the screen via a function building block:
Example: Retrieve documentation text for a program
Program documentation can be maintained for each ABAP via the transaction SM38, "program development". This text can be reproduced on the screen via a function building block:
Article predades the millenium bug...
Barcode numbers can also be text-theme, here's how to allow SapScript to print barcoding. Printing a barcode in SapScript can be done via the layout set by basically doing the following: barcode printing is activated by selecting a barcode font, characters in the barcode font simply display vertical lines that build up the barcode. Finding out what font you can use for your printer will have to be done in SAP's way: output print controls. SAP supplies these print controls for a variety of printertypes, so try to find these first. An easy way to test your printer with specific print controls is creating a standard text and change / print it. For KYOCERA device types and HPLJ4 device types (HP laserjet 4 series) SAP supplies a standard text. The text SAPSCRIPT-BARCODETEST
can be used to either test or use as example for your own tests. Change and print the standard text from R/3 => Tools => Word processing => Standard text. The text ID is "ST", the language "D" or "E". If printing via standard text works, you can adapt your layout set for barcode printing.