Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Concatenate itab fields to variable.

Former Member
0 Likes
735

Hi experts;

this is table control on screen and I need the concatenate  that data to string..  (((like this  = T016+L001+L001-0053+T016+L001)))

I need help !!!

Thanks all for support.. !!!

1 ACCEPTED SOLUTION
Read only

vladimir_erakovic
Contributor
0 Likes
671

Hi Erman,

Try like this:

DATA array TYPE string.

LOOP AT brtab INTO brtab_wa.

     IF sy-tabix = 1.

       CONCATENATE array Devre INTO array.

     ELSE.

       CONCATENATE array Devre INTO array SEPARATED BY '+'.

     ENDIF.

     CLEAR brtab_wa.

ENDLOOP.

3 REPLIES 3
Read only

Former Member
0 Likes
671

Hi Erman,

You can take a variable and then loop on the internal table .Then CONCATENATE the value of the first coloumn in to the variable.

Regards,

Santanu.

Read only

vladimir_erakovic
Contributor
0 Likes
672

Hi Erman,

Try like this:

DATA array TYPE string.

LOOP AT brtab INTO brtab_wa.

     IF sy-tabix = 1.

       CONCATENATE array Devre INTO array.

     ELSE.

       CONCATENATE array Devre INTO array SEPARATED BY '+'.

     ENDIF.

     CLEAR brtab_wa.

ENDLOOP.

Read only

Former Member
0 Likes
671

Hello,

try this..

Data lv_array type string.

loop at lt_br  into ls_br.

     if lv_array is initial.

          concatenate ' ' ls_br-devre into lv_array.

     else.

          concatenate lv_array ls_br-devre into lv_array separated by '+'.

     endif.

endloop.