‎2007 Sep 12 8:42 AM
Hi experts,
How can we give a space between each character of a word in sap script output?
Regards
‎2007 Sep 12 8:47 AM
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.
‎2007 Sep 12 8:47 AM
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.
‎2007 Sep 12 8:59 AM
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.