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: 

Formatting in SAP script

Former Member
0 Kudos

Hi all,

I am using maktx in my report but it is a long field. I want first 10 characters in first line and then next line.

Is there any way to do that

Tina

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Tina,

I feel what you are trying to make use of is called wrapping in SAP Scripts.

For putting a field of 40 char length as maktx in more than one line in a column which can accomodate 10 character, in the first line you need to use field0(10) in the first line at the position where you want to display it and in the next line at the same position you need to mention field11(10). This way you can do the wrapping of the text.

In this case it will be it_mat-maktx0(10) in the first line and it_mat-maktx11(10) in the second line and so on.

Make sure it is included in between && .

you can also use FM 'RKD_WORD_WRAP'. Pass the length of each line that u want and also the string containing the text, it will wrap it and pass it on to an internal table and to three export parameters as 3 lines of text (i.e if u feel that text will not cross more than 3 lines then u can directly get the wrapped texts from these export variables instead of getting it from internal table).

Hope it helps,

Suruchi

4 REPLIES 4

former_member188685
Active Contributor
0 Kudos

hi,

you can do it some thing like this...

<b>&maktx+0(10)&

&maktx+10(10)&</b>

something like this..

Regards

vijay

Former Member
0 Kudos

Tina,

I feel what you are trying to make use of is called wrapping in SAP Scripts.

For putting a field of 40 char length as maktx in more than one line in a column which can accomodate 10 character, in the first line you need to use field0(10) in the first line at the position where you want to display it and in the next line at the same position you need to mention field11(10). This way you can do the wrapping of the text.

In this case it will be it_mat-maktx0(10) in the first line and it_mat-maktx11(10) in the second line and so on.

Make sure it is included in between && .

you can also use FM 'RKD_WORD_WRAP'. Pass the length of each line that u want and also the string containing the text, it will wrap it and pass it on to an internal table and to three export parameters as 3 lines of text (i.e if u feel that text will not cross more than 3 lines then u can directly get the wrapped texts from these export variables instead of getting it from internal table).

Hope it helps,

Suruchi

naimesh_patel
Active Contributor
0 Kudos

hello Tina,

In script it is not possible if the field is not MAIN window.

You can use RKD_WORD_WRAP in you calling program and pass the variables to SAPscript.

Regards,

Naimesh

Reward points, if it is helpful..!

Former Member
0 Kudos

You have to break it up using offsets.. and print them in different lines

for ex: maktx+0(10)

maktx+10(30)...