`
zjut_xiongfeng
  • 浏览: 287185 次
  • 性别: Icon_minigender_1
  • 来自: 杭州
社区版块
存档分类
最新评论

Formatting SAPScript / SMARTFORMS in SAP

阅读更多

Formatting SAPScript / SMARTFORMS in SAP

There are few formatting options available in SAP for text formatting in SAPScript as well as Smartforms.

 

SAPScript Formatting

SAPScript Formatting

 

 

Smartforms Formatting

Smartforms Formatting

 

 

 

 

Following are the few useful formatting options:

 

Offset

N left-most characters of the symbol value will not be displayed.

If symbol has the value 123456789, the following will be displayed:

&symbol& -> 123456789

&symbol+3& -> 456789

&symbol+7& -> 89

&symbol+12& ->

&symbol+0& -> 123456789

 

Output Length

to define how many character positions should be copied from the value.

If symbol has the value 123456789.

&symbol(3)& -> 123

&symbol(7)& -> 1234567

 

The SYST-UNAME field contains the logon name of a user called Einstein. The

Dictionary entry for this field contains an output length of 12.

&SYST-UNAME&… -> Einstein…

&SYST-UNAME(9)&… -> Einstein …

&SYST-UNAME(*)&… -> Einstein …

 

Omitting the Leading Sign

The S option can be used to ensure that the value is formatted without the sign.

The ITCDP-TDULPOS field contains the value -100.00. The ABAP/4 Dictionary

definition for this field includes a leading sign.

&ITCDP-TDULPOS& -> 100.00-

&ITCDP-TDULPOS(S)& -> 100.00

 

Leading Sign to the Left

This option enables you to specify that the leading sign should be placed to the left of the number.

&ITCDP-TDULPOS& -> 100.00-

&ITCDP-TDULPOS(<)& -> -100.00

 

Leading Sign to the Right

If you used the SET SIGN LEFT control command to specify that the leading sign should be output before the value, this specification can be overridden for individual symbols to enable these to be output with the leading sign to the right.

Syntax:

&symbol(>)&

 

Omitting Leading Zeros

Certain symbol values are output with leading zeros. If you wish to suppress these, you may do so with the Z option.

Assuming the current date is 1.1.1994, &DAY& -> 01

&DAY(Z)& -> 1

 

Space Compression

The C option has the effect of replacing each string of space characters with a single space and shifting the ’words’ to the left as necessary to close up the gaps.

Assuming ‘ Albert Einstein ‘ is the symbol value,

&symbol& -> Albert Einstein

&symbol(C)& -> Albert Einstein

 

Number of Decimal Places

A program symbol of one of the data types DEC, QUAN and FLTP can contain decimal place data. This option is used to override the Dictionary definition for the number of decimal places for the formatting of this symbol value.

The EKPO-MENGE field contains the value 1234.56. The Dictionary definition specifies 3 decimal places and an output length of 17.

&EKPO-MENGE& -> 1,234.560

&EKPO-MENGE(.1) -> 1,234.6

&EKPO-MENGE&(.4) -> 1,234.5600

&EKPO-MENGE&(.0) -> 1,235

 

Specifying an Exponent for Floating Point Numbers

The way that a floating point number is formatted depends on whether an exponent is specified.

PLMK-SOLLWERT field is assumed to have the value

123456.78 and to be of data type FLTP.

&PLMK-SOLLWERT& -> +1.23456780000000E+05

&PLMK-SOLLWERT(E3)& -> +123.456780000000E+03

&PLMK-SOLLWERT(E6)& -> +0.12345678000000E+06

&PLMK-SOLLWERT(E0)& -> +123456.780000000

&PLMK-SOLLWERT(E)& -> +123456.780000000

 

Right-Justified Output

Right-justified formatting can be specified with the R option. This option has to be used in conjunction with an output length specification. If symbol has the value 1234.

&symbol& -> 1234

&symbol(8R) -> 1234

 

Fill Characters

Leading spaces in a value can be replaced with a fill character.

The figure for customer sales in the KNA1-UMSAT field is $700. The Dictionary description of the field specifies an output length 8.

&KNA1-UMSAT& -> 700.00

&KNA1-UMSAT(F*)& -> **700.00

&KNA1-UMSAT(F0)& -> 00700.00

 

Suppress Output of Initial Value

The I option can be used to suppress the output of symbols which still contain their initial value.

Assuming KNA1-UMSAT contains the value 0 and the currency is DEM.

&KNA1-UMSAT& -> 0,00

&KNA1-UMSAT(I)& ->

If the field contains an amount other than 0, this value will be output in the normal way.

&KNA1-UMSAT& -> 700,00

&KNA1-UMSAT(I)& -> 700,00

 

Ignore Conversion Routines

SAPscript conversion routines specified in the Dictionary are automatically recognized and used when program symbols are being formatted. Using the K option can prevent these conversions.

 

Date Mask

The formatting for date fields can be defined with the SAPscript SET DATE MASK command. Executing this command causes all subsequent date fields to be output using the specified formatting.

/: SET DATE MASK = ‘date_mask’

The following templates may be used in the date mask:

DD day (two digits)

DDD name of day (abbreviated)

DDDD name of day (written out in full)

MM month (two digits)

MMM name of month (abbreviated)

MMMM name of month (written out in full)

YY year (two digits)

YYYY year (four digits)

LD day (formatted as for the L option)

LM month (formatted as for the L option)

LY year (formatted as for the L option)

 

Time Mask

You can use the SAPscript SET TIME MASK command to format time fields in a way that differs from the standard setting.

Assuming the current time is 10:08:12.

&TIME& -> 10:08:12

/: SET TIME MASK = ‘HH:MM’

&TIME& -> 10:08

/: SET TIME MASK = ‘HH hours MM minutes’

&TIME& -> 10 hours 08 minutes

&TIME(Z)& -> 10 hours 8 minutes

 

Other Standard Outputs:

&DAY&, &MONTH&, &YEAR&, &HOURS&, &MINUTES&, &SECONDS&, &DATE&, &TIME&, &PAGE&, &NEXTPAGE&.

分享到:
评论

相关推荐

    SAPscript Forms 教程

    - **Text Formatting**:SAPscript 提供两种方式来格式化 Form 中的文本:一是通过标准文本处理器直接编辑 Form 内容;二是通过 SAP 应用中的打印程序生成文档,其中用户可输入特定文本信息。 ##### 1.2.3 Client ...

    SAP script Forms编程指南

    1. SAPscript的组成 SAP Script由几个关键组成部分构成,包括控制命令、符号、格式选项以及功能模块。这些组件协同工作,允许用户构建定制化的打印输出,如信函、发票、报告等。 1.1 Forms: 组件和技术 1.2.1 概念 ...

    SAP ABAP ScriptForm 中文版本

    这部分介绍了SAPscript中的符号,符号是SAPscript的核心组成部分之一。 **3.1 SyntaxofSymbols** - 符号有特定的语法结构,开发者需要了解这些规则以便正确使用。 **3.2 SystemSymbols** - **系统符号**是由系统...

    abap新手资料-[sapscript编程指南-].doc

    SAPscript 是 SAP 系统中用于创建和设计打印输出的一种编程语言,它主要用于自定义打印格式,如信头、发票、报告等。对于初学者来说,了解 SAPscript 的基本结构和组件至关重要。 1. SAPscript 的组成 - **编辑器*...

    abap script form 视频教材

    2. **Font and Formatting**:ABAP Script提供了多种字体和格式选项,如大小、颜色、加粗、斜体等,用于美化输出。你可以直接在代码中设置这些属性。 3. **Graphics and Images**:除了文本,还可以插入图形和图片...

    SAP专业教材资料7107_TFIN_12_(19-20).pdf

    《SAP专业教材资料7107_TFIN_12_(19-20).pdf》是一份关于SAP R/3系统财务管理模块的培训教材,主要关注的是报告设计工具Report Painter和Report Writer的基础知识。这份资料适用于那些希望掌握SAP R/3系统中报告生成...

    Basic Visual Formatting in CSS

    inline-block, list-item, and run-in boxes ■ Change the type of box an element generates, from inline to block, or list-item to inline ■ Dive into the complexities of horizontal and vertical block-...

    System.Net.Http.Formatting各版本.zip

    在.NET框架中,`System.Net.Http.Formatting`是一个关键的组件,主要用于处理HTTP客户端的输入和输出数据格式化。这个库提供了对JSON(JavaScript Object Notation)和XML等数据格式的支持,使得C#开发者能够方便地...

    sap abap举例大全

    在SAP ABAP编程中,ALV(Accelerated SAP List Viewer)是一种强大的工具,用于创建交互式、可自定义的报告。以下是一些关键的知识点,涵盖了从基础到高级的ALV应用: 1. **Simple ALV Grid Report**: 这是ALV报告...

    System.Net.Http.Formatting.dll

    System.Net.Http.Formatting.dll

    UE(官方下载)

    The benefit of a column maker is that it can help you to format your text/code, or in some cases to make it easier to read in complex nested logic. Quick Open UltraEdit and UEStudio provide multiple ...

    SAP BusinessObjects BI4 Suite - Supported BEx Query Elements

    7. **条件格式化(Conditional Formatting)**:条件格式化功能允许用户根据数据的特定条件自动应用不同的格式设置,例如高亮显示异常值等。 8. **公式(Formulas)**:公式支持用户自定义计算逻辑,以创建新的度量...

    SymbolTypeViewer_1_0_0_6

    personalize the formatting: addition of suffix in the names of types, freeze the sizes of structures and members (the pointers become ULONG32 for a 32bit system and UINT64 for a 64bit system) ...

    System.Net.Http.Formatting 4.0各版本

    System.Net.Http.Formatting 4.0 是ASP.NET Web API框架中的一个重要组成部分,主要用于处理HTTP消息的序列化和反序列化,支持JSON、XML等多种数据格式。这个库为C#开发者提供了强大的工具,使得在构建RESTful服务时...

    Formatting Dates, Times and Numbers in ASP.NET

    在IT领域,尤其是在Web开发中,格式化日期、时间和数字是至关重要的技能,尤其是在使用ASP.NET框架时。本文将深入探讨在ASP.NET中如何格式化日期、时间和数字,包括标准格式字符串的应用以及自定义格式化的高级技巧...

    SQLPrompt_7.3.0.651(包含注册机)

    Fix for insert semicolons error being displayed when trying to format a script in older versions of SSMS2016 (UserVoice and Forum post) Place first item on new line now works for ORDER BY in windowed ...

    System.Net.Http.Formatting.xml

    System.Net.Http.Formatting.xml

    sap BDC技术详解

    * 3.) The second line shows the field name of the structure, the field name must consist of a fieldname and optional the character '_' and three numbers and the field length in brackets * 4.) Each ...

    System.Net.Http.Formatting

    标题“System.Net.Http.Formatting”指的是.NET Framework或.NET Core中的一个关键组件,它是ASP.NET Web API框架的一部分,主要用于处理HTTP请求和响应的格式化工作。这个组件使得开发人员能够轻松地支持多种数据...

Global site tag (gtag.js) - Google Analytics