cancel
Showing results for 
Search instead for 
Did you mean: 

HI,HOW TO PRINT HEADER TEXT AND ITEM TEXT

Former Member
0 Kudos

HI,

HOW TO PRINT HEADER TEXT AND ITEM TEXT IN MY PURCHASE ORDER. I CREATED SMARTFORM. PLZ HELP ME.

MURALI.

Accepted Solutions (0)

Answers (1)

Answers (1)

former_member181995
Active Contributor
0 Kudos

Murali,

use Read_text functional module to print text.

Amit.

Former Member
0 Kudos

THAT IS OK(READ_TEXT). BUT I WANT TO WRITE IN SMARTFORM USING INCLUDE TEXT.

CAN ANYONE HELP HOW TO USE INCLUDE TEXT IN SMARTFORM.

PLZ URGENT.

MURALI.

Former Member
0 Kudos

INCLUDE TEXTS

To include the contents of another text into the current text, use the INCLUDE control command. SAPscript still treats the text to be included as a separate text. The text is copied over only at the point at which the output is formatted.

Thus the use of the INCLUDE command always ensures that the most current version of a text is included into the output, since the text is not read and inserted until the output is formatted.

Syntax:

/: INCLUDE name OBJECT o ID i LANGUAGE l PARAGRAPH p

NEW-PARAGRAPH np

You must specify the name of the text to be inserted. It can be up to 70 characters long. If the name of the text contains spaces, then you must enclose it in quotes as a literal value. You can, alternatively, specify the name via a symbol. All remaining parameters in the INCLUDE command are optional. If an optional parameter is not specified, then SAPscript uses default values as applicable for the calling environment.

/: INCLUDE MYTEXT

The text MYTEXT is included in the language of the calling text.

/: INCLUDE MYTEXT LANGUAGE 'E' PARAGRAPH 'A1'

The text with the name MYTEXT and the language E is included, regardless of the language of the calling text. The paragraph format A1 will be used as the standard paragraph type for this call.

Optional parameters:

u2022 LANGUAGE

If this parameter is not specified, then the language of the calling text or the form language are used for the text to be included. If the language is specified, then the text will be fetched in this language, regardless of the language of the calling text.

u2022 PARAGRAPH

The text to be included is formatted using the style allocated. The PARAGRAPH parameter can be used to redefine the standard paragraph for this style for the current call. All *-paragraphs in the included text will then be formatted using the paragraph specified here.

u2022 NEW-PARAGRAPH

The first line of the text to be included will be given this format indicator, as long as it is not a comment or command line. If the optional PARAGRAPH parameter (see above) is not specified, then all *-paragraphs of the included text will also be formatted using the paragraph specified in the NEW-PARAGRAPH command.

u2022 OBJECT

In order to completely specify a text, information about the text object is also required. There are a number of restrictions and other rules that depend on the object type of the calling text:

o Any kind of text can be included in a form. If no object is specified, then TEXT will be used (standard texts).

o In the case of a document text (DOKU object), you can include only document texts. This object type is also assumed if no object is specified in this environment.

o Only hypertexts and document texts can be included in a hypertext (DSYS object). If the OBJECT parameter is missing, then DSYS is used as the default value.

o In the other kinds of text you can include only standard texts (TEXT object), document texts or hypertexts. If there is no specification, then the default object is TEXT.

u2022 ID

The text ID is a part of the text key, which permits further text objects within a given object. If no ID is specified, then the default include ID is used from the TTXID table for the calling text. If there is no entry in this table, then the text ID of the calling text is used.

The following consistency check is applied both to the ID and the object:

u2022 All text IDs are allowed in a form.

u2022 In document texts, only document texts may be included that have text IDs TX (general texts) or UO (authorization objects) and also other document texts with the same text ID as the calling document text.

u2022 In DSYS texts, all DSYS texts can be included, whatever ID they have. Document texts to be included must have one of the IDs TX or UO.

u2022 Into the other texts, standard texts with any allowable text ID, DSYS texts with all IDs, and document texts with the IDs TX and UO can be included.

The INCLUDE command returns a status code in the SAPSCRIPT-SUBRC symbol:

u2022 0: the text include was successful.

u2022 1: the command could not be executed because it contained syntax errors.

u2022 2: the rules governing the text to be included were not followed (see above).

This value cannot occur if the command is used in a SAPscript form.

u2022 4: the specified text could not be found.

Once you define the standard text in SO10 you can include text by the above process or use the function module read_text:

CALL FUNCTION 'READ_TEXT'

EXPORTING

CLIENT = SY-MANDT

id =

language =

name =

object =

ARCHIVE_HANDLE = 0

LOCAL_CAT = ' '

IMPORTING

HEADER =

tables

lines = i_tab

EXCEPTIONS

ID = 1

LANGUAGE = 2

NAME = 3

NOT_FOUND = 4

OBJECT = 5

REFERENCE_CHECK = 6

WRONG_ACCESS_TO_ARCHIVE = 7

OTHERS = 8

So you want to know how get the parametrs right. This is how"

In SO10 goto goto menu -> header

here u will find all the required parametrs.

The text lines will be returned in the i_tab.

U can loop at this itab and display the data.