‎2005 Dec 07 1:07 AM
Hi
I have four fields related with Documennt info record.
document type 3 char value "OSM"
document number 25 char value "G2345-1234"
document version 2 char "01"
docuemnt part 3 char "000"
I have to concatenate all these four field including space into another field (objkey) as follow.
objkey = "OSMG2345-1234 01000"
‎2005 Dec 07 1:11 AM
<b>
concatenate document_type document_number version document_part into objkey.</b>
‎2005 Dec 07 1:12 AM
concatenate document_type document_number into objkey1.
concatenate version document_part into objkey2.
concatenate objkey1 objkey2 into objkey separated by space.
‎2005 Dec 07 1:17 AM
concatenate field1(document type) field2(document number) to fieldA.
Concatenate fieldA field3(docuemnt part ) into fieldB separeated by space.
‎2005 Dec 07 1:23 AM
I want the output like
objkey = "OSMG2345-1234<15 spaces>01000"
because the width of Object number is 25 char
‎2005 Dec 07 1:31 AM
use write statement :
Write: variable( document type) to fieldA.
Write: varible (document number) to fieldA+3(25).
Write: Variable (document version) to fieldA+28(2)
write :varible (docuemnt part) to FieldA+30(3).
‎2005 Dec 07 2:50 AM
Hi,
Try this code.
Concatenate document type document number document version docuemnt part INTO objkey.
The main point is when you declaring you document number, please dont use documentnumber(25) TYPE c, but rather declare it as documentnumber TYPE (refer to the relevant table field name which contain 25 char).
Hopes it helps.
Thanks.
‎2005 Dec 07 3:53 AM
Hi Amandeep,
Store it in a structure gs_dir (for Document Info Record).
begin of gs_dir,
doc_type ...
doc_number ..
version ...
part ...
end of gs_dir.
now store the value in this gs_dir, and wherever u want the concatenated value refer to gs_dir, which will have the value with sufficient number of spaces.
Pls award points and close the thread, if your Question is answered.
Rgds,
Prash >
‎2005 Dec 07 4:02 AM
WRITE: doc_type TO objkey+0(3),
doc_nbr TO objkey+3(25),
doc_ver TO objkey+28(2),
doc_part TO objkey+30(3).
Otherwise, defining a structure with the 4 fields, as described above will be the best option.
Srinivas
‎2005 Dec 07 5:43 AM
if you want to preserve the whitspaces in concatenation dont use single quotes use `
for example.
data: output type string .
concatenate ' 1 2 ' '34 56 78 ' '9 .' into output .
clear output .
concatenate ` 1 2 ` `34 56 78 ` `9 .` into output .
Try this code and see the difference .
Regards
Raja