2007 Jan 05 4:27 PM
existing data:
i_input_name( with only one field) contains 4 records
name1
name2
name3
name4
desired output should be a single line separated by ',' into another <b>itab2-result_line</b>
ie <b>itab2-result_line</b> = <b>name1,name2,name3,name4</b>
thanks,
subba
2007 Jan 05 4:31 PM
CONCATENATE NAME1 NAME2 NAME3 NAME4 INTO ITAB2-RESULT SEPARATED BY ','.
Max
2007 Jan 05 4:31 PM
CONCATENATE NAME1 NAME2 NAME3 NAME4 INTO ITAB2-RESULT SEPARATED BY ','.
Max
2007 Jan 05 4:32 PM
Hello,
data: lv_text type string.
LOOP AT ITAB.
CONATENATE LV_TEXT ITAB-FIELD1 into LV_TEXT separeted by ','.
ENDLOOP:
If useful reward.
Vasanth
2007 Jan 05 4:32 PM
hi,
Try this...........
DATA : BEGIN OF itab OCCURS 0,
name TYPE string,
END OF itab.
DATA result TYPE string.
itab-name = '1'.
APPEND itab.
itab-name = '2'.
APPEND itab.
itab-name = '3'.
APPEND itab.
itab-name = '4'.
APPEND itab.
LOOP AT itab.
IF sy-tabix = 1.
CONCATENATE result itab-name INTO result.
ELSE.
CONCATENATE result itab-name INTO result SEPARATED BY ','.
ENDIF.
ENDLOOP.
WRITE result.
Regards
2007 Jan 05 4:33 PM
Loop at your internal table and check if the first record, if so, then simply move the value to RESULT, if not then concatenate the value with RESULT and seperate it with ','. See below.
Loop at i_input_name.
if sy-tabix = 1.
result = i_input_name-field.
else.
concatenate result i_input_name-field into result seperated by ','.
endif.
endloop.
write:/ result.
Regards,
Rich Heilman
Message was edited by:
Rich Heilman
2007 Jan 05 5:29 PM
Please try this,
DATA: v_string TYPE string.
CONCATENATE LINES OF i_scarr INTO v_string SEPARATED BY ','.
WRITE:/ v_string.
* you can replace the v_string with your required internal table field
Regards
Kathirvel
2007 Jan 05 5:42 PM
loop at i_input_name.
concatenate v_str i_input_name-<field> into v_str separated by ','.
endloop.
to remove ',' at the end.
v_strlen = strlen(v_str).
v_str = v_str+0(v_strlen).
2007 Jan 05 5:53 PM
data : V_name type string.
loop at i_input_name.
concatenate v_name i_input_name. separated by ','.
endloop.
v_len = strlen( v_name ). : "to remove last comma
v_len = v_len - 1.
v_name = v_name+0(v_len).
2007 Jan 08 7:18 AM
2007 Jan 08 7:19 AM
2007 Jan 08 9:43 AM
assign a variable name type string
concatenate name1 name2 name3 name4 into name.
bye