cancel
Showing results for 
Search instead for 
Did you mean: 

symbol length - count

Former Member
0 Kudos

Hi,

is it possible to count the length of a symbol within a sapscript form itself? I know how to limit it but not sure if you can count how long it is currently?

e.g. 1234567890 = length of 10

I need to know this to allow word wrapping

Regards, Paul

Accepted Solutions (1)

Accepted Solutions (1)

former_member203305
Active Contributor
0 Kudos

hi, did u try to use STRLEN?? if it is not possible, i think that u have to assign the value of the field symbol to another variable and then use the STRLEN to get the lenght.

for more info about STRLEN type it and then use F1 to check the SAP info.


data: length type i.
length = strlen( variable ).

Regards

Former Member
0 Kudos

Hi, thanks for the suggestion.

Can you use strlen within the SAPSCRIPT form itself? I know this is possible in the print program but I was just querying if this is possible in the actual form?

Regards

Answers (6)

Answers (6)

Former Member
0 Kudos

obviously not possible - was aware I could go back to print program but wondered if you could do this in sapscript.

Former Member
0 Kudos

take the below example and follow as per this and come back for any further Query.

in text editor of script write

/: PERFORM CONTACT IN PROGRAM ZAMOUNT_ZF110_IN_AVIS1_C

/: USING &REGUH-ZALDT&

/: CHANGING &DT&

/: ENDPERFORM

<< Unformatable code removed >>

regards,

venkat.

Edited by: Rob Burbank on Jul 8, 2009 8:57 AM

Former Member
0 Kudos

Hi Paul,

Already 3 persons have said use a perform to calculate the length

/: PERFORM function IN PROGRAM program.

I am the 4th. So you know what to do.

There are no standard solution for it in SAP-script.

or you have to do stupid things llike

if &VAR(1)& eq ' '.

if &VAR+1(1)& eq ' '

if &VAR+2(1)& eq ' '

if &VAR+3(1)& eq ' '.

etc.

Gr., Frank

former_member585865
Contributor
0 Kudos

Hi Paul,

you have to call a subroutine in your form then only you can do this way.

former_member203305
Active Contributor
0 Kudos

No, it is not possible without calling an abap subroutine.


/: perform <form> in programa <programa>.

Regards

Former Member
0 Kudos

Not that I know of directly in the form itself, but in the form you could call a routine in a program to calculate the length.

Rob