cancel
Showing results for 
Search instead for 
Did you mean: 

BASE FOR WHERE ABAP 7.4

shubham_banerjee
Participant

Hello Experts,

I am trying to achieve MOVE-CORRESPONDING with following scenario.

Internal Table #1: lt_plant

werks fabkl country

1000 01

Internal Table #2: lt_name

ident ltext

01 <Country Name>

I am trying to move the country name to from internal table #2 to internal table #1 using FOR with following code, however it's resulting in appending new rows from internal table #2.

lt_plant = value #( base lt_plant
for <fs_name> in lt_name
for <fs_plant> in lt_plant
where ( fabkl = <fs_name>-ident )
(
ltext = <fs_name>-ltext
) ).

Please help me to solve this using BASE/CORRESPONDING, FOR and WHERE.

Thanks in advance.

Sandra_Rossi
Active Contributor

Please use the CODE button to format your code so that it's shown in a more user-friendly format (colorized).

Sandra_Rossi
Active Contributor

For information, here's a better formatting of your data with CODE button.

Internal Table #1: lt_plant

werks  fabkl  ltext
-----  -----  -------
1000   01

Internal Table #2: lt_name

ident  ltext
-----  --------------
01     <Country Name>
View Entire Topic
raga6600
Explorer
0 Kudos

create a tale type "LTT_PLANT" with structure of lt_plant .

lt_plant = VALUE ltt_plant( FOR ls_name IN lt_name FOR ls_plant IN lt_plant WHERE ( fabkl = ls_name-ident ) ( werks = ls_plant-werks

                         fabkl = ls_plant-fabkl 

                         country = ls_name-itext )  ) .