2004 Oct 12 7:19 PM
Hello,
I am almost positive that I have seen a function module which will transfer data from one internal table to another internal table of a different length.
For example, I have an internal table storing the contents of a binary file. The line length of this table is 300. I need to move it to an internal table with line length 255 so I can use it with the function module SO_NEW_DOCUMENT_ATT_SEND_API1.
I realize that this is not an impossible task to accomplish within my ABAP program, but if the code's already there ....
Does anyone know this function module?
Regards
2004 Oct 12 7:31 PM
2004 Oct 12 7:57 PM
2004 Oct 12 8:01 PM
I don't think you need a function module for that. Just try this one:
tab_with_255[] = tab_with_300[].
2004 Oct 12 8:03 PM
2004 Oct 12 8:13 PM
Even if there is a function module or codes for this, you still have to remove 45 bytes from the original.
2004 Oct 12 8:15 PM
2004 Oct 13 4:30 PM
Thanks for this. Yes I did want one that would wrap the text around to the next line, not truncate it.
Now I just need to see if I can get something to work with STRINGs.
2004 Oct 13 5:29 PM
It depends, if you need wordwrapping or not.
Without wordwrap its quite simple and should work similarly to this:
_______________________
tab to string
loop at src_tab assigning <src_tab_wa>.
concatenate my_string <src_tab_wa> into my_string.
endloop.
string to tab
do while strlen(my_string) > 0.
result_wa = my_string.
append result_wa to result_tab.
shift my_string left by result_tab_len places.
enddo.
_______________________
If you need wordwrapping then you could split the joines string at each space. Then loop over all words and see for each word, if the current word will fit into the current result line or not.
If it does: append it to your current line.
If not: append the line buffer to the result table, clear the result line buffer and then append the word to the line buffer (that is: to the next line).
Greetings
Christian
2004 Oct 13 5:44 PM
Hi Mike,
For word wrap, I found this function module:
<b>RKD_WORD_WRAP</b>
Let us know what approach you used from the answers you have got.
Regards,
Subramanian V.