‎2010 Apr 16 11:44 AM
hi gurus,
i have 3 value in int table , so want to store the value of int table into single variable of type string.
how it is possible
‎2010 Apr 16 11:59 AM
hmmm, your requirement is kinda weird and you could have given us a bit more info, but well lets start.
Why is your requirement weird?
Well an internal table kinda is a variable itself, or rather a set of variables which together make up for a line type of your table.
So you have a value you already have in a variable and now want to store it in anotherone? Seems weird.
What type is your internal table?
Do you have those three values in one record or in three records which only hold one value each?
Which of your values do you want to store in another variable?
Anyway, make a F1 on the "READ TABLE" statement, this should definiteley help you.
The "LOOP AT WHERE" statement could as well help if there should occur probrlem using READ TABLE.
/edit DAMn i was posting this while you gave us more info.
So still the question stays if you got your three values in one record or in three records.
DATA: lv_variabl_containing_all type char100.
loop at itab into wa.
concatenate lv_variabl_containing_all wa-value into lv_variabl_containing_all seperated by space.
endloop.
after the loop you now got all your values in lv_variabl_containing_all.
That is for the case you got three records.
other case would be
Read table itab into wa index 1.
concatenate wa-value1 wa-value2 wa-value3 into lv_variabl_containing_all.
Edited by: Florian Kemmer on Apr 16, 2010 12:59 PM
‎2010 Apr 16 11:49 AM
‎2010 Apr 16 11:54 AM
my int table has only one field, nd that field contain 3 values.
so i want that 3 values to be store in single variable
‎2010 Apr 16 11:49 AM
>
> i have 3 value in int table , so want to store the value of int table into single variable of type string.
Before answering , why do you want to do this ?
‎2023 Dec 18 6:17 AM
‎2010 Apr 16 11:54 AM
Hi,
data:
w_string type string.
loop at t_tab into fs_tab.
concatenate fs_tab-field1 w_string into w_string seperated by space.
endloop.
Regards and Best wishes.
‎2020 Apr 24 12:34 PM
I get result in post1 field and in that field data i get that is a string
from that string i have take first 8 characters excluding dot
but getting multiple rows with different data in amdp
so how can i solve this?
‎2010 Apr 16 11:59 AM
hmmm, your requirement is kinda weird and you could have given us a bit more info, but well lets start.
Why is your requirement weird?
Well an internal table kinda is a variable itself, or rather a set of variables which together make up for a line type of your table.
So you have a value you already have in a variable and now want to store it in anotherone? Seems weird.
What type is your internal table?
Do you have those three values in one record or in three records which only hold one value each?
Which of your values do you want to store in another variable?
Anyway, make a F1 on the "READ TABLE" statement, this should definiteley help you.
The "LOOP AT WHERE" statement could as well help if there should occur probrlem using READ TABLE.
/edit DAMn i was posting this while you gave us more info.
So still the question stays if you got your three values in one record or in three records.
DATA: lv_variabl_containing_all type char100.
loop at itab into wa.
concatenate lv_variabl_containing_all wa-value into lv_variabl_containing_all seperated by space.
endloop.
after the loop you now got all your values in lv_variabl_containing_all.
That is for the case you got three records.
other case would be
Read table itab into wa index 1.
concatenate wa-value1 wa-value2 wa-value3 into lv_variabl_containing_all.
Edited by: Florian Kemmer on Apr 16, 2010 12:59 PM
‎2010 Apr 16 12:11 PM
‎2010 Apr 16 12:12 PM
well so you need to sort your itab BEFORE looping at it the way you need it.
/edit typos corrected
Edited by: Florian Kemmer on Apr 16, 2010 1:12 PM