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 Problem

Former Member
0 Likes
1,204

Hello Experts,

I have this piece of code



SELECT ebeln ebelp FROM ekpo
                       INTO it_temp
                       WHERE ebeln = it_temp-ebeln.
      ENDSELECT.

    l_ebeln1 = it_temp-ebeln.
    t_ebelp = it_temp-ebelp.
    CONCATENATE it_temp-ebeln it_temp-ebelp  INTO l_key.
    l_matnr1 = l_key.

Here the ebeln(char10) and ebelp(n5) is not getting into l_key(char70).

can anybody please guide me how to do this.

Regards,

Abhinab Mishra

9 REPLIES 9
Read only

Former Member
0 Likes
1,175

Hi,

Try this.

SELECT ebeln ebelp FROM ekpo

INTO it_temp

WHERE ebeln = it_temp-ebeln.

ENDSELECT.

l_ebeln1 = it_temp-ebeln.

t_ebelp = it_temp-ebelp.

CONCATENATE l_ebeln1 t_ebelp INTO l_key.

l_matnr1 = l_key.

Regards,

Vijay

Read only

0 Likes
1,175

Dear Vijay,

Your solution is not working for me.

Regards,

Abhinab

Read only

former_member209217
Active Contributor
0 Likes
1,175

Hi Abhinab,

I thnk concatenate is possible only for character strings .Move ur numeric field ebelp into a character field and then Concatenate.

Regards,

Lakshman.

Read only

Former Member
0 Likes
1,175

Hi Abhinab,

pass ebelp the numeric field into a character field and thn concatenate..

data:

w_str1(10) type c,

w_str2(5) type c.

w_str1 = it_temp-ebeln.

w_str2 = it_temp-ebelp.

CONCATENATE w_str1 w_str2 INTO l_key.

l_matnr1 = l_key.

Regards.

Read only

Former Member
0 Likes
1,175

Hi Abhinab,

i think when you are fetching data from table that syntax not correct. so data is not coming into the internal table.

Don't use select enselect statement.

follow the code like :

PARAMETERS: ebeln type ebeln.

types: begin of t_ekpo,

ebeln type ebeln,

ebelp type ebelp,

end of t_ekpo.

data: l_var type char70.

data: i_ekpo type standard table of t_ekpo with header line.

  • wa_ekpo type ekpo.

select ebeln ebelp

from ekpo

into table i_ekpo

where ebeln = ebeln.

loop at i_ekpo.

concatenate i_ekpo-ebeln i_ekpo-ebelp into l_var.

write:/ l_var.

endloop.

Hope you understand well.

Regards,

Tutun

Read only

kesavadas_thekkillath
Active Contributor
0 Likes
1,175

Did Vijay's solution work ? Dont think so

This works for me ..

DATA:h TYPE ebeln.

DATA:i TYPE ebelp.

DATA:j(15) TYPE c.

select single ebeln ebelp from ekpo into (h,i).

concatenate h i into j.

write j.

Read only

Former Member
0 Likes
1,175

Hi Abhinab,

change the type of t_ebelp to CHAR lenght 5 at the time of defining it.

because concatenate only works with character and string field types to for others.

Regards,

Raj Gupta

Read only

Former Member
0 Likes
1,175

Got the ans

Read only

Former Member
0 Likes
1,175

hello Abhinab,

Try This..

SELECT SINGLE ebeln ebelp

FROM ekpo INTO CORRESPONDING FIELDS OF it_temp

WHERE ebeln = '2200000693' {Wrtite Your Condictions}

l_ebeln1 = it_temp-ebeln.

t_ebelp = it_temp-ebelp.

CONCATENATE it_temp-ebeln it_temp-ebelp INTO l_key.

l_matnr1 = l_key.

Its working fine.

Vanu.