Symbols and control commands

Started by jayanthi mandhalapu, Aug 07, 2009, 02:53 AM

previous topic - next topic
Go Down

jayanthi mandhalapu

Symbols are placeholders for values that are inserted during print formatting.

Symbols are indentified by name surrounded by "&" and are not case sensitive

Types of symbols
Formatting
Control commands


Types of symbols
System symbols

DATE                         Date
DAY                           Day
NAME_OF_DAY         Name of day
MONTH                      Month
YEAR                         Year
TIME                         Time
HOURS                      Hours
MINUTES                   Minutes
SECONDS                  Seconds
PAGE                         Page number
NEXTPAGE                 Number of next pagre
DEVICE                     Output device
SPACE                       Blank space
ULINE                       Underline
VLINE                       Vertical line



Standard symbols

Standard symbols are user defined and are maintained in table TTDG. You use transaction SM30 to change or display standard symbols.

An examples of standard symbols is &MFG& fot "Yours faithfully"

Standard text

Se also Using Graphics

Standard texts is predifined texts that can be used in more than one form. Standard texts are can be created, changed and displayed using
transaction SO10.

The text ID is used to classify texts.

To include a standard text in a form, use the INCLUDE command:

/: INCLUDE Z_BC460_EX4_HF OBJECT TEXT ID SDVD


When formatting the standard text the PARAGRAPH parameter is used. To center the text use:


/: INCLUDE <name> <Parameter>

<parameter> = Object, ID, Language, Paragraph

Example:

/: INCLUDE Z_BC460_EX4_HF OBJECT TEXT ID SDVD LANGUAGE EN PARAGRAPH C.


Name: Z_BC460_EX4_HF

Object: Text

Text id: SDVD (Text id from SO10)

Language: EN

Paragraph: C (Centered)

Tip: You can use menu Insert->Text->Standard to make it easier to insert the text



Program symbols

Program symbols are for contents of database fields or global program symbols. When you print the form, data from the database tables are
printed isntead of the symbols.

In the print program:

TABLES: kna1.

In the form:

&KNA1-NAME1&



Formatting


&SYMBOL&                 No formatting
&SYMBOL+4&                 Offset - Output begins here. Offset refers to formatted value
&SYMBOL(5)&                 Length - Output data in the specified length
&SYMBOL(I)&                 Suppress initial value - If the field has been initialized, nothing is output
&SYMBOL(Z)&                 Suppress leading zeros 
&SYMBOL(C)&                 Compress blank spaces - Consecutice spaces are compressed into a single space. Leading spacesare suppressed.
&SYMBOL(R)&                 Right align output
&SYMBOL(S)&                 Operators are suppressed
&SYMBOL(*)&                 Dictionary length - The data length is defined by the ABAP dictionary
&SYMBOL(8.2)&                  Decimal format. Length 8 decimals 2
&'text1'SYMBOL'text2'&         Text can be inserted before and after the symbol



Control commands
Control command are used to modify text output. Use format key /: in the format column.



/: INCLUDE
/: DEFINE
/: ADDRESS....ENDADDRESS
/: PROTECT.....ENDPROTECT
/: NEW-PAGE
/: IF....ENDIF
/: CASE...ENDCASE



Examples of control commands
INCLUDE

INCLUDE name <parameter>

Parameters:

OBJECT E.g. TEXT, DOKU (Document), DSYS (Hypertext).
ID Text ID -Text ID is a way to group texts - Se transaction SO10
LANGUAGE If the parameter is not specefied, the logon language will be used
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.

Object
ID
Language
Paragraph
Standard texts are maintained in transaction SO10.

Example 1:

You have created a standard text in SO10 Named MYTEXT and with Text Id ST

/: INCLUDE MYTEXT OBJECT text ID st

Example 2:

You can also use a dynamic name so that you can retreive a ext depeding of the name variable:

/: INCLUDE &SCUSTOM-NAME& text ID st.

Depending on the name in the variable &SCUSTOM-NAME& different texts will be shown. Note that a text with the name in the variable
&SCUSTOM-NAME& name must be created in SO10.



DEFINE

/: DEFINE &SYMBOL& = 'String1 String2'

/: DEFINE &CUST& = '00000021'.

ADDRESS-ENDDRESS

The ADDRESS-ENDADDRESS command formats addresses according to the postal norms of the recipient's country, as defined in the
country parameter.

/: ADDRESS DELIVERY PARAGRAPH AD
/: NAME &KNA1-NAME&
/: STREET &KNA1-STRAS&
/: POSTCODE &KNA1-PSTLZ&
/: CITY &KNA1-ORT01&
/: COUNTRY &KNA1-LAND1&
/: FROMCOUNTRY 'DE'
/: ENDADDRESS



Time Date and decimal format

Examples:

/: SET TIME MASK = 'HH:MM'
/: SET DATE MASK = 'DD.MMMM.YYYY'
/: SET COUNTRY 'USA'

PROTECT-ENDPROTECT

Is used to avoid pagebreaks in a paragraph. The text lines to be protected are enclosed between the two commands. If there is not enough
room on the page, the PROTECT command acts as a NEW-PAGE command and inserts a page break.

/: PROTECT
:
:
/: ENDPROTECT



5. Conditonal text ouput IF - ENDIF and CASE - ENDCASE

You can use IF/ENDIF and CASE/ENDCASE like in a normal ABAP program

/: IF condition
:
:
/: ENDIF

and

/: IF condition
:
/: ELSE
:
/: ENDIF


Example:

/: IF &SPFLI-CITYTO& = "BERLIN"
* ..... put some text here
/: ENDIF

/: CASE <something>
/: WHEN <...>
/: ENDCASE
Be Happy And Always Remain So

Go Up
 

Quick Reply

With Quick-Reply you can write a post when viewing a topic without loading a new page. You can still use bulletin board code and smileys as you would in a normal post.

Warning: this topic has not been posted in for at least 120 days.
Unless you're sure you want to reply, please consider starting a new topic.

Note: this post will not display until it's been approved by a moderator.
Name:
Email:
Verification:
Please leave this box empty:

Type the letters shown in the picture
Listen to the letters / Request another image

Type the letters shown in the picture:

shortcuts: alt+s submit/post or alt+p preview
IT Acumens Web Designing Chennai | GinGly :: Build your Personal Website | CineBuzz :: Cinema News | My Kids Diary :: Gift your Kids Memories :: Book Website @ 349 Rs monthly
Copyright 2005 - 2021 :: IT Acumens :: All Rights Reserved. :: XML Sitemap
ITAcumens Discussion Forum with 2 lakhs post running for 15 years - Powered by IT Acumens Pro Dedicated Server

My Kids Diary