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

Issue with displaying type p in sapscript form

Former Member
0 Likes
923

Hi experts,

How can I display data of type p so that it doesnt appear with too many leading spaces in a SAPScript form. I would like the data to fit in 1 page without the numbers going to the next line becoz there are too many spaces. I have difened the variables as var(6) type p decimals 2.

Please Help.

Regards

Hi experts,

How can I display data of type p so that it doesnt appear with too many leading spaces in a SAPScript form. I would like the data to fit in 1 page without the numbers going to the next line becoz there are too many spaces. I have difened the variables as var(6) type p decimals 2.

Please Help.

Regards

7 REPLIES 7
Read only

Former Member
0 Likes
851

Hi,

In the driver program use shift left statement to delete the leading space,


data: var type p decimals 2.
shift var left deleting leading space.

Now pass this to the script.

Regards,

Vikranth

Read only

0 Likes
851

>

>


> data: var type p decimals 2.
> shift var left deleting leading space.
> 

Doesn't pass a syntax check.

Rob

Read only

0 Likes
851

Thanks to you all.

The values are in an internal table. e.g. begin of itab occurs 0,

p1(6) type p decimals,

p2(6) type p decimals,

p3(6) type p decimals,

p4(6) type p decimals,

p5(6) type p decimals,

end of itab.

how can i do it in this situation?

regards.

Read only

0 Likes
851

just before using it when you pass &itab-p1& to the text field

rather than this put a code element before this, in which assign these two some strings like

data: s1 type string,
         s2 type string,...
                  ..
          ..
           s6 type string.

s1 = itab-p1.
s2 = itab-p2.
s3..
s4.

and

pass &s1& , &s2& to the output text fields...

Read only

0 Likes
851

Thanks again.

The internal table is rather big with about 21 records and 15 fields. Do u mean I shud a variable for EACH of the cells? That is rather tedious. Is there a shorter way of doing that?

Regards.

Read only

0 Likes
851

what ever number of records isnt the concern. as you will be getting the values in loop.

you just need the string variables same number as the number of columns.

and you can also pass them in your driver program and pass this sting table to smartform rather than passing p fields to SF and doing this in smartform

Read only

Former Member
0 Likes
851

assign it to a string.