Application Development 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: 

how to left-justify text (sap script)

Former Member
0 Kudos

Hi,all

There is a field, &data&

value ' material A'

I want to dispaly it as

'material A'

how to remove the blanks before this line?

I tried to use &data(C)& but failed.

Would you please help me ?

Thanks

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi,

Use Statement Shift <Field> Left Deleting Leading spaces in abap editor before calling sap script.

Hope this information will helps you.

With regards,

K K V

8 REPLIES 8

kiran_k8
Active Contributor
0 Kudos

Yang,

Create a paragraph format in a smartstyle as a left-aligned and use this paragraph in the text editor of the script for all the variable which you want to be left aligned.

SMARTSTYLE is a tcode.

K.Kiran.

Former Member
0 Kudos

no, I means there are many space in &data&,5 spaces before characters.' material', I want to remove them.

Message was edited by:

yang

Message was edited by:

yang

0 Kudos

if it is a character filed use

condense data.

or use:

shift data left deleting leading space.

if variable is not character type, move the variable to char type variable and then use the above statements...

plz reward points if it helps

Former Member
0 Kudos

Yes, I tried to do that

I write the in SAP Script Form like this : &data(C)&

(C) means condense, right? but still faild.

0 Kudos

actually i dont have idea regarding sap script...in smartforms we create program lines and use the statements i mentioned and den dispplay varible...im sure u can also create program lines and do da same wid sap script

Former Member
0 Kudos

Hi,

Use Statement Shift <Field> Left Deleting Leading spaces in abap editor before calling sap script.

Hope this information will helps you.

With regards,

K K V

0 Kudos

Yes, It's good idea.

I still want to know if it can be controlled in SAP Script Form(SE71)

0 Kudos

Hi,

Use the statement &symbol (C)& in your script editor.

The C option replaces each string of space characters with a single space and shifting "words" to the left to close gaps. Leading spaces are completely removed.

Hope the above information will helps you.

With Regards,

K K V