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

Accepted Solutions (0)

Answers (1)

Answers (1)

former_member196280
Active Contributor
0 Kudos

If it is a smartform try to remove the gap/space like this...

Click on the text where &data& and click the pencil button (it will be under general attribute tab) it will take you to text editor, try to remove the space... save and activate.

This can also be achevied in smartform and SAP scripts by creating tabs spaces in paragraph format and using this tab space like this ,,&data&

Close the thread if your question is answered.

Regards,

Sairam

Former Member
0 Kudos

Hi Sairam,

I means there are some spaces in this field, when I select out the data of this field, It's already have some spaces, I want to remove them.

Message was edited by:

yang

former_member196280
Active Contributor
0 Kudos

&DATA(C)& should work...

Option C condenses, or replaces space characters with a single space moving the words to left as necessary to close the gaps..

try to use like this... &DATA(LC)& " if it still don't workout...

If smartform create program lines and

Data: var(20).

var = data.

Condense data no-gaps.

If in SAP script call external subroutines.. and remove all the gaps avialable in variable...

Close the thread if your question is answered.

Regards,

SaiRam

Former Member
0 Kudos

yes, delete the space before calling sap script is a good idea, but

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

If possible, it's better.

Thanks!

former_member196280
Active Contributor
0 Kudos

If it is a leading space always then you can do like this..

IF &Data+0(1)& EQ ' '

&DATA+1(20)&

ELSE

&data&

ENDIF

Wise to delete the space before calling sap script or using external subroutines.

Regards,

SaiRam

Former Member
0 Kudos

It's a pity that the space is not always, and the the number of space is not fixed

varma_narayana
Active Contributor
0 Kudos

Hii..Yang...

In SAP Script Or Smartform you can always use &DATA(C)& to Remove the SPACES.

It should work. there is no need of any workaround for this...

<b>reward if Helpful</b>