06-19-2007 2:28 PM
Hi, i am looking for a Method in ABAP that concatenate strings without trim space on any string.
I will send a PDF-Document from the archivelink as attachment in an E-Mail, but the archivelink function deliver the document in lines with 1024 character und the input function for the attachment of the E-Mail need the document in lines with 255 character.
I think, concatenate all lines und seperate them, but sometimes i lose a space.
I try some solutions:
DATA l_document(65535) TYPE c.
DATA line_doc_length TYPE i.
line_doc_length = 0.
LOOP AT archivobject INTO wa_archivobject.
l_document+line_doc_length = wa_archivobject.
line_doc_length = line_doc_length + 1024.
ENDLOOP.
That solution match, but the max length of the document is 65535 character.
I try the same with a dynamic Object like 'Create Data ...', but in this case it is not allowed to use an offset.
Thanks for help
Frank Dehle
06-19-2007 5:16 PM
Hi,
Why don't you declare as string
DATA l_document TYPE string.
aRs
06-19-2007 5:16 PM
Hi,
Why don't you declare as string
DATA l_document TYPE string.
aRs
06-20-2007 6:54 AM
Hi,
thanks for your response, but this was my first try. The one and only command that i found in ABAP to concatenate strings, is 'CONCATENATE' and this command has no option for no trim space und that is, I think, the main problem.
The second problem is, I can't found a function to set the length of a parameter from type string und you receive a compiler error by use offsets and/or length on parameter from type string.
DATA l_document TYPE string. "<<<<<<<<< I try your suggestion
DATA line_doc_length TYPE i.
line_doc_length = 0.
LOOP AT archivobject INTO wa_archivobject.
l_document+line_doc_length = wa_archivobject. "<<<<<<<<<<<<<<< Error
line_doc_length = line_doc_length + 1024.
ENDLOOP.
original message from compiler:
- At the write position, you cannot use offset and length specifications with fields of type "STRING" or "XSTRING". -
Thanks
Frank Dehle
09-19-2007 7:35 PM
use the character ` ` instead of ' '.
example:
DATA: vl_data TYPE string.
CONCATENATE 'a' ` ` 'b' INTO vl_data.
WRITE vl_data.
the output:
a b
09-19-2007 7:45 PM
You can use this code to make sure that a space is inserted between the lines that you are concatenating:
CONCATENATE string_a string_b INTO total_string SEPARATED BY space.
I hope this helps.
- April King