Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Scripts and smartforms

Former Member
0 Kudos

Hi,

would u help what is the control commands of scripts and smartforms are use and explain?

1 REPLY 1

Former Member
0 Kudos

Hi Veera

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.

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

Regards

Lakshman