使用字符串模板" |"多行

时间:2017-11-21 18:57:46

标签: concatenation sap abap

有没有办法在多行中使用|字符串运算符?

使用经典CONCATENATE令牌,您可以进行以下分配:

CONCATENATE 'A rubber duck is a toy shaped like a stylized'
            'duck, generally yellow with a flat base. It'
            'may be made of rubber or rubber-like material' 
            'such as vinyl plastic.' INTO lv_variable SEPARATED BY space.

我找不到有效的方法来执行以下操作:

lv_variable = |A rubber duck is a toy shaped like a stylized | &
              |duck, generally yellow with a flat base. It | &
              |may be made of rubber or rubber-like material | &
              |such as vinyl plastic.|.

有没有办法实现这一点,或者在使用|运算符时是否限制在一行?

1 个答案:

答案 0 :(得分:6)

你可以这样做:

data : lv_variable type string.

lv_variable = |A rubber duck is a toy shaped like a stylized| &&
              |duck, generally yellow with a flat base. It | &&
              |may be made of rubber or rubber-like material | &&
              |such as vinyl plastic.|.

write lv_variable.