‎2007 Dec 14 4:53 AM
halo,
I ' ve an itab which has 2 fields out of which 1 field has longtext as its
content(in no.of records)..i want to move all these records(longtext) into
a string variable which inturn i'm passing to an attribute of a method.
Is it possible to move the records of an itab to a string variable? if so, how?
Thank you.
-Swaminathan.
‎2007 Dec 14 5:07 AM
Hi Swami,
If my understanding is correct. Check the below logic.
Loop at itab.
concatenate string itab-field1 into string.
(You can use specific feild separator to make an identity of each record.)
Endloop.
‎2007 Dec 14 5:11 AM
data: it001 type table of t001 with header line.
data: string type string.
select * into table it001 from t001.
loop at it001.
concatenate string it001 into string separated by ','.
endloop.
shift string left deleting leading ','.
write:/ string.
Regards
‎2007 Dec 14 5:20 AM
Hi Swami,
For moving the internal table value to local variable it will be like this.
READ TABLE int_tab with key pernr = p_pernr
for all entries in int_tab.
loc_pernr = int_tab-pernr.
loc_name = int_tab-name.
Like this way you can move value from internal table to local variable.
************************
Using the below method you will be moving the value from local varaible to internal table by this method.
Here loc_nname,loc_init are local variables.
SELECT SINGLE nachn inits FROM pa0002
INTO (loc_name,loc_init)
WHERE pernr EQ int_employee-wf_pernr."#EC *
CONCATENATE loc_name loc_init
INTO int_employee-wf_ename SEPARATED BY ', '.
****************
Thanks,
Sakthi C
*Rewards if useful*