Application Development and Automation 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: 
Read only

SAPscript DEFINE using double quotes.

Former Member
0 Likes
1,324

Hello all,

It is OK to use double quotes in a DEFINE statement so an apostrophe will print?

<u>Example:</u>

:/Define &TITLE& = "That's all there is"

which will then print <i>That's all there is</i>

It worked in a test I created, but is this the best approach? Is there a better solution?

Thank you

Bill Lomeli

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
717

Hi Bill,

To put a single quote within a text string, you use two single quotes in a row.

E.g.

:/Define &TITLE& = 'That''s all there is'

This will be interpretted as:

That's all there is

Hope this helps,

Kylie

5 REPLIES 5
Read only

Former Member
0 Likes
717

Hi,

In the Script, Normally we define the varialbes using DEFINE and assign the text to it with Single codes ...

Syntax: /: DEFINE &symbol_name& = 'value'

/: DEFINE &subject& = 'Your letter of 7/3/95'

The value assigned can have a maximal length of 60 characters. It may itself contain other symbols. A symbol contained within the value assigned to another symbol is not replaced with its own value at the point at which the DEFINE command is executed. Rather, this replacement is made when the symbol defined in the DEFINE command is called in the text.

/: DEFINE &symbol1& = 'mail'

/: DEFINE &symbol2& = 'SAP&symbol1&'

Regards

Sudheer

Read only

Former Member
0 Likes
717

Hi,

use single quotes in sap script as standard practice

DEFINE &NEW_PG& = 'X'

Regards

Amole

Read only

0 Likes
717

HI,

Better to create a standard text in SO10 like <b>That's all there</b> and use the text id in ur sapscript.

define variable with double quotes is not good practice in scripts.

Regards

Read only

Former Member
0 Likes
718

Hi Bill,

To put a single quote within a text string, you use two single quotes in a row.

E.g.

:/Define &TITLE& = 'That''s all there is'

This will be interpretted as:

That's all there is

Hope this helps,

Kylie

Read only

0 Likes
717

Worked like a charm.

Thanks

Bill