03-11-2009 3:18 PM
hi all,
I need to split a string with RKD_WORD_WRAP, but it seems it takes only chars as input, so I would like to do this: create a char variable dynamically as long as the string in input and then pass it to the RKD_WORD_WRAP. Can anybody please tell me how can I do it? I think I should use field symbol but I don't know them very much.
Thanks in advance.
Gabriele
03-11-2009 3:22 PM
RKD_WORD_WRAP has a limitation to split at a maximum of 3 lines..I wanted you to know about it before proceeding...
[My weblog to split values>>|https://www.sdn.sap.com/irj/scn/wiki?path=/display/snippets/repalcementtoRKD_WORD_WRAP]
03-11-2009 3:29 PM
> RKD_WORD_WRAP has a limitation to split at a maximum of 3 lines..I wanted you to know about it before proceeding...
I used in this way with no lines but table for result for testing:
DATA the_string(300) TYPE c VALUE 'Nel mezzo del cammin di nostra vita mi ritrovai per una selva oscura ché la diritta via era smarrita. Ahi quanto a dir qual era è cosa dura 5 esta selva selvaggia e aspra e forte che nel pensier rinova la paura! '.
CALL FUNCTION 'RKD_WORD_WRAP'
EXPORTING
textline = the_string
DELIMITER = ' '
OUTPUTLEN = 15
TABLES
OUT_LINES = text_table
with this output
Nel mezzo del
cammin di
nostra vita mi
ritrovai per
una selva
oscura ché la
diritta via
era smarrita.
Ahi quanto a
dir qual era è
cosa dura 5
esta selva
selvaggia e
aspra e forte
che nel
pensier rinova
la paura!
so it works with many lines as need: they're just put in the table
now I'll check for split_string FM working ...
03-11-2009 3:33 PM
Hello J@y,
Is it restricted to 3 lines only? I disagree with you my friend. You have the table OUT_LINES which has got all the data in multiple lines.
So where does the 3 lines restriction come into picture?
BR,
Suhas
03-11-2009 3:40 PM
I used in a SAP script and I had to use the export parameters OUT_LINE1 OUT_LINE2 OUT_LINE3... tables OUT_LINES was not suitable for my requirement.... I guess its fine in your case.
03-11-2009 3:23 PM
03-12-2009 8:17 AM
so concluding,
there is no FM that allow me to split a string in substring of a given length on a a given separator: I have to do it manually...
03-12-2009 11:35 AM
>
> so concluding,
> there is no FM that allow me to split a string in substring of a given length on a a given separator: I have to do it manually...
I tried and failed to find one, and did it manually instead.
02-02-2010 9:12 AM
Hello Gabriele,
I'm facing at the same prioblem.
You declared the_string(300) type c.
Is it possible to use an input variable at 720 digit?
I tried but is it trunc ... do you have another idea ?
tks a lot.