Application Development 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: 

concatenate string and number type

Former Member
0 Kudos
321

I have a internal table, i need loop the internal table and append the record index to text.

like

loop at itab

CONCATENATE 'INFO' + SY-TABIX into itab-text.

modify itab index SY-TABIX

endloop.

how can i do that. Thanks!

5 REPLIES 5

Former Member
0 Kudos
87

hi,

wat you can do is create a integer variable and inside loop increment it and concatenate it to the INFO and store it in the internal table

0 Kudos
87

Hi,

Assign the sy-tabix to some temporary variable of type String or char.

As follows.

loop at itab

DATA: local_tabix type string.

local_tabix = SY-TABIX.

CONCATENATE 'INFO' + local_tabix into itab-text.

modify itab index SY-TABIX

endloop.

Regards,

Sesh

Message was edited by:

Seshatalpasai Madala

suresh_datti
Active Contributor
0 Kudos
87

try this..


data w_index(10).
loop at itab.
w_index = sy-tabix.
CONCATENATE 'INFO' w-index into itab-text
  separated by '+'.
...
...
endloop

~Suresh

Former Member
0 Kudos
87
data : v_index(5)

loop at itab.
v_index = sy-tabix.
CONCATENATE 'INFO' v_index  into itab-text.
condense itab-text.
modify itab index SY-TABIX.
endloop.

Former Member
0 Kudos
87

hi

good

you can store the SY-TABIX value in to a string varibale and after that using CONTACTENATE command you can concatenate both the strings ,bcz concatente wont allow to joing two different data types.

Thanks

mrutyun^