cancel
Showing results for 
Search instead for 
Did you mean: 

Using STRLEN in a sapscript form

Former Member
0 Kudos

I

How can i use STRLEN function in a sapscript ?

I want to know lenght of a variable (&EKKO-TZX01&) and if's less than 40 char's I want put spaces until 40 char's.

It's possible in sapscript ?

Thanks

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

For ur requirement

You can replace leading spaces in a value with a fill character. Use the F option with the character immediately following the F in the specification as the fill character.

Syntax

&symbol(F f )&

f = fill character

Eg.:

Initially if &KNA1-UMSAT& -> 700.00

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

So u can use &ekko-txz01(F )&

Regards,

Prashant

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi, with your tip i can fill spaces before my field (ex: *asparten) but i want fill empty spaces after, (example asparten*).

former_member585060
Active Contributor
0 Kudos

Hi,

Try with which i sujjested, it will give the 'n' no of spaces provided in the ( )

&EKKO-TZX01(40)&

Regards

Bala Krishna

Former Member
0 Kudos

Hi,

try using this in script editor.

if &EKKO-TZX01+40& is initial.

&EKKO-TZX01(F )&.

endif.

former_member585060
Active Contributor
0 Kudos

Hi,

Try this was one &EKKO-TZX01(40)&, provided check that much length available in script.

Regards

Bala Krishna