Formatting SAPScript / SMARTFORMS in SAP

本文介绍SAPScript及SmartForms中多种文本格式化的选项与技巧,包括偏移、输出长度定义、省略前导符号等,并提供具体字段格式化示例。

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&.

【博士论文复现】【阻抗建模、验证扫频法】光伏并网逆变器扫频与稳定性分析(包含锁相环电流环)(Simulink仿真实现)内容概要:本文档是一份关于“光伏并网逆变器扫频与稳定性分析”的Simulink仿真实现资源,重点复现博士论文中的阻抗建模与扫频法验证过程,涵盖锁相环和电流环等关键控制环节。通过构建详细的逆变器模型,采用小信号扰动方法进行频域扫描,获取系统输出阻抗特性,并结合奈奎斯特稳定判据分析并网系统的稳定性,帮助深入理解光伏发电系统在弱电网条件下的动态行为与失稳机理。; 适合人群:具备电力电子、自动控制理论基础,熟悉Simulink仿真环境,从事新能源发电、微电网或电力系统稳定性研究的研究生、科研人员及工程技术人员。; 使用场景及目标:①掌握光伏并网逆变器的阻抗建模方法;②学习基于扫频法的系统稳定性分析流程;③复现高水平学术论文中的关键技术环节,支撑科研项目或学位论文工作;④为实际工程中并网逆变器的稳定性问题提供仿真分析手段。; 阅读建议:建议读者结合相关理论教材与原始论文,逐步运行并调试提供的Simulink模型,重点关注锁相环与电流控制器参数对系统阻抗特性的影响,通过改变电网强度等条件观察系统稳定性变化,深化对阻抗分析法的理解与应用能力。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值