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

Former Member
0 Kudos

what is meaning of this...

Concatenate 'Result:' itab_batch_char-value_char into itab_deviation_array-cal_results

where above itab_batch_char and itab_deviation_array are internal tables.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi Pranouti,

This means exactly what the statement CONCATENATE is designed for: the content of 'Result:' and itab_batch_char-value_char is concatenated into the structure itab_deviatio_array-cal_result (without SPACE delimiter). All the cancatenated attributes have to have to types C,N,D,T or String. Otherwise it dumps.

An additional recommendation: Never ever use Header lines of an internal table. Instead use the LOOP at <table> into <structure>.

Hope it helps,

Heinz

6 REPLIES 6

former_member230674
Contributor
0 Kudos

hai dongrie,

In your code ,

u are using two internal tables in concatenate statement.

but , u should specify only Character type(C,N,D,T ,STRING)

values only in this statement. So, it gives Error if u try to execute this statement.

if it useful, reward points.

Thank you,

G.V.K.Prasad

Former Member
0 Kudos

Hi Pranouti,

This means exactly what the statement CONCATENATE is designed for: the content of 'Result:' and itab_batch_char-value_char is concatenated into the structure itab_deviatio_array-cal_result (without SPACE delimiter). All the cancatenated attributes have to have to types C,N,D,T or String. Otherwise it dumps.

An additional recommendation: Never ever use Header lines of an internal table. Instead use the LOOP at <table> into <structure>.

Hope it helps,

Heinz

Former Member
0 Kudos

better you convert all variables in Character or string and then concatenate in the same type of variable.

you can use only fields values or string value to contenate, it may a field of internal table of separate string or a constant string.

Reward points if helpful.

Rgs,

Ashok

Former Member
0 Kudos

Your questions is

what is meaning of this...

Concatenate 'Result:' itab_batch_char-value_char into itab_deviation_array-cal_results

where above itab_batch_char and itab_deviation_array are internal tables.

you are concatenating the value of value_char field of table itab_batch_char

into cal_results field of table itab_deviation_array

If both those fields are of char type then you can use this stmt.

For example:

data : begin of itab occurs 0,

value type c,

end of itab.

data : begin of itab1 occurs 0,

value(20) type c,

end of itab1.

itab-value = '501'.

append itab.

loop at itab.

write : / itab-value.

endloop.

concatenate 'Result : 'itab-value into itab1-value.

loop at itab1.

write : / itab1-value.

endloop.

Award points if useful

Former Member
0 Kudos

Concatenate 'Result:' itab_batch_char-value_char into itab_deviation_array-cal_results

Here itab_batch_char[] and itab_deviation_array[] are internal tables but itab_batch_char and itab_deviation_array may be the header line of these internal tables. So the 'Result:' and the header value of itab_batch_char-value_char are concatenated into header value of itab_deviation_array-cal_results

Former Member
0 Kudos

Hi,

Concatenation is the process of joining the multiple strings into a variable.

The variables which are used for the concatenation must have the data type of C,N,D,T and STRING.

We can't use the internal table directly for storing the concatenated data into any of its fields.

If you want to do so, then, declare a STRING variable and store the concatenated information

in it and move it to the internal table filed through the work area.

for example:

data: v_data type string.

types: begin of type1,

str(2000) type c,

end of type1.

data: wa2 type type1,

itab2 type table of type1.

Have some data in the internal table itab1.

loop at itab1 into wa1.

concatenate wa1-field1 wa1-field2 wa1-field2 ... into v_data.

move v_data to wa2-str.

move wa2 to itab2.

append itab2.

clear wa2.

endloop.

Hope the above example may give the clear idea.

Reward points if it solves ur problem.

Regards

Chandrak

Edited by: Chandrasekhar Kottapally on Apr 2, 2008 5:05 PM