‎2006 May 08 8:08 PM
I have an internal table having a single entry and around 60 fields. each of the fields have varying lengths. Some of the fields have values and others are blank.
for example: my first field has length 4 char and has a value "ABCD". my second field is 10 char and 3rd is 35 char but both are blank. 4th field again has some value say "xyz".
i want "ABCD...(45 spaces)...XYZ.." and so on to be transferred to the file having single line.
I want to pass all the data to a file on application server appending the spaces for the fields having no values.
Please suggest how to achieve this?
Regards
Nishant
‎2006 May 08 8:13 PM
‎2006 May 08 8:13 PM
‎2006 May 08 8:14 PM
‎2006 May 08 8:15 PM
Simply use concatenate F1 f2 f3 f4 into f5. u will get the spaces.
‎2006 May 08 8:18 PM
hi Nishant,
Just use <b>concatente f1 f2 f3 f4</b> into f5 as Madhu said ...
Regards,
Santosh
‎2006 May 08 8:18 PM
Hi Nishanth,
do this way:
concatenate 'ABCD'
` `
'XYZ'
INTO
V_FINAL.
WRITE:/ V_FINAL.
Regards,
ravi
Note that the quotes for the 45 spaces is the quote key near the 1 key(over the tab button on the key board)
Regards,
ravi
‎2006 May 08 8:25 PM
If you structure in your internal table is as you have defined previously, it will write the spaces if you transfer the entire line. You should not need to concatenation at all.
data: begin of itab occurs 0,
fld1(4) type c,
fld2(35) type c,
fld3(10) type c,
fld4(4) type c,
end of itab.
loop at itab.
transfer itab to d1.
endloop.Regards,
Rich Heilman
‎2006 May 09 6:58 AM
hi,
i feel you must be having problems with the space field, as it does not get concatenated ... try using offset instead of concatenating,
hope this would work...
cheers,
Aditya.
‎2006 May 09 7:01 AM
data : m(50) type c.
data : myspace(50) type c.
data : howmany type i.
howmany = 45.
concatenate 'abcd' 'xyz' into m separated by myspace(howmany).
write m.