on 08-18-2020 7:46 PM
Hello Experts,
I need to get all data of column(LINE) in one variable with some separator.How Can I achieve it. Kindly Explain.
This is the quickest solution I can come up with:
DATA stringvalue TYPE string.
CONSTANTS separator TYPE char1 VALUE ';'.
SELECT column FROM dbtable INTO TABLE DATA(itab).
LOOP AT itab ASSIGNING FIELD-SYMBOL(<value>).
stringvalue = stringvalue && separator && <value>.
ENDLOOP.
stringvalue = stringvalue+1.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
You can do this way too:
SELECT text FROM t100 INTO TABLE @DATA(lt_t100) UP TO 100 ROWS.
DATA(lv_string) = REDUCE string( INIT text1 TYPE string
FOR wa IN lt_t100
NEXT text1 = text1 && ' | ' && wa-text ).
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
101 | |
13 | |
13 | |
11 | |
11 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.