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

Printing in SAP SCRIPT

Former Member
0 Likes
576

Hi Experts,

I have field 'txt1' with character type and length 500. Im printing this field in SAP SCRIPT.

The problem is that if the field has 100 characters, it prints all 100 plus the leading 400 spaces too. It consumes blank spaces in the SCRIPT.

How can i print only 100 characters without any leading spaces.

I tried 'Condense". Its not working.

Please Suggest?

Rajiv Ranjan

Hi Experts,

I have field 'txt1' with character type and length 500. Im printing this field in SAP SCRIPT.

The problem is that if the field has 100 characters, it prints all 100 plus the leading 400 spaces too. It consumes blank spaces in the SCRIPT.

How can i print only 100 characters without any leading spaces.

I tried 'Condense". Its not working.

Please Suggest?

Rajiv Ranjan

3 REPLIES 3
Read only

Former Member
0 Likes
540

hi,

u can condense the field in print program itself and pass it to sapscript.

check this..

data sab(20) type c.

sab = ' 234556'.

write: / sab.

shift sab left deleting leading space.

write: / sab.

or in sapscript command prompt editor u should write like

/: &field(c)&

Regards

CNU

Read only

Former Member
0 Likes
540

Hello,

Yuo can check the length of field. & print field content from 0 till the length of string(field).

Hoep this helps.

Thanks.

Read only

Former Member
0 Likes
540

Hi Rajeev.

declare a string. assign value of char field to string. And condense the string. Then write the string. This will solve your problem.

Ashven