‎2009 Aug 18 11:53 AM
Hi ABAPers,
Can you please tell me how to concatenate this two select qureies.
select ebeln knumv from ekko INTO
TABLE tt_knumv
where ebeln = p_ebeln.
select ebeln knumv from eslh INTO TABLE
tt_knumv FOR ALL ENTRIES IN tt_esll
where packno = tt_esll-sub_packno.
Regards
Abhinab Mishra
‎2009 Aug 18 12:06 PM
HI
Use the inner join for the two select statment based on the fied knumv.
‎2009 Aug 18 11:59 AM
Hi,
Use this.
CONCATENATE ITAB1-FIELD1 ITAB2-FIELD2 INTO <REQUIRED FIELD>
Regards,
Shamma
‎2009 Aug 18 12:01 PM
Brother this is a select qurey. I am not talking about concatenating two fields.
‎2009 Aug 18 12:06 PM
HI
Use the inner join for the two select statment based on the fied knumv.
‎2009 Aug 18 12:41 PM
Hi,
I dont think inner join is possible in this case since you are selecting the same fields from the two different tables into the single internal table vertically. It can be used to collect the data into the internal table horizontally but that would make no sense in this case. May be you can try something like this
data: t_temp type table of tt_knumv.
select ebeln knumv
from eslh
INTO TABLE tt_knumv
FOR ALL ENTRIES IN tt_esll
where packno = tt_esll-sub_packno.
select ebeln knumv
from ekko
INTO TABLE t_temp
where ebeln = p_ebeln.
loop at t_temp.
move-corresponding t_temp to tt_knumv.
append tt_knumv.
endloop.
Regards,
Vik
‎2009 Aug 18 12:43 PM
Hi,
You can use Inner join instead using two select queries on the common field.
That is:
Select all fields(from the two tables) into internal table
from table 1 as a inner join table 2 as b on
a~common field name = b~common field name.
Hope it helps
Regards
Mansi
‎2009 Aug 18 12:55 PM
Hello,
Unless I misunderstand your question, why not simply use APPENDING TABLE:
>
>
> select ebeln knumv from ekko INTO
> TABLE tt_knumv
> where ebeln = p_ebeln.
>
> select ebeln knumv from eslh APPENDING TABLE
> tt_knumv FOR ALL ENTRIES IN tt_esll
> where packno = tt_esll-sub_packno.
>
> Regards,
Mark
‎2009 Aug 18 12:55 PM
Hello,
Try this way:
select aebeln aknumv from ekko as a join eslh as b on aebeln = bebeln and aknumv = bknumv
INTO TABLE tt_knumv
where a~ebeln = p_ebeln
and b~packno = tt_esll-sub_packno .
You may fine tune it more for your use.
Check if this can help!
Thanks,
Augustin.
‎2009 Aug 21 7:03 AM