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: 

Sapscript alignment

Former Member
0 Kudos

Hi experts,

How can we give a space between each character of a word in sap script output?

Regards

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi Ravi,

Split the word using the "Split" command before insert to an internal table.

To split a character string into two or more smaller strings, use the SPLIT statement as follows:

SPLIT <c> AT <del> INTO <c1> ... <cn>.

The system searches the field <c> for the separator <del>. The parts before and after the separator are placed in the target fields <c1> ... <cn>.

To place all fragments in different target fields, you must specify enough target fields. Otherwise, the last target field is filled with the rest of the field <c> and still contains delimiters.

If all target fields are long enough and no fragment has to be truncated, SY-SUBRC is set to 0. Otherwise it is set to 4.

SPLIT LA CA USA AT ' ' INTO <c1>

Thanks,

Reward If Helpful.

2 REPLIES 2

Former Member
0 Kudos

Hi Ravi,

Split the word using the "Split" command before insert to an internal table.

To split a character string into two or more smaller strings, use the SPLIT statement as follows:

SPLIT <c> AT <del> INTO <c1> ... <cn>.

The system searches the field <c> for the separator <del>. The parts before and after the separator are placed in the target fields <c1> ... <cn>.

To place all fragments in different target fields, you must specify enough target fields. Otherwise, the last target field is filled with the rest of the field <c> and still contains delimiters.

If all target fields are long enough and no fragment has to be truncated, SY-SUBRC is set to 0. Otherwise it is set to 4.

SPLIT LA CA USA AT ' ' INTO <c1>

Thanks,

Reward If Helpful.

kiran_k8
Active Contributor
0 Kudos

Ravi,

If you want to give a space between &itab-matnr& and &itab-maktx& when displayed in the scripts output then you can use the TABS in PARAGRAPH FORMATS.There you can mention how many tabs should be equivalents to a space,you can define a single tab mean a space of 2 characters for example

then ,, will give a two charcter space between those two text elements.

&itab-matnr&,,&itab-maktx&.

If any doubt revert it.

K.Kiran.